com.jalios.jcms.mashup
Class ImportUtil

java.lang.Object
  extended by com.jalios.jcms.mashup.ImportUtil
All Implemented Interfaces:
MashupConstants

public class ImportUtil
extends Object
implements MashupConstants

This class provides utility methods for the ImportManager.

Since:
jcms-5.7.2
Version:
$Revision: 27839 $
Author:
Olivier Dedieu

Field Summary
static 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
ImportUtil()
           
 
Method Summary
static org.jdom.Element parseField(org.jdom.Element elt, String name)
          Returns a named field under a given elt.
static boolean parseFieldBoolean(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.
static List<Boolean> parseFieldBooleanList(org.jdom.Element elt, String name)
          Returns the boolean set of the given field.
static Set<Boolean> parseFieldBooleanSet(org.jdom.Element elt, String name)
          Returns the boolean set of the given field.
static Data parseFieldData(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.
static
<T extends Data>
List<T>
parseFieldDataList(org.jdom.Element elt, String name, Class<T> clazz)
          Returns the data list of the given field.
static
<T extends Data>
Set<T>
parseFieldDataSet(org.jdom.Element elt, String name, Class<T> clazz)
          Returns the data set of the given field.
static Date parseFieldDate(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.
static List<Date> parseFieldDateList(org.jdom.Element elt, String name)
          Returns the date list of the given field.
static Set<Date> parseFieldDateSet(org.jdom.Element elt, String name)
          Returns the date set of the given field.
static double parseFieldDouble(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.
static List<Double> parseFieldDoubleList(org.jdom.Element elt, String name)
          Returns the double set of the given field.
static Set<Double> parseFieldDoubleSet(org.jdom.Element elt, String name)
          Returns the double set of the given field.
static int parseFieldInt(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.
static List<Integer> parseFieldIntList(org.jdom.Element elt, String name)
          Returns the int set of the given field.
static Set<Integer> parseFieldIntSet(org.jdom.Element elt, String name)
          Returns the int set of the given field.
static long parseFieldLong(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.
static List<Long> parseFieldLongList(org.jdom.Element elt, String name)
          Returns the long set of the given field.
static Set<Long> parseFieldLongSet(org.jdom.Element elt, String name)
          Returns the long set of the given field.
static String parseFieldMemberLogin(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 String parseFieldText(org.jdom.Element elt, String name)
          Returns the text of the given field.
static String parseFieldText(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.
static HashMap<String,String[]> parseFieldTextArrayML(org.jdom.Element elt, String name)
          Returns the language map of text array of the given field.
static List<String> parseFieldTextList(org.jdom.Element elt, String name)
          Returns the set of text of the given field.
static List<String> parseFieldTextList(org.jdom.Element elt, String name, boolean trim)
          Returns the set of text of the given field.
static HashMap<String,String> parseFieldTextML(org.jdom.Element elt, String name)
          Returns the language map of the given field.
static Set<String> parseFieldTextSet(org.jdom.Element elt, String name)
          Returns the list of text of the given field.
static Set<String> parseFieldTextSet(org.jdom.Element elt, String name, boolean trim)
          Returns the list of text of the given field.
static String parseFieldWiki(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.
static HashMap<String,String[]> parseFieldWikiArrayML(org.jdom.Element elt, String name)
          Returns the language map of text array of the given wiki field.
static List<String> parseFieldWikiList(org.jdom.Element elt, String name)
          Returns the list of text of the given wiki field.
static HashMap<String,String> parseFieldWikiML(org.jdom.Element elt, String name)
          Returns the language map of the given wiki field.
static Set<String> parseFieldWikiSet(org.jdom.Element elt, String name)
          Returns the set of text of the given wiki field.
static String parseFieldWysiwyg(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.
static HashMap<String,String[]> parseFieldWysiwygArrayML(org.jdom.Element elt, String name)
          Returns the language map of text array of the given wysiwyg field.
static List<String> parseFieldWysiwygList(org.jdom.Element elt, String name)
          Returns the list of text of the given wysiwyg field.
static HashMap<String,String> parseFieldWysiwygML(org.jdom.Element elt, String name)
          Returns the language map of the given wysiwyg field.
static Set<String> parseFieldWysiwygSet(org.jdom.Element elt, String name)
          Returns the set of text of the given wysiwyg field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REVISION

public static final String REVISION
See Also:
Constant Field Values
Constructor Detail

ImportUtil

public ImportUtil()
Method Detail

parseField

public static org.jdom.Element parseField(org.jdom.Element elt,
                                          String name)
Returns a named field under a given elt.

Parameters:
elt - a JDom Element
name - the name of the field.
Returns:
a named field under a given elt.
Since:
jcms-5.7.2

parseFieldText

public static String parseFieldText(org.jdom.Element elt,
                                    String name,
                                    boolean trim)
Returns the text of the given field.

Parameters:
elt - the JDOM element
name - the name of the field
trim - if true, trim the text
Returns:
the text of the given field (null if this field does not exist).

parseFieldText

public static String parseFieldText(org.jdom.Element elt,
                                    String name)
Returns the text of the given field. The text is trimed.

Parameters:
elt - the JDOM element
name - the name of the field
Returns:
the text of the given field (null if this field does not exist).

parseFieldTextArray

public static String[] parseFieldTextArray(org.jdom.Element elt,
                                           String name)
Returns the array of text of the given field.

Parameters:
elt - the JDOM element
name - the name of the field
Returns:
the array of text of the given field (null if this field does not exist).

parseFieldTextArray

public static String[] parseFieldTextArray(org.jdom.Element elt,
                                           String name,
                                           boolean trim)
Returns the array of text of the given field.

Parameters:
elt - the JDOM element
name - the name of the field
trim - if true, trim the text
Returns:
the array of text of the given field (null if this field does not exist).

parseFieldTextSet

public static Set<String> parseFieldTextSet(org.jdom.Element elt,
                                            String name)
Returns the list of text of the given field.

Parameters:
elt - the JDOM element
name - the name of the field
Returns:
the list of text of the given field (null if this field does not exist).

parseFieldTextSet

public static Set<String> parseFieldTextSet(org.jdom.Element elt,
                                            String name,
                                            boolean trim)
Returns the list of text of the given field.

Parameters:
elt - the JDOM element
name - the name of the field
trim - if true, trim the text
Returns:
the list of text of the given field (null if this field does not exist).

parseFieldTextList

public static List<String> parseFieldTextList(org.jdom.Element elt,
                                              String name)
Returns the set of text of the given field.

Parameters:
elt - the JDOM element
name - the name of the field
Returns:
the set of text of the given field (null if this field does not exist).

parseFieldTextList

public static List<String> parseFieldTextList(org.jdom.Element elt,
                                              String name,
                                              boolean trim)
Returns the set of text of the given field.

Parameters:
elt - the JDOM element
name - the name of the field
trim - if true, trim the text
Returns:
the set of text of the given field (null if this field does not exist).

parseFieldTextML

public static HashMap<String,String> parseFieldTextML(org.jdom.Element elt,
                                                      String name)
Returns the language map of the given field.

Parameters:
elt - the JDOM element
name - the name of the field
Returns:
the language map of the given field (null if this field does not exist).

parseFieldTextArrayML

public static HashMap<String,String[]> parseFieldTextArrayML(org.jdom.Element elt,
                                                             String name)
Returns the language map of text array of the given field.

Parameters:
elt - the JDOM element
name - the name of the field
Returns:
the language map of text array of the given field (null if this field does not exist).

parseFieldWiki

public static String parseFieldWiki(org.jdom.Element elt,
                                    String name)
Returns the text of the given wiki field. The imported references are resolved.

Parameters:
elt - the JDOM element
name - 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

public static String[] parseFieldWikiArray(org.jdom.Element elt,
                                           String name)
Returns the array of text of the given wiki field. The imported references are resolved.

Parameters:
elt - the JDOM element
name - 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

public static Set<String> parseFieldWikiSet(org.jdom.Element elt,
                                            String name)
Returns the set of text of the given wiki field. The imported references are resolved.

Parameters:
elt - the JDOM element
name - 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

public static List<String> parseFieldWikiList(org.jdom.Element elt,
                                              String name)
Returns the list of text of the given wiki field. The imported references are resolved.

Parameters:
elt - the JDOM element
name - 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

public static HashMap<String,String> parseFieldWikiML(org.jdom.Element elt,
                                                      String name)
Returns the language map of the given wiki field. The imported references are resolved.

Parameters:
elt - the JDOM element
name - 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

public static HashMap<String,String[]> parseFieldWikiArrayML(org.jdom.Element elt,
                                                             String name)
Returns the language map of text array of the given wiki field. The imported references are resolved.

Parameters:
elt - the JDOM element
name - 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

public static String parseFieldWysiwyg(org.jdom.Element elt,
                                       String name)
Returns the text of the given wysiwyg field. The imported references are resolved.

Parameters:
elt - the JDOM element
name - 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

public static String[] parseFieldWysiwygArray(org.jdom.Element elt,
                                              String name)
Returns the array of text of the given wysiwyg field. The imported references are resolved.

Parameters:
elt - the JDOM element
name - 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

public static Set<String> parseFieldWysiwygSet(org.jdom.Element elt,
                                               String name)
Returns the set of text of the given wysiwyg field. The imported references are resolved.

Parameters:
elt - the JDOM element
name - 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

public static List<String> parseFieldWysiwygList(org.jdom.Element elt,
                                                 String name)
Returns the list of text of the given wysiwyg field. The imported references are resolved.

Parameters:
elt - the JDOM element
name - 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

public static HashMap<String,String> parseFieldWysiwygML(org.jdom.Element elt,
                                                         String name)
Returns the language map of the given wysiwyg field. The imported references are resolved.

Parameters:
elt - the JDOM element
name - 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

public static HashMap<String,String[]> parseFieldWysiwygArrayML(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 element
name - 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

parseFieldDate

public static Date parseFieldDate(org.jdom.Element elt,
                                  String name)
Returns the date of the given field.

Parameters:
elt - the JDOM element
name - the name of the field
Returns:
the date of the given field (null if this field does not exist).

parseFieldDateArray

public static Date[] parseFieldDateArray(org.jdom.Element elt,
                                         String name)
Returns the date array of the given field.

Parameters:
elt - the JDOM element
name - the name of the field
Returns:
the date array of the given field (null if this field does not exist).

parseFieldDateSet

public static Set<Date> parseFieldDateSet(org.jdom.Element elt,
                                          String name)
Returns the date set of the given field.

Parameters:
elt - the JDOM element
name - 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

public static List<Date> parseFieldDateList(org.jdom.Element elt,
                                            String name)
Returns the date list of the given field.

Parameters:
elt - the JDOM element
name - 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

public static Data parseFieldData(org.jdom.Element elt,
                                  String name)
Returns the data of the given field.

Parameters:
elt - the JDOM element
name - the name of the field
Returns:
the data of the given field.
Since:
jcms-6.0.0

parseFieldDataArray

public static Data[] parseFieldDataArray(org.jdom.Element elt,
                                         String name,
                                         Class clazz)
Returns the data array of the given field.

Parameters:
elt - the JDOM element
name - the name of the field
Returns:
the data array of the given field (null if this field does not exist).
Since:
jcms-6.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.

Parameters:
elt - the JDOM element
name - the name of the field
Returns:
the data array of the given field (null if this field does not exist).
Since:
jcms-6.1.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.

Parameters:
elt - the JDOM element
name - the name of the field
Returns:
the data array of the given field (null if this field does not exist).
Since:
jcms-6.1.0

parseFieldInt

public static int parseFieldInt(org.jdom.Element elt,
                                String name)
Returns the int of the given field.

Parameters:
elt - the JDOM element
name - the name of the field
Returns:
the int of the given field (0 if this field does not exist).

parseFieldIntArray

public static int[] parseFieldIntArray(org.jdom.Element elt,
                                       String name)
Returns the int array of the given field.

Parameters:
elt - the JDOM element
name - the name of the field
Returns:
the int array of the given field (null if this field does not exist).

parseFieldIntSet

public static Set<Integer> parseFieldIntSet(org.jdom.Element elt,
                                            String name)
Returns the int set of the given field.

Parameters:
elt - the JDOM element
name - 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

public static List<Integer> parseFieldIntList(org.jdom.Element elt,
                                              String name)
Returns the int set of the given field.

Parameters:
elt - the JDOM element
name - 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

public static long parseFieldLong(org.jdom.Element elt,
                                  String name)
Returns the long of the given field.

Parameters:
elt - the JDOM element
name - the name of the field
Returns:
the long of the given field (0 if this field does not exist).

parseFieldLongArray

public static long[] parseFieldLongArray(org.jdom.Element elt,
                                         String name)
Returns the long array of the given field.

Parameters:
elt - the JDOM element
name - the name of the field
Returns:
the long array of the given field (null if this field does not exist).

parseFieldLongSet

public static Set<Long> parseFieldLongSet(org.jdom.Element elt,
                                          String name)
Returns the long set of the given field.

Parameters:
elt - the JDOM element
name - 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

public static List<Long> parseFieldLongList(org.jdom.Element elt,
                                            String name)
Returns the long set of the given field.

Parameters:
elt - the JDOM element
name - 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

public static double parseFieldDouble(org.jdom.Element elt,
                                      String name)
Returns the double of the given field.

Parameters:
elt - the JDOM element
name - the name of the field
Returns:
the double of the given field (0 if this field does not exist).

parseFieldDoubleArray

public static double[] parseFieldDoubleArray(org.jdom.Element elt,
                                             String name)
Returns the double array of the given field.

Parameters:
elt - the JDOM element
name - the name of the field
Returns:
the double array of the given field (null if this field does not exist).

parseFieldDoubleSet

public static Set<Double> parseFieldDoubleSet(org.jdom.Element elt,
                                              String name)
Returns the double set of the given field.

Parameters:
elt - the JDOM element
name - 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

public static List<Double> parseFieldDoubleList(org.jdom.Element elt,
                                                String name)
Returns the double set of the given field.

Parameters:
elt - the JDOM element
name - 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

public static boolean parseFieldBoolean(org.jdom.Element elt,
                                        String name)
Returns the boolean of the given field.

Parameters:
elt - the JDOM element
name - the name of the field
Returns:
the boolean of the given field (false if this field does not exist).

parseFieldBooleanArray

public static boolean[] parseFieldBooleanArray(org.jdom.Element elt,
                                               String name)
Returns the boolean array of the given field.

Parameters:
elt - the JDOM element
name - the name of the field
Returns:
the boolean array of the given field (false if this field does not exist).

parseFieldBooleanSet

public static Set<Boolean> parseFieldBooleanSet(org.jdom.Element elt,
                                                String name)
Returns the boolean set of the given field.

Parameters:
elt - the JDOM element
name - 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

public static List<Boolean> parseFieldBooleanList(org.jdom.Element elt,
                                                  String name)
Returns the boolean set of the given field.

Parameters:
elt - the JDOM element
name - 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

public static String parseFieldMemberLogin(org.jdom.Element elt,
                                           String name)
Returns the login of the given member field.

Parameters:
elt - the JDOM Element
name - the name of the field
Returns:
the login of the given member field.
Since:
jcms-5.7.2

parseFieldsByClass

public static List<org.jdom.Element> parseFieldsByClass(org.jdom.Element elt,
                                                        String className)
Returns all the children with the given class attribute.

Parameters:
elt - the JDOM Element
className - the fully qualified class name.
Returns:
all the children with the given class attribute.
Since:
jcms-5.7.2


Copyright © 2001-2010 Jalios SA. All Rights Reserved.