Package com.jalios.jcms.mashup
Class ImportUtil
java.lang.Object
com.jalios.jcms.mashup.ImportUtil
- All Implemented Interfaces:
MashupConstants
This class provides utility methods for the ImportManager.
- Since:
- jcms-5.7.2
- Author:
- Olivier Dedieu
-
Field Summary
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic org.jdom.ElementparseField(org.jdom.Element elt, String name) Returns a named field under a given elt.static booleanparseFieldBoolean(org.jdom.Element elt, String name) Returns the boolean of the given field.static boolean[]parseFieldBooleanArray(org.jdom.Element elt, String name) Returns the boolean array of the given field.parseFieldBooleanList(org.jdom.Element elt, String name) Returns the boolean set of the given field.parseFieldBooleanSet(org.jdom.Element elt, String name) Returns the boolean set of the given field.static DataparseFieldData(org.jdom.Element elt, String name) Returns the data of the given field.static Data[]parseFieldDataArray(org.jdom.Element elt, String name, Class clazz) Returns the data array of the given field.parseFieldDataList(org.jdom.Element elt, String name, Class<T> clazz) Returns the data list of the given field.parseFieldDataSet(org.jdom.Element elt, String name, Class<T> clazz) Returns the data set of the given field.static DateparseFieldDate(org.jdom.Element elt, String name) Returns the date of the given field.static Date[]parseFieldDateArray(org.jdom.Element elt, String name) Returns the date array of the given field.parseFieldDateList(org.jdom.Element elt, String name) Returns the date list of the given field.parseFieldDateSet(org.jdom.Element elt, String name) Returns the date set of the given field.static doubleparseFieldDouble(org.jdom.Element elt, String name) Returns the double of the given field.static double[]parseFieldDoubleArray(org.jdom.Element elt, String name) Returns the double array of the given field.parseFieldDoubleList(org.jdom.Element elt, String name) Returns the double set of the given field.parseFieldDoubleSet(org.jdom.Element elt, String name) Returns the double set of the given field.static intparseFieldInt(org.jdom.Element elt, String name) Returns the int of the given field.static int[]parseFieldIntArray(org.jdom.Element elt, String name) Returns the int array of the given field.parseFieldIntList(org.jdom.Element elt, String name) Returns the int set of the given field.parseFieldIntSet(org.jdom.Element elt, String name) Returns the int set of the given field.static longparseFieldLong(org.jdom.Element elt, String name) Returns the long of the given field.static long[]parseFieldLongArray(org.jdom.Element elt, String name) Returns the long array of the given field.parseFieldLongList(org.jdom.Element elt, String name) Returns the long set of the given field.parseFieldLongSet(org.jdom.Element elt, String name) Returns the long set of the given field.static StringparseFieldMemberLogin(org.jdom.Element elt, String name) Returns the login of the given member field.static List<org.jdom.Element> parseFieldsByClass(org.jdom.Element elt, String className) Returns all the children with the given class attribute.static StringparseFieldText(org.jdom.Element elt, String name) Returns the text of the given field.static StringparseFieldText(org.jdom.Element elt, String name, boolean trim) Returns the text of the given field.static String[]parseFieldTextArray(org.jdom.Element elt, String name) Returns the array of text of the given field.static String[]parseFieldTextArray(org.jdom.Element elt, String name, boolean trim) Returns the array of text of the given field.parseFieldTextArrayML(org.jdom.Element elt, String name) Returns the language map of text array of the given field.parseFieldTextList(org.jdom.Element elt, String name) Returns the set of text of the given field.parseFieldTextList(org.jdom.Element elt, String name, boolean trim) Returns the set of text of the given field.parseFieldTextListML(org.jdom.Element elt, String name) Returns the language map of text array of the given field.parseFieldTextML(org.jdom.Element elt, String name) Returns the language map of the given field.parseFieldTextSet(org.jdom.Element elt, String name) Returns the list of text of the given field.parseFieldTextSet(org.jdom.Element elt, String name, boolean trim) Returns the list of text of the given field.static StringparseFieldWiki(org.jdom.Element elt, String name) Returns the text of the given wiki field.static String[]parseFieldWikiArray(org.jdom.Element elt, String name) Returns the array of text of the given wiki field.parseFieldWikiArrayML(org.jdom.Element elt, String name) Returns the language map of text array of the given wiki field.parseFieldWikiList(org.jdom.Element elt, String name) Returns the list of text of the given wiki field.parseFieldWikiML(org.jdom.Element elt, String name) Returns the language map of the given wiki field.parseFieldWikiSet(org.jdom.Element elt, String name) Returns the set of text of the given wiki field.static StringparseFieldWysiwyg(org.jdom.Element elt, String name) Returns the text of the given wysiwyg field.static String[]parseFieldWysiwygArray(org.jdom.Element elt, String name) Returns the array of text of the given wysiwyg field.parseFieldWysiwygArrayML(org.jdom.Element elt, String name) Returns the language map of text array of the given wysiwyg field.parseFieldWysiwygList(org.jdom.Element elt, String name) Returns the list of text of the given wysiwyg field.parseFieldWysiwygListML(org.jdom.Element elt, String name) Returns the language map of text array of the given wysiwyg field.parseFieldWysiwygML(org.jdom.Element elt, String name) Returns the language map of the given wysiwyg field.parseFieldWysiwygSet(org.jdom.Element elt, String name) Returns the set of text of the given wysiwyg field.static <T extends Data>
TparseSelfFieldData(org.jdom.Element elt, String name, Class<T> clazz) Returns the data of the given field using id from current webapp.static <T extends Data>
T[]parseSelfFieldDataArray(org.jdom.Element elt, String name, Class<T> clazz) Returns the data array of the given field, using id from current webapp.parseSelfFieldDataArrayML(org.jdom.Element elt, String name, Class<T> clazz) Returns the data array of the given multilingual field, using id from current webapp.parseSelfFieldDataList(org.jdom.Element elt, String name, Class<T> clazz) Returns the data list of the given field, using id from current webapp.parseSelfFieldDataML(org.jdom.Element elt, String name, Class<T> clazz) Returns the data of the given multilingual field, using id from current webapp.parseSelfFieldDataSet(org.jdom.Element elt, String name, Class<T> clazz) Returns the data set of the given field, using id from current webapp.
-
Constructor Details
-
ImportUtil
public ImportUtil()
-
-
Method Details
-
parseField
Returns a named field under a given elt.- Parameters:
elt- a JDom Elementname- the name of the field.- Returns:
- a named field under a given elt.
- Since:
- jcms-5.7.2
-
parseFieldText
Returns the text of the given field.- Parameters:
elt- the JDOM elementname- the name of the fieldtrim- if true, trim the text- Returns:
- the text of the given field (null if this field does not exist).
-
parseFieldText
Returns the text of the given field. The text is trimed.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the text of the given field (null if this field does not exist).
-
parseFieldTextArray
Returns the array of text of the given field.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the array of text of the given field (null if this field does not exist).
-
parseFieldTextArray
Returns the array of text of the given field.- Parameters:
elt- the JDOM elementname- the name of the fieldtrim- if true, trim the text- Returns:
- the array of text of the given field (null if this field does not exist).
-
parseFieldTextSet
Returns the list of text of the given field.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the list of text of the given field (null if this field does not exist).
-
parseFieldTextSet
Returns the list of text of the given field.- Parameters:
elt- the JDOM elementname- the name of the fieldtrim- if true, trim the text- Returns:
- the list of text of the given field (null if this field does not exist).
-
parseFieldTextList
Returns the set of text of the given field.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the set of text of the given field (null if this field does not exist).
-
parseFieldTextList
Returns the set of text of the given field.- Parameters:
elt- the JDOM elementname- the name of the fieldtrim- if true, trim the text- Returns:
- the set of text of the given field (null if this field does not exist).
-
parseFieldTextML
Returns the language map of the given field.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the language map of the given field (null if this field does not exist).
-
parseFieldTextArrayML
Returns the language map of text array of the given field.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the language map of text array of the given field (null if this field does not exist).
-
parseFieldTextListML
Returns the language map of text array of the given field.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the language map of text array of the given field (null if this field does not exist).
-
parseFieldWiki
Returns the text of the given wiki field. The imported references are resolved.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the text of the given field (null if this field does not exist).
- Since:
- jcms-6.0.0
-
parseFieldWikiArray
Returns the array of text of the given wiki field. The imported references are resolved.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the array of text of the given field (null if this field does not exist).
- Since:
- jcms-6.0.0
-
parseFieldWikiSet
Returns the set of text of the given wiki field. The imported references are resolved.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the set of text of the given field (null if this field does not exist).
- Since:
- jcms-6.1.0
-
parseFieldWikiList
Returns the list of text of the given wiki field. The imported references are resolved.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the list of text of the given field (null if this field does not exist).
- Since:
- jcms-6.1.0
-
parseFieldWikiML
Returns the language map of the given wiki field. The imported references are resolved.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the language map of the given field (null if this field does not exist).
- Since:
- jcms-6.0.0
-
parseFieldWikiArrayML
Returns the language map of text array of the given wiki field. The imported references are resolved.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the language map of text array of the given field (null if this field does not exist).
- Since:
- jcms-6.0.0
-
parseFieldWysiwyg
Returns the text of the given wysiwyg field. The imported references are resolved.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the text of the given field (null if this field does not exist).
- Since:
- jcms-6.0.0
-
parseFieldWysiwygArray
Returns the array of text of the given wysiwyg field. The imported references are resolved.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the array of text of the given field (null if this field does not exist).
- Since:
- jcms-6.0.0
-
parseFieldWysiwygSet
Returns the set of text of the given wysiwyg field. The imported references are resolved.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the set of text of the given field (null if this field does not exist).
- Since:
- jcms-6.1.0
-
parseFieldWysiwygList
Returns the list of text of the given wysiwyg field. The imported references are resolved.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the list of text of the given field (null if this field does not exist).
- Since:
- jcms-6.1.0
-
parseFieldWysiwygML
Returns the language map of the given wysiwyg field. The imported references are resolved.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the language map of the given field (null if this field does not exist).
- Since:
- jcms-6.0.0
-
parseFieldWysiwygArrayML
Returns the language map of text array of the given wysiwyg field. The imported references are resolved.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the language map of text array of the given field (null if this field does not exist).
- Since:
- jcms-6.0.0
-
parseFieldWysiwygListML
public static HashMap<String,List<String>> parseFieldWysiwygListML(org.jdom.Element elt, String name) Returns the language map of text array of the given wysiwyg field. The imported references are resolved.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the language map of text array of the given field (null if this field does not exist).
- Since:
- jcms-10.0.4
-
parseFieldDate
Returns the date of the given field.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the date of the given field (null if this field does not exist).
-
parseFieldDateArray
Returns the date array of the given field.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the date array of the given field (null if this field does not exist).
-
parseFieldDateSet
Returns the date set of the given field.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the date set of the given field (null if this field does not exist).
- Since:
- jcms-6.1.0
-
parseFieldDateList
Returns the date list of the given field.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the date list of the given field (null if this field does not exist).
- Since:
- jcms-6.1.0
-
parseFieldData
Returns the data of the given field.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the data of the given field.
- Since:
- jcms-6.0.0
-
parseSelfFieldData
public static <T extends Data> T parseSelfFieldData(org.jdom.Element elt, String name, Class<T> clazz) Returns the data of the given field using id from current webapp.- Parameters:
elt- the JDOM elementname- the name of the fieldclazz- the type of data to look for- Returns:
- the data of the given field.
- Since:
- jcms-9.0.0
-
parseSelfFieldDataML
public static <T extends Data> HashMap<String,T> parseSelfFieldDataML(org.jdom.Element elt, String name, Class<T> clazz) Returns the data of the given multilingual field, using id from current webapp.- Parameters:
elt- the JDOM elementname- the name of the fieldclazz- the type of data to look for- Returns:
- the data of the given field.
- Since:
- jcms-9.0.0
-
parseFieldDataArray
Returns the data array of the given field.- Parameters:
elt- the JDOM elementname- the name of the fieldclazz- the class of the data- Returns:
- the data array of the given field (null if this field does not exist).
- Since:
- jcms-6.0.0
-
parseSelfFieldDataArray
public static <T extends Data> T[] parseSelfFieldDataArray(org.jdom.Element elt, String name, Class<T> clazz) Returns the data array of the given field, using id from current webapp.- Parameters:
elt- the JDOM elementname- the name of the fieldclazz- the class of the data- Returns:
- the data array of the given field (null if this field does not exist).
- Since:
- jcms-9.0.0
-
parseSelfFieldDataArrayML
public static <T extends Data> HashMap<String,T[]> parseSelfFieldDataArrayML(org.jdom.Element elt, String name, Class<T> clazz) Returns the data array of the given multilingual field, using id from current webapp.- Parameters:
elt- the JDOM elementname- the name of the fieldclazz- the class of the data- Returns:
- the data array of the given field (null if this field does not exist).
- Since:
- jcms-9.0.0
-
parseFieldDataSet
public static <T extends Data> Set<T> parseFieldDataSet(org.jdom.Element elt, String name, Class<T> clazz) Returns the data set of the given field.- Type Parameters:
T- the type of data- Parameters:
elt- the JDOM elementname- the name of the fieldclazz- the class of the data- Returns:
- the data array of the given field (null if this field does not exist).
- Since:
- jcms-6.1.0
-
parseSelfFieldDataSet
public static <T extends Data> Set<T> parseSelfFieldDataSet(org.jdom.Element elt, String name, Class<T> clazz) Returns the data set of the given field, using id from current webapp.- Type Parameters:
T- the type of data- Parameters:
elt- the JDOM elementname- the name of the fieldclazz- the class of the data- Returns:
- the data array of the given field (null if this field does not exist).
- Since:
- jcms-9.0.0
-
parseFieldDataList
public static <T extends Data> List<T> parseFieldDataList(org.jdom.Element elt, String name, Class<T> clazz) Returns the data list of the given field.- Type Parameters:
T- the type of data- Parameters:
elt- the JDOM elementname- the name of the fieldclazz- the class of the data- Returns:
- the data array of the given field (null if this field does not exist).
- Since:
- jcms-6.1.0
-
parseSelfFieldDataList
public static <T extends Data> List<T> parseSelfFieldDataList(org.jdom.Element elt, String name, Class<T> clazz) Returns the data list of the given field, using id from current webapp.- Type Parameters:
T- the type of data- Parameters:
elt- the JDOM elementname- the name of the fieldclazz- the class of the data- Returns:
- the data array of the given field (null if this field does not exist).
- Since:
- jcms-9.0.0
-
parseFieldInt
Returns the int of the given field.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the int of the given field (0 if this field does not exist).
-
parseFieldIntArray
Returns the int array of the given field.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the int array of the given field (null if this field does not exist).
-
parseFieldIntSet
Returns the int set of the given field.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the int set of the given field (null if this field does not exist).
- Since:
- jcms-6.1.0
-
parseFieldIntList
Returns the int set of the given field.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the int set of the given field (null if this field does not exist).
- Since:
- jcms-6.1.0
-
parseFieldLong
Returns the long of the given field.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the long of the given field (0 if this field does not exist).
-
parseFieldLongArray
Returns the long array of the given field.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the long array of the given field (null if this field does not exist).
-
parseFieldLongSet
Returns the long set of the given field.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the int set of the given field (null if this field does not exist).
- Since:
- jcms-6.1.0
-
parseFieldLongList
Returns the long set of the given field.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the long set of the given field (null if this field does not exist).
- Since:
- jcms-6.1.0
-
parseFieldDouble
Returns the double of the given field.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the double of the given field (0 if this field does not exist).
-
parseFieldDoubleArray
Returns the double array of the given field.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the double array of the given field (null if this field does not exist).
-
parseFieldDoubleSet
Returns the double set of the given field.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the int set of the given field (null if this field does not exist).
- Since:
- jcms-6.1.0
-
parseFieldDoubleList
Returns the double set of the given field.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the double set of the given field (null if this field does not exist).
- Since:
- jcms-6.1.0
-
parseFieldBoolean
Returns the boolean of the given field.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the boolean of the given field (false if this field does not exist).
-
parseFieldBooleanArray
Returns the boolean array of the given field.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the boolean array of the given field (false if this field does not exist).
-
parseFieldBooleanSet
Returns the boolean set of the given field.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the int set of the given field (null if this field does not exist).
- Since:
- jcms-6.1.0
-
parseFieldBooleanList
Returns the boolean set of the given field.- Parameters:
elt- the JDOM elementname- the name of the field- Returns:
- the double set of the given field (null if this field does not exist).
- Since:
- jcms-6.1.0
-
parseFieldMemberLogin
Returns the login of the given member field.- Parameters:
elt- the JDOM Elementname- the name of the field- Returns:
- the login of the given member field.
- Since:
- jcms-5.7.2
-
parseFieldsByClass
Returns all the children with the given class attribute.- Parameters:
elt- the JDOM ElementclassName- the fully qualified class name.- Returns:
- all the children with the given class attribute.
- Since:
- jcms-5.7.2
-