Class PostAction

java.lang.Object
org.cxbox.core.dto.rowmeta.PostAction

public class PostAction extends Object
  • Constructor Details

    • PostAction

      public PostAction()
  • Method Details

    • refreshBc

      public static PostAction refreshBc(org.cxbox.api.data.BcIdentifier bcIdentifier)
    • refreshParentBc

      public static PostAction refreshParentBc(org.cxbox.api.data.BcIdentifier bcIdentifier)
    • downloadFile

      public static PostAction downloadFile(String fileId)
    • downloadFileByUrl

      public static PostAction downloadFileByUrl(String url)
    • openPickList

      public static PostAction openPickList(String pickList)
    • drillDown

      public static PostAction drillDown(DrillDownTypeSpecifier drillDownType, String url)
    • drillDown

      public static PostAction drillDown(DrillDownTypeSpecifier drillDownType, String url, String urlName)
    • drillDownWithFilter

      public static PostAction drillDownWithFilter(DrillDownTypeSpecifier drillDownType, String url, Consumer<FC> fc)
      Sets drill-down functionality with filter capabilities for a specific field.

      This method configures a drill-down URL with optional filtering parameters for a DTO field. It retrieves the PlatformDrilldownService to generate URL filter parameters and applies them to the field's drill-down configuration.

      
       Example:
       			 // add with default builder
       			 PostAction.drillDownWithFilterDrillDownType.INNER, "screen/myscreen/view/myview",
       			 fc -> fc
       			  .add(RestController.myBc, MyDefaultDTO.class, fb -> fb
      					.dictionaryEnum(MyDefaultDTO_.status, getStatusFilterValues(id))
      					.multiValue(MyDefaultDTO_.multivalueField, myMultivalueField))
      				 // add with custom filter builders
      				.add(RestController.myBc, MyDefaultDTO.class,
      				  new TypeToken<MyCustomFilterBuilder<MyCustomDTO>>() {
      
      				  },
      				  fb -> fb
      				   .dictionaryEnum(MyDTO_.status, getStatusFilterValues(id))
      				   .multiValue(MyDTO_.multivalueField, myMultivalueFilterField)
      				   .myCustomFields(MyDTO_.customField, myCustomFieldFilterValue
       		);
       
      Parameters:
      drillDownType - the type specifier that defines the drill-down behavior
      url - the base drill-down URL string
      fc - a consumer that accepts and configures the filter configuration object. This allows customization of filtering parameters that will be appended to the drill-down URL
    • delayedRefreshBC

      public static PostAction delayedRefreshBC(org.cxbox.api.data.BcIdentifier bcIdentifier, Number seconds)
    • showMessage

      public static PostAction showMessage(MessageType messageType, String messageText)
    • postDelete

      public static PostAction postDelete()
    • waitUntil

      public static <T extends org.cxbox.api.data.dto.DataResponseDTO, V> PostAction.WaitUntilBuilder<T,V> waitUntil(@NonNull @NonNull DtoField<? super T,V> successConditionField, @NonNull V successConditionValue)
      Creates a post-action that waits until a specified condition is met.
      Parameters:
      successConditionField - The field whose value will be monitored.
      successConditionValue - The value that indicates successful completion. Only String and Boolean types are supported now
      Returns:
      A builder for constructing a `waitUntil` post-action.

      Example usage:

       PostAction.waitUntil(CxboxRestController.clientEdit, ClientDTO_.statusField, true)
                .inProgressMessage("Fetching data...")
                .successMessage("Data received. Click OK to proceed.")
                .timeoutMessage("Timeout reached. Close the window and refresh.")
                .build();
       
    • drillDownAndWaitUntil

      public static <T extends org.cxbox.api.data.dto.DataResponseDTO, V> PostAction.WaitUntilBuilder<T,V> drillDownAndWaitUntil(@NonNull @NonNull String url, @NonNull @NonNull org.cxbox.api.data.BcIdentifier successConditionBc, @NonNull @NonNull DtoField<? super T,V> successConditionField, @NonNull V successConditionValue)
      Creates a post-action that performs a INNER drill-down and then waits until a specified condition is met.
      Parameters:
      url - The INNER drill-down URL to navigate to.
      successConditionBc - The business component on which the condition will be monitored after drill-down.
      successConditionField - The field whose value will be monitored.
      successConditionValue - The value that indicates successful completion. Only String and Boolean types are supported now
      Returns:
      A builder for constructing a `drillDownAndWaitUntil` post-action.

      Example usage:

       PostAction.drillDownAndWaitUntil("/screen/client/view/clientView/" + CxboxRestController.clientEdit + "/" + clientId,
                 CxboxRestController.clientEdit, ClientDTO_.statusField, true)
                .inProgressMessage("Navigating and fetching data...")
                .successMessage("Data loaded successfully.")
                .timeoutMessage("Failed to retrieve data in time.")
                .build();
       
    • getAttributes

      public Map<String,Object> getAttributes()
    • getAttribute

      public Object getAttribute(String key)
    • getURL

      public String getURL()
    • getType

      public String getType()
    • getDrillDownType

      public String getDrillDownType()
    • add

      public PostAction add(String key, Object value)