Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-102681

Liferay Forms does not make a provision for StorageException in JSPs



      Problem Background

      This problem stems from the fact that there is no provision for StorageException in the JSPs associated with Liferay Forms. For example, the JSPs do not contain something like the following:

      <liferay-ui:error exception="<%= StorageException.class %>" message="an-unexpected-error-occurred" />

      Steps to Reproduce

      1. Create a new module with a CustomStorageAdapter that looks like this and deploy the module to $LIFERAY_HOME/osgi/modules:

      package com.mycompany;
      import com.liferay.dynamic.data.mapping.exception.StorageException;
      import com.liferay.dynamic.data.mapping.storage.DDMStorageAdapter;
      import com.liferay.dynamic.data.mapping.storage.DDMStorageAdapterDeleteRequest;
      import com.liferay.dynamic.data.mapping.storage.DDMStorageAdapterDeleteResponse;
      import com.liferay.dynamic.data.mapping.storage.DDMStorageAdapterGetRequest;
      import com.liferay.dynamic.data.mapping.storage.DDMStorageAdapterGetResponse;
      import com.liferay.dynamic.data.mapping.storage.DDMStorageAdapterSaveRequest;
      import com.liferay.dynamic.data.mapping.storage.DDMStorageAdapterSaveResponse;
      import org.osgi.service.component.annotations.Component;
      	immediate = true, property = {"ddm.storage.adapter.type=Custom"},
      	service = DDMStorageAdapter.class
      public class CustomStorageAdapter implements DDMStorageAdapter {
      	public DDMStorageAdapterSaveResponse save(
      		DDMStorageAdapterSaveRequest ddmStorageAdapterSaveRequest)
      		throws StorageException {
      		throw new StorageException("some type of storage error");
      	public DDMStorageAdapterDeleteResponse delete(
      		DDMStorageAdapterDeleteRequest ddmStorageAdapterDeleteRequest)
      		throws StorageException {
      		return null;
      	public DDMStorageAdapterGetResponse get(
      		DDMStorageAdapterGetRequest ddmStorageAdapterGetRequest)
      		throws StorageException {
      		return null;

      2. Click on "Content & Data -> Forms" in the Control Panel and create a form with a single text field.

      3. Before hitting the Save button, click the "..." button at the top of the page and then click on "Settings".

      4. Select "Custom" from the dropdown list for the custom storage option.

      5. Disable the autosave.

      6. Set the name of the form to be "MyForm"

      7. Save the form.

      8. Publish the form.

      9. Add the Forms portlet to a portal page and select "MyForm" to be displayed.

      10. Fill out the form and click on Save

      Expected Results

      The user should be alerted to some type of backend error due to the StorageException being thrown.

      Actual Results

      The user is not alerted.




            • Votes:
              0 Vote for this issue
              0 Start watching this issue


              • Created:
                Days since last comment:
                17 weeks, 6 days ago


                Version Package
                7.3.1 CE GA2