Class AbstractCrudmaService

java.lang.Object
org.cxbox.core.crudma.impl.AbstractCrudmaService
All Implemented Interfaces:
Crudma
Direct Known Subclasses:
AnySourceCrudmaService, InnerCrudmaService, UniversalCrudmaService

public abstract class AbstractCrudmaService extends Object implements Crudma
  • Constructor Details

    • AbstractCrudmaService

      public AbstractCrudmaService()
  • Method Details

    • get

      public org.cxbox.api.data.dto.DataResponseDTO get(BusinessComponent bc)
      Description copied from interface: Crudma
      Returns object based on a business component
      Specified by:
      get in interface Crudma
      Parameters:
      bc - businessComponent
      Returns:
      DataResponseDTO information about entity, it's changed fields, errors
    • getAll

      public org.cxbox.api.data.ResultPage<? extends org.cxbox.api.data.dto.DataResponseDTO> getAll(BusinessComponent bc)
      Description copied from interface: Crudma
      Returns all matched objects based on a business component
      Specified by:
      getAll in interface Crudma
      Parameters:
      bc - businessComponent
      Returns:
      ResultPage class with list of objects
    • create

      public CreateResult create(BusinessComponent bc)
      Description copied from interface: Crudma
      Creates an entity based on a business component
      Specified by:
      create in interface Crudma
      Parameters:
      bc - businessComponent
      Returns:
      CreateResult class with DataResponseDTO and postactions
    • preview

      public org.cxbox.api.data.dto.rowmeta.PreviewResult preview(BusinessComponent bc, Map<String,Object> data)
      Description copied from interface: Crudma
      Updates an entity based on a business component by map Used in forceactive fields
      Specified by:
      preview in interface Crudma
      Parameters:
      bc - businessComponent
      data - information about entity
      Returns:
      PreviewResult class with DataResponseDTO
    • update

      public ActionResultDTO update(BusinessComponent bc, Map<String,Object> data)
      Description copied from interface: Crudma
      Updates an entity based on a business component by map
      Specified by:
      update in interface Crudma
      Parameters:
      bc - businessComponent
      data - information about entity
      Returns:
      ActionResultDTO class with DataResponseDTO and postactions
    • delete

      public ActionResultDTO delete(BusinessComponent bc)
      Description copied from interface: Crudma
      Deletes an entity based on a business component
      Specified by:
      delete in interface Crudma
      Parameters:
      bc - businessComponent
      Returns:
      ActionResultDTO class with DataResponseDTO and postactions
    • getActions

      public Actions getActions(BcDescription bcDescription)
      Description copied from interface: Crudma
      Recommended way to build actions. Usually used in getMeta, getMetaNew, getMetaEmpty implicitly (but can be enriched with other actions not listed in getActions (from external systems for example), so potentially getActions does not return FULL list of actions)
      Specified by:
      getActions in interface Crudma
      Returns:
    • invokeAction

      public ActionResultDTO invokeAction(BusinessComponent bc, String actionName, Map<String,Object> data)
      Description copied from interface: Crudma
      Invokes action with given name, add preactions, loads or updates entity if necessary
      Specified by:
      invokeAction in interface Crudma
      Parameters:
      bc - businessComponent
      actionName - name of action
      data - information about entity
      Returns:
      ActionResultDTO class with DataResponseDTO and postactions
    • associate

      public AssociateResultDTO associate(BusinessComponent bc, List<org.cxbox.api.data.dto.AssociateDTO> data)
      Description copied from interface: Crudma
      Creates links between entities
      Specified by:
      associate in interface Crudma
      Parameters:
      bc - businessComponent
      data - information about an entity, whether the entity was associated
      Returns:
      AssociateResultDTO class with DataResponseDTO and postactions
    • getMetaNew

      public MetaDTO getMetaNew(BusinessComponent bc, CreateResult data)
      Description copied from interface: Crudma
      Returns new meta for entity based on a business component
      Specified by:
      getMetaNew in interface Crudma
      Parameters:
      bc - businessComponent
      data - class with DataResponseDTO and postactions
      Returns:
      MetaDTO class with meta DTO and postactions
    • getMeta

      public MetaDTO getMeta(BusinessComponent bc)
      Description copied from interface: Crudma
      Returns meta for entity based on a business component
      Specified by:
      getMeta in interface Crudma
      Parameters:
      bc - businessComponent
      Returns:
      MetaDTO class with meta DTO and postactions
    • getMetaEmpty

      public MetaDTO getMetaEmpty(BusinessComponent bc)
      Description copied from interface: Crudma
      Returns empty meta for entity based on a business component
      Specified by:
      getMetaEmpty in interface Crudma
      Parameters:
      bc - businessComponent
      Returns:
      MetaDTO class with meta DTO and postactions
    • getOnFieldUpdateMeta

      public MetaDTO getOnFieldUpdateMeta(BusinessComponent bc, org.cxbox.api.data.dto.DataResponseDTO dto)
      Description copied from interface: Crudma
      Returns on-field-update meta for entity based on a business component
      Specified by:
      getOnFieldUpdateMeta in interface Crudma
      Parameters:
      bc - businessComponent
      dto - information about entity, it's changed fields, errors
      Returns:
      MetaDTO class with meta DTO and postactions
    • count

      public long count(BusinessComponent bc)
      Description copied from interface: Crudma
      Returns the number of matching entities
      Specified by:
      count in interface Crudma
      Parameters:
      bc - businessComponent
      Returns:
      count
    • buildMeta

      protected MetaDTO buildMeta(List<org.cxbox.api.data.dto.rowmeta.FieldDTO> fields)
    • buildMeta

      protected MetaDTO buildMeta(List<org.cxbox.api.data.dto.rowmeta.FieldDTO> fields, ActionsDTO actions)