com.sap.sl.sdk.authoring.datafoundation
Interface Parameter

All Superinterfaces:
Customizable, Identifiable, Inheritable, Nameable

public interface Parameter
extends Identifiable, Nameable, Customizable, Inheritable

A representation of the model object 'Parameter'.

This interface is used to represent a universe parameter, both for the data foundation and business layer. A parameter is a variable in the universe that requires a value at query time. Parameters are often defined to prompt the end-user to supply a value, and in this case are referred to as prompts. The data foundation and business layer store a list of parameters that can be retrieved from the DataFoundation.getParameters() or BusinessLayer.getParameters() methods.

To instantiate a parameter, you can use:

This interface provides a series of methods to manage the parameter options.

The following features are supported:


Method Summary
 java.lang.Object getAssociatedLov()
          Returns the value of the 'Associated Lov' reference.
 LovParameterDataType getDataType()
          Returns the value of the 'Data Type' attribute.
 Answer getDefaultAnswer()
          Returns the value of the 'Default Answer' reference.
 java.lang.String getDescription()
          Returns the value of the 'Description' attribute.
 java.lang.String getPromptText()
          Returns the value of the 'Prompt Text' attribute.
 boolean isHidden()
          Returns the value of the 'Hidden' attribute.
 boolean isIndexAwarePrompt()
          Returns the value of the 'Index Aware Prompt' attribute.
 boolean isKeepLastValuesEnabled()
          Returns the value of the 'Keep Last Values Enabled' attribute.
 boolean isMultipleValuesAllowed()
          Returns the value of the 'Multiple Values Allowed' attribute.
 boolean isSelectedOnlyFromList()
          Returns the value of the 'Selected Only From List' attribute.
 boolean isUserPrompted()
          Returns the value of the 'User Prompted' attribute.
 void setAssociatedLov(java.lang.Object value)
          Sets the value of the 'Associated Lov' reference.
 void setDataType(LovParameterDataType value)
          Sets the value of the 'Data Type' attribute.
 void setDefaultAnswer(Answer value)
          Sets the value of the 'Default Answer' reference.
 void setDescription(java.lang.String value)
          Sets the value of the 'Description' attribute.
 void setHidden(boolean value)
          Sets the value of the 'Hidden' attribute.
 void setIndexAwarePrompt(boolean value)
          Sets the value of the 'Index Aware Prompt' attribute.
 void setKeepLastValuesEnabled(boolean value)
          Sets the value of the 'Keep Last Values Enabled' attribute.
 void setMultipleValuesAllowed(boolean value)
          Sets the value of the 'Multiple Values Allowed' attribute.
 void setPromptText(java.lang.String value)
          Sets the value of the 'Prompt Text' attribute.
 void setSelectedOnlyFromList(boolean value)
          Sets the value of the 'Selected Only From List' attribute.
 void setUserPrompted(boolean value)
          Sets the value of the 'User Prompted' attribute.
 
Methods inherited from interface com.sap.sl.sdk.authoring.commons.Identifiable
getIdentifier
 
Methods inherited from interface com.sap.sl.sdk.authoring.commons.Nameable
getName, setName
 
Methods inherited from interface com.sap.sl.sdk.authoring.commons.Customizable
getCustomProperties
 
Methods inherited from interface com.sap.sl.sdk.authoring.commons.Inheritable
getInheritedData
 

Method Detail

getDescription

java.lang.String getDescription()
Returns the value of the 'Description' attribute.

This is the description of the parameter.

Returns:
the value of the 'Description' attribute.
See Also:
setDescription(String)

setDescription

void setDescription(java.lang.String value)
Sets the value of the 'Description' attribute.

This is the description of the parameter.

Parameters:
value - the new value of the 'Description' attribute.
See Also:
getDescription()

isHidden

boolean isHidden()
Returns the value of the 'Hidden' attribute. The default value is "false".

Tells if the parameter is displayed (false) or hidden (true)

Returns:
the value of the 'Hidden' attribute.
See Also:
setHidden(boolean)

setHidden

void setHidden(boolean value)
Sets the value of the 'Hidden' attribute.

Hides the parameter if value is true. This makes the parameter unavailable in the universe.

Parameters:
value - the new value of the 'Hidden' attribute.
See Also:
isHidden()

isUserPrompted

boolean isUserPrompted()
Returns the value of the 'User Prompted' attribute. The default value is "true".

Tells if the end-user is prompted to enter a value for the parameter at runtime.

Returns:
the value of the 'User Prompted' attribute.
See Also:
setUserPrompted(boolean)

setUserPrompted

void setUserPrompted(boolean value)
Sets the value of the 'User Prompted' attribute.

Prompts the end-user to enter a value for the parameter at runtime, if value is true. If false, a pre-defined value is entered at runtime.

Parameters:
value - the new value of the 'User Prompted' attribute.
See Also:
isUserPrompted()

getPromptText

java.lang.String getPromptText()
Returns the value of the 'Prompt Text' attribute. The default value is "Enter Parameter".

This is the text for the prompt question if the user is prompted.

Returns:
the value of the 'Prompt Text' attribute.
See Also:
setPromptText(String)

setPromptText

void setPromptText(java.lang.String value)
Sets the value of the 'Prompt Text' attribute.

This is the text for the prompt question if the user is prompted.

Parameters:
value - the new value of the 'Prompt Text' attribute.
See Also:
getPromptText()

getDataType

LovParameterDataType getDataType()
Returns the value of the 'Data Type' attribute. The default value is "STRING". The literals are from the enumeration LovParameterDataType.

This is the data type that the parameter accepts.

Returns:
the value of the 'Data Type' attribute.
See Also:
LovParameterDataType, setDataType(LovParameterDataType)

setDataType

void setDataType(LovParameterDataType value)
Sets the value of the 'Data Type' attribute.

This is the data type that the parameter accepts.

Parameters:
value - the new value of the 'Data Type' attribute.
See Also:
LovParameterDataType, getDataType()

isMultipleValuesAllowed

boolean isMultipleValuesAllowed()
Returns the value of the 'Multiple Values Allowed' attribute. The default value is "true".

Tells if the parameter used as prompt accepts multiple values as answers.

Returns:
the value of the 'Multiple Values Allowed' attribute.
See Also:
setMultipleValuesAllowed(boolean)

setMultipleValuesAllowed

void setMultipleValuesAllowed(boolean value)
Sets the value of the 'Multiple Values Allowed' attribute.

The end-user is allowed to select multiple values as prompt answers if value is true.

Parameters:
value - the new value of the 'Multiple Values Allowed' attribute.
See Also:
isMultipleValuesAllowed()

isKeepLastValuesEnabled

boolean isKeepLastValuesEnabled()
Returns the value of the 'Keep Last Values Enabled' attribute. The default value is "true".

Tells if the last values chosen by the end-user are kept when the prompt is re-run.

Returns:
the value of the 'Keep Last Values Enabled' attribute.
See Also:
setKeepLastValuesEnabled(boolean)

setKeepLastValuesEnabled

void setKeepLastValuesEnabled(boolean value)
Sets the value of the 'Keep Last Values Enabled' attribute.

The prompt is re-run with the last values chosen by the end-user if value is true.

Parameters:
value - the new value of the 'Keep Last Values Enabled' attribute.
See Also:
isKeepLastValuesEnabled()

isIndexAwarePrompt

boolean isIndexAwarePrompt()
Returns the value of the 'Index Aware Prompt' attribute. The default value is "false".

Tells if the prompt is index-aware.

Returns:
the value of the 'Index Aware Prompt' attribute.
See Also:
setIndexAwarePrompt(boolean)

setIndexAwarePrompt

void setIndexAwarePrompt(boolean value)
Sets the value of the 'Index Aware Prompt' attribute.

The prompt is index-aware if value is true.

Parameters:
value - the new value of the 'Index Aware Prompt' attribute.
See Also:
isIndexAwarePrompt()

isSelectedOnlyFromList

boolean isSelectedOnlyFromList()
Returns the value of the 'Selected Only From List' attribute. The default value is "false".

Tells if the end-user is obliged to select a member from a list.

Returns:
the value of the 'Selected Only From List' attribute.
See Also:
setSelectedOnlyFromList(boolean)

setSelectedOnlyFromList

void setSelectedOnlyFromList(boolean value)
Sets the value of the 'Selected Only From List' attribute.

The end-user is obliged to select a member from a list if value is true.

Parameters:
value - the new value of the 'Selected Only From List' attribute.
See Also:
isSelectedOnlyFromList()

getAssociatedLov

java.lang.Object getAssociatedLov()
Returns the value of the 'Associated Lov' reference.

This is the list of values associated with the parameter.

Returns:
the value of the 'Associated Lov' reference.
See Also:
setAssociatedLov(Object)

setAssociatedLov

void setAssociatedLov(java.lang.Object value)
Sets the value of the 'Associated Lov' reference.

This is the object associated with the parameter. It can be:

Important: you cannot associate a list of values created in the data foundation.

For example, in the case of StaticLov:

 Parameter parameter = businessLayerFactory.createParameter("MyParameter", businessLayer);     
 parameter.setAssociatedLov(myStaticLov.getColumns().get(0));
 ...

In the case of a SQLQueryLov:

For example:

 SQLQueryLov sqlQueryLov = businessLayerFactory.createSQLQueryLov("SQLQueryLov", businessLayer);
 sqlQueryLov.setSQLExpression("SELECT PRODUCT.PRODUCT_NAME  FROM PRODUCT");     
 BusinessLayerService businessLayerService = context.getService(BusinessLayerService.class);
 businessLayerService.detectLovColumns(sqlQueryLov);
 parameter.setAssociatedLov(sqlQueryLov.getColumns().get(0));
 ...

Parameters:
value - the new value of the 'Associated Lov' reference.
See Also:
getAssociatedLov()

getDefaultAnswer

Answer getDefaultAnswer()
Returns the value of the 'Default Answer' reference.

This is the default value of the parameter.

Returns:
the value of the 'Default Answer' reference.
See Also:
setDefaultAnswer(Answer)

setDefaultAnswer

void setDefaultAnswer(Answer value)
Sets the value of the 'Default Answer' reference.

This is the default value of the parameter. If value is null, then the parameter has no default answer.

Parameters:
value - the new value of the 'Default Answer' reference.
See Also:
getDefaultAnswer()


© Copyright 2016 SAP SE or an SAP affiliate company. All rights reserved.