java.lang.Object
de.hybris.platform.integrationbackoffice.widgets.modeling.services.WriteService

public class WriteService extends Object
Handles the write requests of the extension's widgets
  • Constructor Details

    • WriteService

      public WriteService(@NotNull @NotNull ModelService modelService, @NotNull @NotNull ReadService readService, @NotNull @NotNull ReturnIntegrationObjectItemService returnIntegrationObjectItemService)
      Default constructor for WriteService.
      Parameters:
      modelService - the service to perform modeling operations.
      readService - the service to perform database queries.
      returnIntegrationObjectItemService - the service to determine the returnIntegrationObject of integration object's attributes.
  • Method Details

    • createIntegrationObject

      public IntegrationObjectModel createIntegrationObject(String name, IntegrationType type)
      Creates a base integration object.
      Parameters:
      name - the integration object's name
      type - the type of integration object (Inbound, Outbound)
      Returns:
      an empty integration object
    • persistVirtualAttributeDescriptor

      public IntegrationObjectVirtualAttributeDescriptorModel persistVirtualAttributeDescriptor(String code, String logicLocation, String type)
      Creates, persists and returns a Virtual Attribute Descriptor.
      Parameters:
      code - the descriptor's code
      logicLocation - the logicLocation of a script. eg, model://modelScript
      type - the type of Virtual Attribute Descriptor. eg, java.lang.String
      Returns:
      newly created Virtual Attribute Descriptor
    • clearIntegrationObject

      public IntegrationObjectModel clearIntegrationObject(IntegrationObjectModel integrationObject)
      Clears the old definition of an integration object. The integration object is not deleted, this method simply removes all of its items and their associated attributes.
      Parameters:
      integrationObject - the integration object to be cleared
      Returns:
      a cleared integration object
    • createDefinitions

      public IntegrationObjectModel createDefinitions(IntegrationObjectModel integrationObject, IntegrationObjectDefinition objectMap, String rootCode)
      Builds an integration object's items and their associated attributes from a map.
      Parameters:
      integrationObject - the integration object to build
      objectMap - the map used to build the integration object's content
      rootCode - code of root item
      Returns:
      a built integration object
    • cloneIntegrationObject

      public IntegrationObjectModel cloneIntegrationObject(IntegrationObjectModel integrationObjectModel, IntegrationObjectModel integrationObjectModelClone)
      Clones an integration object's items and their associated attributes from an original integration object.
      Parameters:
      integrationObjectModel - the original integration object to clone
      integrationObjectModelClone - the integration object clone to add cloned items and attributes onto
      Returns:
      an integration object with its contents cloned
    • persistIntegrationObject

      public void persistIntegrationObject(IntegrationObjectModel integrationObject)
      Saves an integration object with the model service.
      Parameters:
      integrationObject - the integration object to be saved
    • persistIntegrationObjectItems

      public void persistIntegrationObjectItems(Collection<IntegrationObjectItemModel> integrationObjectItemModels)
      Saves an integration object item with the model service.
      Parameters:
      integrationObjectItemModels - the integration object item to be saved
    • deleteIntegrationObject

      public void deleteIntegrationObject(IntegrationObjectModel integrationObject)
      Delete an integration object from the type system
      Parameters:
      integrationObject - the integration object to be deleted