Liferay 7.0-ce-m6

com.liferay.portlet.dynamicdatamapping.util
Class DDMImpl

java.lang.Object
  extended by com.liferay.portlet.dynamicdatamapping.util.DDMImpl
All Implemented Interfaces:
DDM

public class DDMImpl
extends Object
implements DDM


Field Summary
static String FIELDS_DISPLAY_NAME
           
static String INSTANCE_SEPARATOR
           
static String TYPE_CHECKBOX
           
static String TYPE_DDM_DATE
           
static String TYPE_DDM_DOCUMENTLIBRARY
           
static String TYPE_DDM_IMAGE
           
static String TYPE_DDM_LINK_TO_PAGE
           
static String TYPE_DDM_TEXT_HTML
           
static String TYPE_RADIO
           
static String TYPE_SELECT
           
 
Constructor Summary
DDMImpl()
           
 
Method Summary
protected  void addDDMFormFieldLocalizedProperties(JSONObject jsonObject, DDMFormField ddmFormField, Locale locale, Locale defaultLocale)
           
protected  void addDDMFormFieldLocalizedProperty(JSONObject jsonObject, String propertyName, LocalizedValue localizedValue, Locale locale, Locale defaultLocale, String type)
           
protected  void addDDMFormFieldOptions(JSONObject jsonObject, DDMFormField ddmFormField, Set<Locale> availableLocales, Locale defaultLocale)
           
protected  int countFieldRepetition(String[] fieldsDisplayValues, String fieldName)
           
protected  Field createField(DDMStructure ddmStructure, String fieldName, List<Serializable> fieldValues, ServiceContext serviceContext)
           
 DDMDisplay getDDMDisplay(long classNameId)
           
 DDMForm getDDMForm(long classNameId, long classPK)
           
 DDMForm getDDMForm(PortletRequest portletRequest)
           
protected  JSONArray getDDMFormFieldsJSONArray(DDMForm ddmForm, String script)
           
 JSONArray getDDMFormFieldsJSONArray(DDMStructure ddmStructure, String script)
           
 JSONArray getDDMFormFieldsJSONArray(DDMStructureVersion ddmStructureVersion, String script)
           
protected  JSONArray getDDMFormFieldsJSONArray(List<DDMFormField> ddmFormFields, Set<Locale> availableLocales, Locale defaultLocale)
           
 DDMPermissionHandler getDDMPermissionHandler(long classNameId)
           
protected  DDMStructure getDDMStructure(long ddmStructureId, long ddmTemplateId)
           
 DDMFormLayout getDefaultDDMFormLayout(DDMForm ddmForm)
           
protected  DDMFormLayoutRow getDefaultDDMFormLayoutRow(DDMFormField ddmFormField)
           
protected  LocalizedValue getDefaultDDMFormPageTitle(Locale defaultLocale)
           
 Serializable getDisplayFieldValue(ThemeDisplay themeDisplay, Serializable fieldValue, String type)
           
protected  int getExistingFieldValueIndex(String[] newFieldsDisplayValues, String[] existingFieldsDisplayValues, String fieldName, int index)
           
protected  String getFieldIntanceId(String[] fieldsDisplayValues, String fieldName, int index)
           
protected  List<String> getFieldNames(String fieldNamespace, String fieldName, ServiceContext serviceContext)
           
 Fields getFields(long ddmStructureId, long ddmTemplateId, ServiceContext serviceContext)
           
 Fields getFields(long ddmStructureId, long ddmTemplateId, String fieldNamespace, ServiceContext serviceContext)
           
 Fields getFields(long ddmStructureId, ServiceContext serviceContext)
           
protected  Fields getFields(long ddmStructureId, String serializedDDMFormValues)
           
 Fields getFields(long ddmStructureId, String fieldNamespace, ServiceContext serviceContext)
           
 String[] getFieldsDisplayValues(Field fieldsDisplayField)
           
protected  int getFieldValueIndex(String[] fieldsDisplayValues, String fieldName, String instanceId)
           
protected  List<Serializable> getFieldValues(DDMStructure ddmStructure, String fieldName, String fieldNamespace, ServiceContext serviceContext)
           
protected  List<Serializable> getFieldValues(Field field, Locale locale)
           
protected  byte[] getImageBytes(UploadRequest uploadRequest, String fieldNameValue)
           
protected  String getImageFieldValue(UploadRequest uploadRequest, String fieldNameValue)
           
 Serializable getIndexedFieldValue(Serializable fieldValue, String type)
           
protected  Set<Locale> getMergedAvailableLocales(Set<Locale> newFieldAvailableLocales, Set<Locale> existingFieldAvailableLocales)
           
protected  List<Serializable> getMergedFieldValues(String fieldName, List<Serializable> newFieldValues, String[] newFieldsDisplayValues, List<Serializable> existingFieldValues, String[] existingFieldsDisplayValues, List<Serializable> defaultFieldValues)
           
protected  Map<Locale,List<Serializable>> getMergedFieldValuesMap(Field newField, String[] newFieldsDisplayValues, Field existingField, String[] existingFieldsDisplayValues)
           
 OrderByComparator<DDMStructure> getStructureOrderByComparator(String orderByCol, String orderByType)
           
 OrderByComparator<DDMTemplate> getTemplateOrderByComparator(String orderByCol, String orderByType)
           
 Fields mergeFields(Fields newFields, Fields existingFields)
           
protected  String[] splitFieldsDisplayValue(Field fieldsDisplayField)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIELDS_DISPLAY_NAME

public static final String FIELDS_DISPLAY_NAME
See Also:
Constant Field Values

INSTANCE_SEPARATOR

public static final String INSTANCE_SEPARATOR
See Also:
Constant Field Values

TYPE_CHECKBOX

public static final String TYPE_CHECKBOX
See Also:
Constant Field Values

TYPE_DDM_DATE

public static final String TYPE_DDM_DATE
See Also:
Constant Field Values

TYPE_DDM_DOCUMENTLIBRARY

public static final String TYPE_DDM_DOCUMENTLIBRARY
See Also:
Constant Field Values

TYPE_DDM_IMAGE

public static final String TYPE_DDM_IMAGE
See Also:
Constant Field Values

TYPE_DDM_LINK_TO_PAGE

public static final String TYPE_DDM_LINK_TO_PAGE
See Also:
Constant Field Values

TYPE_DDM_TEXT_HTML

public static final String TYPE_DDM_TEXT_HTML
See Also:
Constant Field Values

TYPE_RADIO

public static final String TYPE_RADIO
See Also:
Constant Field Values

TYPE_SELECT

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

DDMImpl

public DDMImpl()
Method Detail

getDDMDisplay

public DDMDisplay getDDMDisplay(long classNameId)
Specified by:
getDDMDisplay in interface DDM

getDDMForm

public DDMForm getDDMForm(long classNameId,
                          long classPK)
                   throws PortalException
Specified by:
getDDMForm in interface DDM
Throws:
PortalException

getDDMForm

public DDMForm getDDMForm(PortletRequest portletRequest)
                   throws PortalException
Specified by:
getDDMForm in interface DDM
Throws:
PortalException

getDDMFormFieldsJSONArray

public JSONArray getDDMFormFieldsJSONArray(DDMStructure ddmStructure,
                                           String script)
Specified by:
getDDMFormFieldsJSONArray in interface DDM

getDDMFormFieldsJSONArray

public JSONArray getDDMFormFieldsJSONArray(DDMStructureVersion ddmStructureVersion,
                                           String script)
Specified by:
getDDMFormFieldsJSONArray in interface DDM

getDDMPermissionHandler

public DDMPermissionHandler getDDMPermissionHandler(long classNameId)
Specified by:
getDDMPermissionHandler in interface DDM

getDefaultDDMFormLayout

public DDMFormLayout getDefaultDDMFormLayout(DDMForm ddmForm)
Specified by:
getDefaultDDMFormLayout in interface DDM

getDisplayFieldValue

public Serializable getDisplayFieldValue(ThemeDisplay themeDisplay,
                                         Serializable fieldValue,
                                         String type)
                                  throws Exception
Specified by:
getDisplayFieldValue in interface DDM
Throws:
Exception

getFields

public Fields getFields(long ddmStructureId,
                        long ddmTemplateId,
                        ServiceContext serviceContext)
                 throws PortalException
Specified by:
getFields in interface DDM
Throws:
PortalException

getFields

public Fields getFields(long ddmStructureId,
                        long ddmTemplateId,
                        String fieldNamespace,
                        ServiceContext serviceContext)
                 throws PortalException
Specified by:
getFields in interface DDM
Throws:
PortalException

getFields

public Fields getFields(long ddmStructureId,
                        ServiceContext serviceContext)
                 throws PortalException
Specified by:
getFields in interface DDM
Throws:
PortalException

getFields

public Fields getFields(long ddmStructureId,
                        String fieldNamespace,
                        ServiceContext serviceContext)
                 throws PortalException
Specified by:
getFields in interface DDM
Throws:
PortalException

getFieldsDisplayValues

public String[] getFieldsDisplayValues(Field fieldsDisplayField)
                                throws Exception
Specified by:
getFieldsDisplayValues in interface DDM
Throws:
Exception

getIndexedFieldValue

public Serializable getIndexedFieldValue(Serializable fieldValue,
                                         String type)
                                  throws Exception
Specified by:
getIndexedFieldValue in interface DDM
Throws:
Exception

getStructureOrderByComparator

public OrderByComparator<DDMStructure> getStructureOrderByComparator(String orderByCol,
                                                                     String orderByType)
Specified by:
getStructureOrderByComparator in interface DDM

getTemplateOrderByComparator

public OrderByComparator<DDMTemplate> getTemplateOrderByComparator(String orderByCol,
                                                                   String orderByType)
Specified by:
getTemplateOrderByComparator in interface DDM

mergeFields

public Fields mergeFields(Fields newFields,
                          Fields existingFields)
Specified by:
mergeFields in interface DDM

addDDMFormFieldLocalizedProperties

protected void addDDMFormFieldLocalizedProperties(JSONObject jsonObject,
                                                  DDMFormField ddmFormField,
                                                  Locale locale,
                                                  Locale defaultLocale)

addDDMFormFieldLocalizedProperty

protected void addDDMFormFieldLocalizedProperty(JSONObject jsonObject,
                                                String propertyName,
                                                LocalizedValue localizedValue,
                                                Locale locale,
                                                Locale defaultLocale,
                                                String type)

addDDMFormFieldOptions

protected void addDDMFormFieldOptions(JSONObject jsonObject,
                                      DDMFormField ddmFormField,
                                      Set<Locale> availableLocales,
                                      Locale defaultLocale)

countFieldRepetition

protected int countFieldRepetition(String[] fieldsDisplayValues,
                                   String fieldName)

createField

protected Field createField(DDMStructure ddmStructure,
                            String fieldName,
                            List<Serializable> fieldValues,
                            ServiceContext serviceContext)

getDDMFormFieldsJSONArray

protected JSONArray getDDMFormFieldsJSONArray(DDMForm ddmForm,
                                              String script)

getDDMFormFieldsJSONArray

protected JSONArray getDDMFormFieldsJSONArray(List<DDMFormField> ddmFormFields,
                                              Set<Locale> availableLocales,
                                              Locale defaultLocale)

getDDMStructure

protected DDMStructure getDDMStructure(long ddmStructureId,
                                       long ddmTemplateId)
                                throws PortalException
Throws:
PortalException

getDefaultDDMFormLayoutRow

protected DDMFormLayoutRow getDefaultDDMFormLayoutRow(DDMFormField ddmFormField)

getDefaultDDMFormPageTitle

protected LocalizedValue getDefaultDDMFormPageTitle(Locale defaultLocale)

getExistingFieldValueIndex

protected int getExistingFieldValueIndex(String[] newFieldsDisplayValues,
                                         String[] existingFieldsDisplayValues,
                                         String fieldName,
                                         int index)

getFieldIntanceId

protected String getFieldIntanceId(String[] fieldsDisplayValues,
                                   String fieldName,
                                   int index)

getFieldNames

protected List<String> getFieldNames(String fieldNamespace,
                                     String fieldName,
                                     ServiceContext serviceContext)

getFields

protected Fields getFields(long ddmStructureId,
                           String serializedDDMFormValues)
                    throws PortalException
Throws:
PortalException

getFieldValueIndex

protected int getFieldValueIndex(String[] fieldsDisplayValues,
                                 String fieldName,
                                 String instanceId)

getFieldValues

protected List<Serializable> getFieldValues(DDMStructure ddmStructure,
                                            String fieldName,
                                            String fieldNamespace,
                                            ServiceContext serviceContext)
                                     throws PortalException
Throws:
PortalException

getFieldValues

protected List<Serializable> getFieldValues(Field field,
                                            Locale locale)

getImageBytes

protected byte[] getImageBytes(UploadRequest uploadRequest,
                               String fieldNameValue)
                        throws Exception
Throws:
Exception

getImageFieldValue

protected String getImageFieldValue(UploadRequest uploadRequest,
                                    String fieldNameValue)

getMergedAvailableLocales

protected Set<Locale> getMergedAvailableLocales(Set<Locale> newFieldAvailableLocales,
                                                Set<Locale> existingFieldAvailableLocales)

getMergedFieldValues

protected List<Serializable> getMergedFieldValues(String fieldName,
                                                  List<Serializable> newFieldValues,
                                                  String[] newFieldsDisplayValues,
                                                  List<Serializable> existingFieldValues,
                                                  String[] existingFieldsDisplayValues,
                                                  List<Serializable> defaultFieldValues)

getMergedFieldValuesMap

protected Map<Locale,List<Serializable>> getMergedFieldValuesMap(Field newField,
                                                                 String[] newFieldsDisplayValues,
                                                                 Field existingField,
                                                                 String[] existingFieldsDisplayValues)

splitFieldsDisplayValue

protected String[] splitFieldsDisplayValue(Field fieldsDisplayField)

Liferay 7.0-ce-m6