Package org.cxbox.core.crudma.impl
Class AbstractCrudmaService
java.lang.Object
org.cxbox.core.crudma.impl.AbstractCrudmaService
- All Implemented Interfaces:
Crudma
- Direct Known Subclasses:
AnySourceCrudmaService,InnerCrudmaService,UniversalCrudmaService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionassociate(BusinessComponent bc, List<org.cxbox.api.data.dto.AssociateDTO> data) Creates links between entitiesprotected MetaDTOprotected MetaDTObuildMeta(List<org.cxbox.api.data.dto.rowmeta.FieldDTO> fields, ActionsDTO actions) longReturns the number of matching entitiesCreates an entity based on a business componentDeletes an entity based on a business componentorg.cxbox.api.data.dto.DataResponseDTOget(BusinessComponent bc) Returns object based on a business componentgetActions(BcDescription bcDescription) Recommended way to build actions.org.cxbox.api.data.ResultPage<? extends org.cxbox.api.data.dto.DataResponseDTO>Returns all matched objects based on a business componentReturns meta for entity based on a business componentReturns empty meta for entity based on a business componentgetMetaNew(BusinessComponent bc, CreateResult data) Returns new meta for entity based on a business componentgetOnFieldUpdateMeta(BusinessComponent bc, org.cxbox.api.data.dto.DataResponseDTO dto) Returns on-field-update meta for entity based on a business componentinvokeAction(BusinessComponent bc, String actionName, Map<String, Object> data) Invokes action with given name, add preactions, loads or updates entity if necessaryorg.cxbox.api.data.dto.rowmeta.PreviewResultpreview(BusinessComponent bc, Map<String, Object> data) Updates an entity based on a business component by map Used in forceactive fieldsupdate(BusinessComponent bc, Map<String, Object> data) Updates an entity based on a business component by map
-
Constructor Details
-
AbstractCrudmaService
public AbstractCrudmaService()
-
-
Method Details
-
get
Description copied from interface:CrudmaReturns object based on a business component -
getAll
public org.cxbox.api.data.ResultPage<? extends org.cxbox.api.data.dto.DataResponseDTO> getAll(BusinessComponent bc) Description copied from interface:CrudmaReturns all matched objects based on a business component -
create
Description copied from interface:CrudmaCreates an entity based on a business component- Specified by:
createin interfaceCrudma- Parameters:
bc- businessComponent- Returns:
CreateResultclass with DataResponseDTO and postactions
-
preview
public org.cxbox.api.data.dto.rowmeta.PreviewResult preview(BusinessComponent bc, Map<String, Object> data) Description copied from interface:CrudmaUpdates an entity based on a business component by map Used in forceactive fields -
update
Description copied from interface:CrudmaUpdates an entity based on a business component by map- Specified by:
updatein interfaceCrudma- Parameters:
bc- businessComponentdata- information about entity- Returns:
ActionResultDTOclass with DataResponseDTO and postactions
-
delete
Description copied from interface:CrudmaDeletes an entity based on a business component- Specified by:
deletein interfaceCrudma- Parameters:
bc- businessComponent- Returns:
ActionResultDTOclass with DataResponseDTO and postactions
-
getActions
Description copied from interface:CrudmaRecommended 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:
getActionsin interfaceCrudma- Returns:
-
invokeAction
public ActionResultDTO invokeAction(BusinessComponent bc, String actionName, Map<String, Object> data) Description copied from interface:CrudmaInvokes action with given name, add preactions, loads or updates entity if necessary- Specified by:
invokeActionin interfaceCrudma- Parameters:
bc- businessComponentactionName- name of actiondata- information about entity- Returns:
ActionResultDTOclass with DataResponseDTO and postactions
-
associate
public AssociateResultDTO associate(BusinessComponent bc, List<org.cxbox.api.data.dto.AssociateDTO> data) Description copied from interface:CrudmaCreates links between entities- Specified by:
associatein interfaceCrudma- Parameters:
bc- businessComponentdata- information about an entity, whether the entity was associated- Returns:
AssociateResultDTOclass with DataResponseDTO and postactions
-
getMetaNew
Description copied from interface:CrudmaReturns new meta for entity based on a business component- Specified by:
getMetaNewin interfaceCrudma- Parameters:
bc- businessComponentdata- class with DataResponseDTO and postactions- Returns:
MetaDTOclass with meta DTO and postactions
-
getMeta
Description copied from interface:CrudmaReturns meta for entity based on a business component -
getMetaEmpty
Description copied from interface:CrudmaReturns empty meta for entity based on a business component- Specified by:
getMetaEmptyin interfaceCrudma- Parameters:
bc- businessComponent- Returns:
MetaDTOclass with meta DTO and postactions
-
getOnFieldUpdateMeta
public MetaDTO getOnFieldUpdateMeta(BusinessComponent bc, org.cxbox.api.data.dto.DataResponseDTO dto) Description copied from interface:CrudmaReturns on-field-update meta for entity based on a business component- Specified by:
getOnFieldUpdateMetain interfaceCrudma- Parameters:
bc- businessComponentdto- information about entity, it's changed fields, errors- Returns:
MetaDTOclass with meta DTO and postactions
-
count
Description copied from interface:CrudmaReturns the number of matching entities -
buildMeta
-
buildMeta
protected MetaDTO buildMeta(List<org.cxbox.api.data.dto.rowmeta.FieldDTO> fields, ActionsDTO actions)
-