Class ImportUtil

java.lang.Object
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
Author:
Olivier Dedieu
  • Constructor Details

    • ImportUtil

      public ImportUtil()
  • Method Details

    • 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).
    • parseFieldTextListML

      public static HashMap<String,List<String>> parseFieldTextListML(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
    • 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 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-10.0.4
    • 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
    • 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 element
      name - the name of the field
      clazz - 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 element
      name - the name of the field
      clazz - the type of data to look for
      Returns:
      the data of the given field.
      Since:
      jcms-9.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
      clazz - 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 element
      name - the name of the field
      clazz - 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 element
      name - the name of the field
      clazz - 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 element
      name - the name of the field
      clazz - 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 element
      name - the name of the field
      clazz - 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 element
      name - the name of the field
      clazz - 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 element
      name - the name of the field
      clazz - 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

      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