Show TOC

Deploying Properties Within an ApplicationLocate this document in the navigation structure

Use

To deploy a set of properties within an enterprise archive you have to define your properties in a standard java.util.Property file named sap.application.global.properties and place it in the META-INF directory of your application enterprise archive. You can enhance the properties of that file by meta attributes, which specify how the system treats this property (for example, whether the system resolves it at runtime), the type and value range of the property, whether the value is visible in the administration tools, and so on.

Prerequisites

Your enterprise application project is created in the SAP NetWeaver Developer Studio.

Procedure

1. Create the application property file

  1. In the SAP NetWeaver Developer Studio, navigate to the META-INF node of your enterprise application project.

  2. Select the META-INF node and from the context menu follow the steps to create a new file.

  3. In the File Name field, enter sap.application.global.properties and choose Finish.

    The SAP NetWeaver Developer Studio creates the property file as a standard java.util.Property file.

2. Create the content of the property file

  1. Open the sap.application.global.properties property file you created.

  2. Define the properties as name-value pairs.

    employee.firstName  = firstName
    employee.familyName = familyName
    employee.password   = initialPassword
    
                      
  3. Add the required additional meta attributes:

    • Short and long descriptions.

      The short and long descriptions are added to a property by adding a line - prefix and the description text above the line, which specifies the property itself.

      Prefix

      Description

      #!

      Long description of the property (you can define it over several lines, each one starting with the same prefix).

      ##

      Short description of the property (you can define it over several lines, each one starting with the same prefix).

      • Meta-flags, which specify whether the property is parameterized, computed, online-modifiable, secured, property-linked, or final. They are introduced by prefix #? at the beginning of the line.

        If a flag is not specified, the value is interpreted as false .

        You can specify all flags of a property in one line separated by a semicolon. For example,

        #? <flag1>=<value>; <flag2>=<value>; <flag3> = <value>

        Prefix

        Meta-Flag

        Description

        #?

        secure = trueIfalse

        Specifies if the value of the property is to be stored encrypted.

        #?

        parameterized = trueIfalse

        Specifies if the entry value is to be interpreted as one containing one or more parameters, which are substituted at runtime.

        Parameterized properties contain system-dependent parameters (such as number of CPUs, message server host, amount of available memory), which are resolved at runtime.

        You can find a defined set of configuration parameters provided by the Configuration Manager in the instance profile. More information: Dynamic System Configuration .

        #?

        propertylinked = trueIfalse

        Specifies if the entry value is to be interpreted as one containing one or more value links, which are to be resolved and substituted.

        Caution

        Use this flag carefully and only in case you have detailed knowledge about what you want to achieve.

        #?

        computed = trueIfalse

        Specifies if the property value is to be interpreted as an arithmetic expression which needs to be computed.

        #?

        onlinemodifiable = trueIfalse

        Specifies if the entry is to be interpreted as online modifiable.

        Caution

        Only properties flagged as onlinemodifiable = true can be modified in the NWA.

        #?

        final = trueIfalse

        Specifies if the entry is to be interpreted as final (impossible to be overwritten in derived configurations).

        • Types of values: Long, Boolean, Double, String, byte[].

          The property values within a property file are always of the String type. From their particular semantics point of view, it is possible that they are interpreted as Long, Double number, Boolean value or Strings with specific values.

          These semantics can be specified via the logical data type and the value range. The value is checked against the listed values specified in the range. Visibility specifies in which mode in the administration tools (standard or expert) the property is shown. Types are introduced by the prefix #%.

          All enhancements can be combined with each other.

        Prefix

        Meta-Flag

        Description

        #%

        type = STRING | LONG | DOUBLE | BOOLEAN| ANY

        Specifies against which data type the property will be validated.

        #%

        range = ({val_1, val_2, val_3, ...}|[min_val-max_val] [|])*

        Specifies listed values or intervals against which the property is validated.

        #%

        Visibility = EXPERT | NOVICE | ANY

        Specifies if the property should be shown to everyone or in expert mode only.

        It is possible to specify data type, range and visibility in one line: For example, #% type = <type value>; range =<range value>; visibility = <visibility value> .

Example
## The first name of the employee.
#% type = STRING
employee.firstName = firstName

## The family name of the employee.
#% type = STRING
employee.familyName = familyName

## The password of the employee.
#! This property will be stored encrypted and can be changed online #! via SAP NetWeaver Administrator.
#? secure = true; onlinemodifiable = true
#% type = STRING;
employee.password = initialPassword

## The unique ID of the cluster element.
#! The identification number of the cluster element. The ID is 
#! unique for the cluster. Do not modify this property. Assigned at
#! installation time.
#? parameterized = true; computed = true; 
#% type = LONG; range = [1-2147483647]
element.clusterId = ${INSTANCE_ID}50 + ${NODE_INDEX}