Package com.jalios.jcms.mashup
Class ExportUtil
- java.lang.Object
-
- com.jalios.jcms.mashup.ExportUtil
-
- All Implemented Interfaces:
MashupConstants
public class ExportUtil extends java.lang.Object implements MashupConstants
This class provides utility methods for the ExportManager.- Since:
- jcms-5.7.2
- Version:
- $Revision: 118938 $
- Author:
- Olivier Dedieu
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
REVISION
-
Fields inherited from interface com.jalios.jcms.mashup.MashupConstants
DATA_TAG, DATASET_TAG, FIELD_CLASS, FIELD_ENTRY, FIELD_ITEM, FIELD_KEY, FIELD_NAME, FIELD_TAG, FIELD_VALUE, FILE_FIELD, FILE_ID, FILE_MTIME, FILE_SIZE, FILE_TAG, FILE_TICKET, FILESET_TAG, RELATED_TAG
-
-
Constructor Summary
Constructors Constructor Description ExportUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
exportField(int indentLevel, java.lang.String name, boolean value)
Returns a XML representation of a primitive boolean field.static java.lang.String
exportField(int indentLevel, java.lang.String name, boolean[] value)
Returns a XML representation of a boolean array field.static java.lang.String
exportField(int indentLevel, java.lang.String name, double value)
Returns a XML representation of a primitive double field.static java.lang.String
exportField(int indentLevel, java.lang.String name, double[] value)
Returns a XML representation of a primitive double array field.static java.lang.String
exportField(int indentLevel, java.lang.String name, int value)
Returns a XML representation of a primitive integer field.static java.lang.String
exportField(int indentLevel, java.lang.String name, int[] value)
Returns a XML representation of a primitive integer array field.static java.lang.String
exportField(int indentLevel, java.lang.String name, long value)
Returns a XML representation of a primitive long integer field.static java.lang.String
exportField(int indentLevel, java.lang.String name, long[] value)
Returns a XML representation of a primitive long integer array field.static java.lang.String
exportField(int indentLevel, java.lang.String name, Data value)
Returns a XML representation of a data field.static java.lang.String
exportField(int indentLevel, java.lang.String name, Data[] value)
Returns a XML representation of a data array field.static java.lang.String
exportField(int indentLevel, java.lang.String name, Data[] value, java.lang.String mlField)
Returns a XML representation of a Data array field.static java.lang.String
exportField(int indentLevel, java.lang.String name, Data value, java.lang.String mlField)
Returns a XML representation of a text field.static java.lang.String
exportField(int indentLevel, java.lang.String name, java.lang.String value)
Returns a XML representation of a text field.static java.lang.String
exportField(int indentLevel, java.lang.String name, java.lang.String[] value)
Returns a XML representation of a String array field.static java.lang.String
exportField(int indentLevel, java.lang.String name, java.lang.String[] value, boolean isAbstract)
Returns a XML representation of a String array field.static java.lang.String
exportField(int indentLevel, java.lang.String name, java.lang.String[] value, boolean isAbstract, boolean unescapeHTML)
Returns a XML representation of a String array field.static java.lang.String
exportField(int indentLevel, java.lang.String name, java.lang.String[] value, java.lang.String mlField)
Returns a XML representation of a String array field.static java.lang.String
exportField(int indentLevel, java.lang.String name, java.lang.String[] value, java.lang.String mlField, boolean isAbstract)
Returns a XML representation of a String array field.static java.lang.String
exportField(int indentLevel, java.lang.String name, java.lang.String[] value, java.lang.String mlField, boolean isAbstract, boolean unescapeHTML)
Returns a XML representation of a String array field.static java.lang.String
exportField(int indentLevel, java.lang.String name, java.lang.String value, boolean isAbstract)
Returns a XML representation of a text field.static java.lang.String
exportField(int indentLevel, java.lang.String name, java.lang.String value, boolean isAbstract, boolean unescapeHTML)
Returns a XML representation of a text field.static java.lang.String
exportField(int indentLevel, java.lang.String name, java.lang.String value, java.lang.String mlField)
Returns a XML representation of a text field.static java.lang.String
exportField(int indentLevel, java.lang.String name, java.lang.String value, java.lang.String[] attNames, java.lang.String[] attValues)
Returns a XML representation of a text field with attributesstatic java.lang.String
exportField(int indentLevel, java.lang.String name, java.lang.String value, java.lang.String mlField, boolean isAbstract)
Returns a XML representation of a text field.static java.lang.String
exportField(int indentLevel, java.lang.String name, java.lang.String value, java.lang.String mlField, boolean isAbstract, boolean unescapeHTML)
Returns a XML representation of a text field.static java.lang.String
exportField(int indentLevel, java.lang.String name, java.util.Collection<?> values)
Returns a XML representation of a data collection field (Data or String).static java.lang.String
exportField(int indentLevel, java.lang.String name, java.util.Collection<?> values, java.lang.String nameML)
Returns a XML representation of a homogeneous collection (Data, String, Boolean, Number and Date).static java.lang.String
exportField(int indentLevel, java.lang.String name, java.util.Date value)
Returns a XML representation of a date field.static java.lang.String
exportField(int indentLevel, java.lang.String name, java.util.Date[] value)
Returns a XML representation of a date array field.static java.lang.String
exportField(int indentLevel, java.lang.String name, java.util.Locale value)
Returns a XML representation of a Locale field.static java.lang.String
exportField(int indentLevel, java.lang.String name, java.util.Map map)
Returns a XML representation of a map field.static java.lang.String
exportField(int indentLevel, java.lang.String name, java.util.Map map, boolean unescapeHTML)
Returns a XML representation of a map field.static java.lang.String
exportFile(int indentLevel, java.lang.String fieldName, FileDocument doc)
Returns a XML representation of a FileDocument.static java.lang.String
exportFile(int indentLevel, java.lang.String fieldName, FileDocument[] docs)
Returns a XML representation of an array of FileDocument.static java.lang.String
exportFile(int indentLevel, java.lang.String fieldName, java.lang.String filename)
Returns a XML representation of a file.static java.lang.String
exportFile(int indentLevel, java.lang.String fieldName, java.lang.String[] filenames)
Returns a XML representation of an array of files.static java.lang.String
exportFile(int indentLevel, java.lang.String fieldName, java.lang.String filename, java.lang.String id)
Returns a XML representation of a file.static java.lang.String
exportRelated(int indentLevel, java.lang.String name, java.lang.Object value)
Returns a XML representation of a related (result of a method, after computation or search from an index).static java.lang.String
getIndent(int indentLevel)
Returns a String of indentLevel * INDENT_UNIT.
-
-
-
Field Detail
-
REVISION
public static final java.lang.String REVISION
- See Also:
- Constant Field Values
-
-
Method Detail
-
exportRelated
public static java.lang.String exportRelated(int indentLevel, java.lang.String name, java.lang.Object value)
Returns a XML representation of a related (result of a method, after computation or search from an index).- Parameters:
indentLevel
- the indentation levelname
- the realted's namevalue
- the related's value- Returns:
- a XML representation of a related.
- Since:
- jcms-6.1
-
exportField
public static java.lang.String exportField(int indentLevel, java.lang.String name, java.lang.String value)
Returns a XML representation of a text field.- Parameters:
indentLevel
- the indentation levelname
- the field's namevalue
- the field's value- Returns:
- a XML representation of a date field.
- Since:
- jcms-5.7.2
-
exportField
public static java.lang.String exportField(int indentLevel, java.lang.String name, java.lang.String value, boolean isAbstract)
Returns a XML representation of a text field.- Parameters:
indentLevel
- the indentation levelname
- the field's namevalue
- the field's valueisAbstract
- is it the abstact field?- Returns:
- a XML representation of a date field.
- Since:
- jcms-6.0.1
-
exportField
public static java.lang.String exportField(int indentLevel, java.lang.String name, java.lang.String value, boolean isAbstract, boolean unescapeHTML)
Returns a XML representation of a text field.- Parameters:
indentLevel
- the indentation levelname
- the field's namevalue
- the field's valueisAbstract
- is it the abstact field?unescapeHTML
- set to true to unescape HTML PRIOR to HTML attribute encoding, set to false to only perform HTML attribute encoding.
Unescaping the HTML is needed when working with text value stored inside JCMS Data. Indeed, text entered by the user is escaped usingJcmsUtil.escapeHtml(String)
prior being saved in the Data fields, thus in order to outpu the text exactly as entered by the user, unescaping the input usingJcmsUtil.unescapeHtml(String)
is necessary.- Returns:
- a XML representation of a date field.
- Since:
- jcms-9.0.0
-
exportField
public static java.lang.String exportField(int indentLevel, java.lang.String name, java.lang.String value, java.lang.String mlField)
Returns a XML representation of a text field.- Parameters:
indentLevel
- the indentation levelname
- the field's namevalue
- the field's valuemlField
- the name of the ML Field bound to this field- Returns:
- a XML representation of a date field.
- Since:
- jcms-6.0.1
-
exportField
public static java.lang.String exportField(int indentLevel, java.lang.String name, java.lang.String value, java.lang.String mlField, boolean isAbstract)
Returns a XML representation of a text field.- Parameters:
indentLevel
- the indentation levelname
- the field's namevalue
- the field's valuemlField
- the name of the ML Field bound to this fieldisAbstract
- is it the abstact field?- Returns:
- a XML representation of a date field.
- Since:
- jcms-6.0.1
-
exportField
public static java.lang.String exportField(int indentLevel, java.lang.String name, java.lang.String value, java.lang.String mlField, boolean isAbstract, boolean unescapeHTML)
Returns a XML representation of a text field.- Parameters:
indentLevel
- the indentation levelname
- the field's namevalue
- the field's valuemlField
- the name of the ML Field bound to this fieldisAbstract
- is it the abstact field?unescapeHTML
- set to true to unescape HTML PRIOR to HTML attribute encoding, set to false to only perform HTML attribute encoding.
Unescaping the HTML is needed when working with text value stored inside JCMS Data. Indeed, text entered by the user is escaped usingJcmsUtil.escapeHtml(String)
prior being saved in the Data fields, thus in order to outpu the text exactly as entered by the user, unescaping the input usingJcmsUtil.unescapeHtml(String)
is necessary.- Returns:
- a XML representation of a date field.
- Since:
- jcms-9.0.0
-
exportField
public static java.lang.String exportField(int indentLevel, java.lang.String name, Data value, java.lang.String mlField)
Returns a XML representation of a text field.- Parameters:
indentLevel
- the indentation levelname
- the field's namevalue
- the field's valuemlField
- the name of the ML Field bound to this field- Returns:
- a XML representation of a date field.
- Since:
- jcms-7.0.1
-
exportField
public static java.lang.String exportField(int indentLevel, java.lang.String name, java.lang.String value, java.lang.String[] attNames, java.lang.String[] attValues)
Returns a XML representation of a text field with attributes- Parameters:
indentLevel
- the indentation levelname
- the field's namevalue
- the field's valueattNames
- an array of attribute namesattValues
- an array of attribute values- Returns:
- a XML representation of a date field.
- Since:
- jcms-5.7.2
-
exportField
public static java.lang.String exportField(int indentLevel, java.lang.String name, Data[] value, java.lang.String mlField)
Returns a XML representation of a Data array field.- Parameters:
indentLevel
- the indentation levelname
- the field's namevalue
- the field's valuemlField
- the name of the ML Field bound to this field- Returns:
- a XML representation of a date field.
- Since:
- jcms-7.0.1
-
exportField
public static java.lang.String exportField(int indentLevel, java.lang.String name, Data value)
Returns a XML representation of a data field.- Parameters:
indentLevel
- the indentation levelname
- the field's namevalue
- the field's value- Returns:
- a XML representation of a date field.
- Since:
- jcms-5.7.2
-
exportField
public static java.lang.String exportField(int indentLevel, java.lang.String name, Data[] value)
Returns a XML representation of a data array field.- Parameters:
indentLevel
- the indentation levelname
- the field's namevalue
- the field's value- Returns:
- a XML representation of a date field.
- Since:
- jcms-5.7.2
-
exportField
public static java.lang.String exportField(int indentLevel, java.lang.String name, java.util.Collection<?> values)
Returns a XML representation of a data collection field (Data or String).- Parameters:
indentLevel
- the indentation levelname
- the field's namevalues
- the collection of Data or String- Returns:
- a XML representation of a collection field.
- Since:
- jcms-6.0.0
-
exportField
public static java.lang.String exportField(int indentLevel, java.lang.String name, java.util.Collection<?> values, java.lang.String nameML)
Returns a XML representation of a homogeneous collection (Data, String, Boolean, Number and Date).- Parameters:
indentLevel
- the indentation levelname
- the field's namevalues
- the collection of Data or StringnameML
- the name of the ML Field bound to this field- Returns:
- a XML representation of a collection field.
- Since:
- jcms-7.0.1
-
exportField
public static java.lang.String exportField(int indentLevel, java.lang.String name, java.lang.String[] value)
Returns a XML representation of a String array field.- Parameters:
indentLevel
- the indentation levelname
- the field's namevalue
- the field's value- Returns:
- a XML representation of a data String field.
- Since:
- jcms-5.7.2
-
exportField
public static java.lang.String exportField(int indentLevel, java.lang.String name, java.lang.String[] value, boolean isAbstract)
Returns a XML representation of a String array field.- Parameters:
indentLevel
- the indentation levelname
- the field's namevalue
- the field's valueisAbstract
- is it the abstact field?- Returns:
- a XML representation of a data String field.
- Since:
- jcms-6.0.1
-
exportField
public static java.lang.String exportField(int indentLevel, java.lang.String name, java.lang.String[] value, boolean isAbstract, boolean unescapeHTML)
Returns a XML representation of a String array field.- Parameters:
indentLevel
- the indentation levelname
- the field's namevalue
- the field's valueisAbstract
- is it the abstact field?unescapeHTML
- set to true to unescape HTML PRIOR to HTML attribute encoding, set to false to only perform HTML attribute encoding.
Unescaping the HTML is needed when working with text value stored inside JCMS Data. Indeed, text entered by the user is escaped usingJcmsUtil.escapeHtml(String)
prior being saved in the Data fields, thus in order to outpu the text exactly as entered by the user, unescaping the input usingJcmsUtil.unescapeHtml(String)
is necessary.- Returns:
- a XML representation of a data String field.
- Since:
- jcms-9.0.0
-
exportField
public static java.lang.String exportField(int indentLevel, java.lang.String name, java.lang.String[] value, java.lang.String mlField)
Returns a XML representation of a String array field.- Parameters:
indentLevel
- the indentation levelname
- the field's namevalue
- the field's valuemlField
- the name of the ML Field bound to this field- Returns:
- a XML representation of a data String field.
- Since:
- jcms-6.0.1
-
exportField
public static java.lang.String exportField(int indentLevel, java.lang.String name, java.lang.String[] value, java.lang.String mlField, boolean isAbstract)
Returns a XML representation of a String array field.- Parameters:
indentLevel
- the indentation levelname
- the field's namevalue
- the field's valuemlField
- the name of the ML Field bound to this fieldisAbstract
- is it the abstact field?- Returns:
- a XML representation of a data String field.
- Since:
- jcms-6.0.1
-
exportField
public static java.lang.String exportField(int indentLevel, java.lang.String name, java.lang.String[] value, java.lang.String mlField, boolean isAbstract, boolean unescapeHTML)
Returns a XML representation of a String array field.- Parameters:
indentLevel
- the indentation levelname
- the field's namevalue
- the field's valuemlField
- the name of the ML Field bound to this fieldisAbstract
- is it the abstact field?unescapeHTML
- set to true to unescape HTML PRIOR to HTML attribute encoding, set to false to only perform HTML attribute encoding.
Unescaping the HTML is needed when working with text value stored inside JCMS Data. Indeed, text entered by the user is escaped usingJcmsUtil.escapeHtml(String)
prior being saved in the Data fields, thus in order to outpu the text exactly as entered by the user, unescaping the input usingJcmsUtil.unescapeHtml(String)
is necessary.- Returns:
- a XML representation of a data String field.
- Since:
- jcms-9.0.0
-
exportField
public static java.lang.String exportField(int indentLevel, java.lang.String name, java.util.Date value)
Returns a XML representation of a date field.- Parameters:
indentLevel
- the indentation levelname
- the field's namevalue
- the field's value- Returns:
- a XML representation of a date field.
- Since:
- jcms-5.7.2
-
exportField
public static java.lang.String exportField(int indentLevel, java.lang.String name, java.util.Date[] value)
Returns a XML representation of a date array field.- Parameters:
indentLevel
- the indentation levelname
- the field's namevalue
- the field's value- Returns:
- a XML representation of a date array field.
- Since:
- jcms-5.7.2
-
exportField
public static java.lang.String exportField(int indentLevel, java.lang.String name, int value)
Returns a XML representation of a primitive integer field.- Parameters:
indentLevel
- the indentation levelname
- the field's namevalue
- the field's value- Returns:
- a XML representation of a primitive integer field.
- Since:
- jcms-5.7.2
-
exportField
public static java.lang.String exportField(int indentLevel, java.lang.String name, int[] value)
Returns a XML representation of a primitive integer array field.- Parameters:
indentLevel
- the indentation levelname
- the field's namevalue
- the field's value- Returns:
- a XML representation of a primitive integer array field.
- Since:
- jcms-5.7.2
-
exportField
public static java.lang.String exportField(int indentLevel, java.lang.String name, long value)
Returns a XML representation of a primitive long integer field.- Parameters:
indentLevel
- the indentation levelname
- the field's namevalue
- the field's value- Returns:
- a XML representation of a primitive long integer field.
- Since:
- jcms-5.7.2
-
exportField
public static java.lang.String exportField(int indentLevel, java.lang.String name, long[] value)
Returns a XML representation of a primitive long integer array field.- Parameters:
indentLevel
- the indentation levelname
- the field's namevalue
- the field's value- Returns:
- a XML representation of a primitive long integer array field.
- Since:
- jcms-5.7.2
-
exportField
public static java.lang.String exportField(int indentLevel, java.lang.String name, double value)
Returns a XML representation of a primitive double field.- Parameters:
indentLevel
- the indentation levelname
- the field's namevalue
- the field's value- Returns:
- a XML representation of a primitive double field.
- Since:
- jcms-5.7.2
-
exportField
public static java.lang.String exportField(int indentLevel, java.lang.String name, double[] value)
Returns a XML representation of a primitive double array field.- Parameters:
indentLevel
- the indentation levelname
- the field's namevalue
- the field's value- Returns:
- a XML representation of a primitive double array field.
- Since:
- jcms-5.7.2
-
exportField
public static java.lang.String exportField(int indentLevel, java.lang.String name, boolean value)
Returns a XML representation of a primitive boolean field.- Parameters:
indentLevel
- the indentation levelname
- the field's namevalue
- the field's value- Returns:
- a XML representation of a primitive boolean field.
- Since:
- jcms-5.7.2
-
exportField
public static java.lang.String exportField(int indentLevel, java.lang.String name, java.util.Locale value)
Returns a XML representation of a Locale field.- Parameters:
indentLevel
- the indentation levelname
- the field's namevalue
- the field's value- Returns:
- a XML representation of a Locale field.
- Since:
- jcms-6.1.0
-
exportField
public static java.lang.String exportField(int indentLevel, java.lang.String name, boolean[] value)
Returns a XML representation of a boolean array field.- Parameters:
indentLevel
- the indentation levelname
- the field's namevalue
- the field's value- Returns:
- a XML representation of a boolean array field.
- Since:
- jcms-5.7.2
-
exportField
public static java.lang.String exportField(int indentLevel, java.lang.String name, java.util.Map map)
Returns a XML representation of a map field.- Parameters:
indentLevel
- the indentation levelname
- the field's namemap
- the map to be exported- Returns:
- a XML representation of a map field.
- Since:
- jcms-5.7.2
-
exportField
public static java.lang.String exportField(int indentLevel, java.lang.String name, java.util.Map map, boolean unescapeHTML)
Returns a XML representation of a map field.- Parameters:
indentLevel
- the indentation levelname
- the field's namemap
- the map to be exportedunescapeHTML
- set to true to unescape HTML PRIOR to HTML attribute encoding, set to false to only perform HTML attribute encoding.
Unescaping the HTML is needed when working with text value stored inside JCMS Data. Indeed, text entered by the user is escaped usingJcmsUtil.escapeHtml(String)
prior being saved in the Data fields, thus in order to outpu the text exactly as entered by the user, unescaping the input usingJcmsUtil.unescapeHtml(String)
is necessary.- Returns:
- a XML representation of a map field.
- Since:
- jcms-9.0.0
-
exportFile
public static java.lang.String exportFile(int indentLevel, java.lang.String fieldName, java.lang.String filename)
Returns a XML representation of a file.- Parameters:
indentLevel
- the indentation levelfieldName
- the field's namefilename
- the filename- Returns:
- a XML representation of a file.
- Since:
- jcms-5.7.2
-
exportFile
public static java.lang.String exportFile(int indentLevel, java.lang.String fieldName, java.lang.String[] filenames)
Returns a XML representation of an array of files.- Parameters:
indentLevel
- the indentation levelfieldName
- the field's namefilenames
- an array of filenames- Returns:
- a XML representation of an array of files.
- Since:
- jcms-5.7.2
-
exportFile
public static java.lang.String exportFile(int indentLevel, java.lang.String fieldName, java.lang.String filename, java.lang.String id)
Returns a XML representation of a file.- Parameters:
indentLevel
- the indentation levelfieldName
- the field's namefilename
- the filenameid
- the id of the FileDocument bound to this file- Returns:
- a XML representation of a file.
- Since:
- jcms-5.7.2
-
exportFile
public static java.lang.String exportFile(int indentLevel, java.lang.String fieldName, FileDocument doc)
Returns a XML representation of a FileDocument.- Parameters:
indentLevel
- the indentation levelfieldName
- the field's namedoc
- the FileDocument- Returns:
- a XML representation of a FileDocument.
- Since:
- jcms-5.7.2
-
exportFile
public static java.lang.String exportFile(int indentLevel, java.lang.String fieldName, FileDocument[] docs)
Returns a XML representation of an array of FileDocument.- Parameters:
indentLevel
- the indentation levelfieldName
- the field's namedocs
- the array of FileDocument- Returns:
- a XML representation of an array of FileDocument.
- Since:
- jcms-5.7.2
-
getIndent
public static java.lang.String getIndent(int indentLevel)
Returns a String of indentLevel * INDENT_UNIT.- Parameters:
indentLevel
- the indentation level- Returns:
- a String of indentLevel * INDENT_UNIT.
- Since:
- jcms-5.7.2
-
-