Class EntityServiceImpl
java.lang.Object
ch.tocco.nice2.netui.impl.bind.form.AbstractFormRebindService
ch.tocco.nice2.netui.impl.bind.entity.EntityServiceImpl
- All Implemented Interfaces:
EntityService
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface EntityService
EntityService.EntityFormDataException, EntityService.EntityPutResultException -
Field Summary
Fields inherited from class AbstractFormRebindService
dataModel, internalFormService, typeManager -
Constructor Summary
ConstructorsConstructorDescriptionEntityServiceImpl(org.slf4j.Logger log, TypeManager typeManager, UriResolver uriResolver, Context context, SecurityManager securityManager, DefaultValueResolver defaultValueResolver, DataModel dataModel, RebindService rebindService, InternalFormService internalFormService, ConstrictionManager constrictionManager, QueryPopulator queryPopulator, DisplayFactory displayFactory, QueryBuilderFactory queryBuilderFactory, BusinessUnitManager businessUnitManager, DefaultDisplayService defaultDisplayService, CommandExecutor executor) -
Method Summary
Modifier and TypeMethodDescription_put(RebindService.Scope scope, RebindValue[] values) getDataForForm(String formUri, String entityUri) Returns the data for a form when bound to the entity specified.getDefaultValuesForForm(String formUriString) getDefaultValuesForFormWithOverrides(String formUriString, @Nullable DefaultValueOverride[] overrides) Returns the default values for a form.getDefaultValuesForFormWithOverrides(String formUriString, @Nullable DefaultValueOverride[] overrides, @Nullable Boolean checkCreatePermission) Returns the default values for a form.getEmptyFormBindings(String formUriString) getEntityDisplay(URI uri) Returns the default display for an entity.getOptions(String fieldName, String formName) Asynchronously load options for a combo-box.getOptions(String fieldName, String formName, @Nullable String[] businessUnits) This method may be simplified in the future: see task #52224getPkForCountry(String iso3166) getValuesForLookupDropdown(String entityName) put(RebindValue[] values) putWithScope(String scopeString, RebindValue[] values) Stores the values.voidsetCustomDataProviders(List<CustomDataProviderContribution> customDataProviders) Methods inherited from class AbstractFormRebindService
collectDataComponents, collectDataComponents, collectIteratorDataComponents, expectDataComponent, expectDataComponent, getDataTypeFromComponent
-
Constructor Details
-
EntityServiceImpl
public EntityServiceImpl(org.slf4j.Logger log, TypeManager typeManager, UriResolver uriResolver, Context context, SecurityManager securityManager, DefaultValueResolver defaultValueResolver, DataModel dataModel, RebindService rebindService, InternalFormService internalFormService, ConstrictionManager constrictionManager, QueryPopulator queryPopulator, DisplayFactory displayFactory, QueryBuilderFactory queryBuilderFactory, BusinessUnitManager businessUnitManager, DefaultDisplayService defaultDisplayService, CommandExecutor executor)
-
-
Method Details
-
setCustomDataProviders
@Autowired(required=false) public void setCustomDataProviders(List<CustomDataProviderContribution> customDataProviders) -
getDefaultValuesForForm
public AbstractFieldInfo[] getDefaultValuesForForm(String formUriString) throws UnresolvableUriException, UriStoreException, URISyntaxException, InterruptedException, CustomDataProviderException - Specified by:
getDefaultValuesForFormin interfaceEntityService- Throws:
UnresolvableUriExceptionUriStoreExceptionURISyntaxExceptionInterruptedExceptionCustomDataProviderException- See Also:
-
getDefaultValuesForFormWithOverrides
public AbstractFieldInfo[] getDefaultValuesForFormWithOverrides(String formUriString, @Nullable @Nullable DefaultValueOverride[] overrides) throws UnresolvableUriException, UriStoreException, URISyntaxException, InterruptedException, CustomDataProviderException Description copied from interface:EntityServiceReturns the default values for a form.- Specified by:
getDefaultValuesForFormWithOverridesin interfaceEntityService- Parameters:
formUriString- eg "form://My_entity/create". The supported scopes for default values are 'create' and 'search'. The 'create' scope also consults the entity model whereas the 'search' scope only looks in the form models.overrides- Allows to add/override default values from the js calling code. See js for how it's used.- Returns:
- Returns an entry for every field in the form, even if it does not have a real default value (null-object). This is required for the databinding.
- Throws:
UnresolvableUriExceptionUriStoreExceptionURISyntaxExceptionInterruptedExceptionCustomDataProviderException
-
getDefaultValuesForFormWithOverrides
public AbstractFieldInfo[] getDefaultValuesForFormWithOverrides(String formUriString, @Nullable @Nullable DefaultValueOverride[] overrides, @Nullable @Nullable Boolean checkCreatePermission) throws UnresolvableUriException, UriStoreException, URISyntaxException, InterruptedException, CustomDataProviderException Description copied from interface:EntityServiceReturns the default values for a form.- Specified by:
getDefaultValuesForFormWithOverridesin interfaceEntityService- Parameters:
formUriString- eg "form://My_entity/create". The supported scopes for default values are 'create' and 'search'. The 'create' scope also consults the entity model whereas the 'search' scope only looks in the form models.overrides- Allows to add/override default values from the js calling code. See js for how it's used.checkCreatePermission- A boolean to specify whether fields which mustn't be edited by the user should be hidden or not (true to hide the fields; defaults to true if scope is CREATE, else false)- Returns:
- Returns an entry for every field in the form, even if it does not have a real default value (null-object). This is required for the databinding.
- Throws:
UnresolvableUriExceptionUriStoreExceptionURISyntaxExceptionInterruptedExceptionCustomDataProviderException
-
getEmptyFormBindings
public AbstractFieldInfo[] getEmptyFormBindings(String formUriString) throws URISyntaxException, UnresolvableUriException, UriStoreException - Specified by:
getEmptyFormBindingsin interfaceEntityService- Throws:
URISyntaxExceptionUnresolvableUriExceptionUriStoreException
-
getOptions
public List<SelectionFieldInfo.SelectionValue> getOptions(String fieldName, String formName) throws URISyntaxException, UriStoreException, UnresolvableUriException Description copied from interface:EntityServiceAsynchronously load options for a combo-box.- Specified by:
getOptionsin interfaceEntityService- Parameters:
fieldName- name of the fieldformName- name of the form- Returns:
- a list of SelectionValues
- Throws:
URISyntaxException- -UriStoreException- -UnresolvableUriException- -
-
getOptions
public List<SelectionFieldInfo.SelectionValue> getOptions(String fieldName, String formName, @Nullable @Nullable String[] businessUnits) throws URISyntaxException, UriStoreException, UnresolvableUriException This method may be simplified in the future: see task #52224- Specified by:
getOptionsin interfaceEntityService- Throws:
URISyntaxExceptionUriStoreExceptionUnresolvableUriException
-
getDataForForm
public EntityFormData getDataForForm(String formUri, String entityUri) throws UnresolvableUriException, UriStoreException, URISyntaxException, CustomDataProviderException, NoEntityToLoadException Description copied from interface:EntityServiceReturns the data for a form when bound to the entity specified.- Specified by:
getDataForFormin interfaceEntityService- Parameters:
entityUri- eg "entity://User/1"- Returns:
- Returns an entry for every field in the form, even if it does not have a value (null-object). This is required for the databinding.
- Throws:
UnresolvableUriExceptionUriStoreExceptionURISyntaxExceptionCustomDataProviderExceptionNoEntityToLoadException
-
getEntityDisplay
Description copied from interface:EntityServiceReturns the default display for an entity.- Specified by:
getEntityDisplayin interfaceEntityService- Parameters:
uri- eg "entity://User/1#display"- Returns:
- The default display for the requested entity instance.
- Throws:
UnresolvableUriExceptionUriStoreException
-
put
public EntityPutResult put(RebindValue[] values) throws UnresolvableUriException, UriStoreException, RebindException, URISyntaxException, InterruptedException, CommitException, EntityService.EntityPutResultException - Specified by:
putin interfaceEntityService- Throws:
UnresolvableUriExceptionUriStoreExceptionRebindExceptionURISyntaxExceptionInterruptedExceptionCommitExceptionEntityService.EntityPutResultException
-
putWithScope
public EntityPutResult putWithScope(String scopeString, RebindValue[] values) throws UnresolvableUriException, UriStoreException, RebindException, URISyntaxException, InterruptedException, CommitException, EntityService.EntityPutResultException Description copied from interface:EntityServiceStores the values.- Specified by:
putWithScopein interfaceEntityService- Parameters:
scopeString- One of "create", "update", "copy".- Throws:
UnresolvableUriExceptionUriStoreExceptionRebindExceptionURISyntaxExceptionInterruptedExceptionCommitExceptionEntityService.EntityPutResultException
-
getPkForCountry
- Specified by:
getPkForCountryin interfaceEntityService
-
_put
public EntityPutResult _put(@Nullable RebindService.Scope scope, RebindValue[] values) throws UnresolvableUriException, UriStoreException, URISyntaxException, InterruptedException, EntityService.EntityPutResultException -
getValuesForLookupDropdown
- Specified by:
getValuesForLookupDropdownin interfaceEntityService
-