Interface EntityService
- All Known Implementing Classes:
EntityServiceImpl
public interface EntityService
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
static class
-
Method Summary
Modifier and TypeMethodDescriptiongetDataForForm
(String formUri, String entityUri) Returns the data for a form when bound to the entity specified.getDefaultValuesForForm
(String formUri) getDefaultValuesForFormWithOverrides
(String formUri, @Nullable DefaultValueOverride[] overrides) Returns the default values for a form.getDefaultValuesForFormWithOverrides
(String formUri, @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) Asynchronously load options for a combo-box but only returnSelectionFieldInfo.SelectionValue
s which come from the passed business units.getPkForCountry
(String iso3166) getValuesForLookupDropdown
(String entityName) put
(RebindValue[] values) Deprecated.use putWithScope()putWithScope
(String scope, RebindValue[] values) Stores the values.
-
Method Details
-
getDefaultValuesForForm
AbstractFieldInfo[] getDefaultValuesForForm(String formUri) throws UnresolvableUriException, UriStoreException, URISyntaxException, InterruptedException, CustomDataProviderException -
getDefaultValuesForFormWithOverrides
AbstractFieldInfo[] getDefaultValuesForFormWithOverrides(String formUri, @Nullable @Nullable DefaultValueOverride[] overrides) throws UnresolvableUriException, UriStoreException, URISyntaxException, InterruptedException, CustomDataProviderException Returns the default values for a form.- Parameters:
formUri
- 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
AbstractFieldInfo[] getDefaultValuesForFormWithOverrides(String formUri, @Nullable @Nullable DefaultValueOverride[] overrides, @Nullable @Nullable Boolean checkCreatePermission) throws UnresolvableUriException, UriStoreException, URISyntaxException, InterruptedException, CustomDataProviderException Returns the default values for a form.- Parameters:
formUri
- 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
AbstractFieldInfo[] getEmptyFormBindings(String formUriString) throws URISyntaxException, UnresolvableUriException, UriStoreException, InterruptedException -
getDataForForm
EntityFormData getDataForForm(String formUri, String entityUri) throws UnresolvableUriException, UriStoreException, URISyntaxException, CustomDataProviderException, NoEntityToLoadException Returns the data for a form when bound to the entity specified.- 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
Returns the default display for an entity.- Parameters:
uri
- eg "entity://User/1#display"- Returns:
- The default display for the requested entity instance.
- Throws:
UnresolvableUriException
UriStoreException
-
put
@Deprecated EntityPutResult put(RebindValue[] values) throws UnresolvableUriException, UriStoreException, RebindException, URISyntaxException, InterruptedException, CommitException, EntityService.EntityPutResultException Deprecated.use putWithScope() -
putWithScope
EntityPutResult putWithScope(String scope, RebindValue[] values) throws UnresolvableUriException, UriStoreException, RebindException, URISyntaxException, InterruptedException, CommitException, EntityService.EntityPutResultException Stores the values.- Parameters:
scope
- One of "create", "update", "copy".- Throws:
UnresolvableUriException
UriStoreException
RebindException
URISyntaxException
InterruptedException
CommitException
EntityService.EntityPutResultException
-
getPkForCountry
- Throws:
PersistException
-
getValuesForLookupDropdown
-
getOptions
List<SelectionFieldInfo.SelectionValue> getOptions(String fieldName, String formName) throws URISyntaxException, UriStoreException, UnresolvableUriException Asynchronously load options for a combo-box.- Parameters:
fieldName
- name of the fieldformName
- name of the form- Returns:
- a list of SelectionValues
- Throws:
URISyntaxException
- -UriStoreException
- -UnresolvableUriException
- -
-
getOptions
List<SelectionFieldInfo.SelectionValue> getOptions(String fieldName, String formName, @Nullable @Nullable String[] businessUnits) throws PersistException, URISyntaxException, UriStoreException, UnresolvableUriException Asynchronously load options for a combo-box but only returnSelectionFieldInfo.SelectionValue
s which come from the passed business units. IfNULL
is passed, it returns values from all business units. If two or more values have the same display value, the label of the business unit will be added in brackets. Example (Membership_type): BU1 has a membership type with the label `Member` BU2 has a membership type with the label `Member` The return value for each of these two membership types will be: - `Member (BU1.label)` - `Member (BU2.label)`
-