Permalink
Browse files

LPS-26325 Cannot view the DDL record in control panel

  • Loading branch information...
ivicac committed Apr 15, 2012
1 parent 37cd071 commit c68251b9f2c62c9eacaff7971b7ddc59950d4abc
@@ -31,6 +31,7 @@
import com.liferay.portlet.dynamicdatamapping.storage.Field;
import com.liferay.portlet.dynamicdatamapping.storage.FieldConstants;
import com.liferay.portlet.dynamicdatamapping.storage.Fields;
+import com.liferay.portlet.dynamicdatamapping.util.DDMUtil;
import com.liferay.util.bridges.mvc.MVCPortlet;
import java.io.Serializable;
@@ -61,30 +62,12 @@ public void saveData(
DDMStructure ddmStructure = recordSet.getDDMStructure();
- Set<String> fieldNames = ddmStructure.getFieldNames();
-
- Fields fields = new Fields();
-
- for (String fieldName : fieldNames) {
- Field field = new Field();
-
- field.setName(fieldName);
-
- String fieldDataType = ddmStructure.getFieldDataType(fieldName);
-
- String fieldValue = ParamUtil.getString(actionRequest, fieldName);
-
- Serializable fieldValueSerializable =
- FieldConstants.getSerializable(fieldDataType, fieldValue);
-
- field.setValue(fieldValueSerializable);
-
- fields.put(field);
- }
-
ServiceContext serviceContext = ServiceContextFactory.getInstance(
DDLRecord.class.getName(), actionRequest);
+ Fields fields = DDMUtil.getFields(
+ ddmStructure.getStructureId(), serviceContext);
+
DDLRecordServiceUtil.addRecord(
themeDisplay.getScopeGroupId(), recordSetId, 0, fields,
serviceContext);

0 comments on commit c68251b

Please sign in to comment.