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 classes/interfaces inherited from interface ch.tocco.nice2.netui.impl.bind.entity.EntityService
EntityService.EntityFormDataException, EntityService.EntityPutResultException
-
Field Summary
Fields inherited from class ch.tocco.nice2.netui.impl.bind.form.AbstractFormRebindService
dataModel, internalFormService, typeManager
-
Constructor Summary
ConstructorDescriptionEntityServiceImpl
(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.void
setCustomDataProviders
(List<CustomDataProviderContribution> customDataProviders) Methods inherited from class ch.tocco.nice2.netui.impl.bind.form.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:
getDefaultValuesForForm
in interfaceEntityService
- Throws:
UnresolvableUriException
UriStoreException
URISyntaxException
InterruptedException
CustomDataProviderException
- See Also:
-
getDefaultValuesForFormWithOverrides
public AbstractFieldInfo[] getDefaultValuesForFormWithOverrides(String formUriString, @Nullable @Nullable DefaultValueOverride[] overrides) throws UnresolvableUriException, UriStoreException, URISyntaxException, InterruptedException, CustomDataProviderException Description copied from interface:EntityService
Returns the default values for a form.- Specified by:
getDefaultValuesForFormWithOverrides
in 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:
UnresolvableUriException
UriStoreException
URISyntaxException
InterruptedException
CustomDataProviderException
-
getDefaultValuesForFormWithOverrides
public AbstractFieldInfo[] getDefaultValuesForFormWithOverrides(String formUriString, @Nullable @Nullable DefaultValueOverride[] overrides, @Nullable @Nullable Boolean checkCreatePermission) throws UnresolvableUriException, UriStoreException, URISyntaxException, InterruptedException, CustomDataProviderException Description copied from interface:EntityService
Returns the default values for a form.- Specified by:
getDefaultValuesForFormWithOverrides
in 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:
UnresolvableUriException
UriStoreException
URISyntaxException
InterruptedException
CustomDataProviderException
-
getEmptyFormBindings
public AbstractFieldInfo[] getEmptyFormBindings(String formUriString) throws URISyntaxException, UnresolvableUriException, UriStoreException - Specified by:
getEmptyFormBindings
in interfaceEntityService
- Throws:
URISyntaxException
UnresolvableUriException
UriStoreException
-
getOptions
public List<SelectionFieldInfo.SelectionValue> getOptions(String fieldName, String formName) throws URISyntaxException, UriStoreException, UnresolvableUriException Description copied from interface:EntityService
Asynchronously load options for a combo-box.- Specified by:
getOptions
in 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:
getOptions
in interfaceEntityService
- Throws:
URISyntaxException
UriStoreException
UnresolvableUriException
-
getDataForForm
public EntityFormData getDataForForm(String formUri, String entityUri) throws UnresolvableUriException, UriStoreException, URISyntaxException, CustomDataProviderException, NoEntityToLoadException Description copied from interface:EntityService
Returns the data for a form when bound to the entity specified.- Specified by:
getDataForForm
in 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:
UnresolvableUriException
UriStoreException
URISyntaxException
CustomDataProviderException
NoEntityToLoadException
-
getEntityDisplay
Description copied from interface:EntityService
Returns the default display for an entity.- Specified by:
getEntityDisplay
in interfaceEntityService
- Parameters:
uri
- eg "entity://User/1#display"- Returns:
- The default display for the requested entity instance.
- Throws:
UnresolvableUriException
UriStoreException
-
put
public EntityPutResult put(RebindValue[] values) throws UnresolvableUriException, UriStoreException, RebindException, URISyntaxException, InterruptedException, CommitException, EntityService.EntityPutResultException - Specified by:
put
in interfaceEntityService
- Throws:
UnresolvableUriException
UriStoreException
RebindException
URISyntaxException
InterruptedException
CommitException
EntityService.EntityPutResultException
-
putWithScope
public EntityPutResult putWithScope(String scopeString, RebindValue[] values) throws UnresolvableUriException, UriStoreException, RebindException, URISyntaxException, InterruptedException, CommitException, EntityService.EntityPutResultException Description copied from interface:EntityService
Stores the values.- Specified by:
putWithScope
in interfaceEntityService
- Parameters:
scopeString
- One of "create", "update", "copy".- Throws:
UnresolvableUriException
UriStoreException
RebindException
URISyntaxException
InterruptedException
CommitException
EntityService.EntityPutResultException
-
getPkForCountry
- Specified by:
getPkForCountry
in interfaceEntityService
-
_put
public EntityPutResult _put(@Nullable RebindService.Scope scope, RebindValue[] values) throws UnresolvableUriException, UriStoreException, URISyntaxException, InterruptedException, EntityService.EntityPutResultException -
getValuesForLookupDropdown
- Specified by:
getValuesForLookupDropdown
in interfaceEntityService
-