Release 2.x‎ > ‎Install - Reference‎ > ‎Config Ref Guide‎ > ‎Contexts‎ > ‎

Context

A Context defines the combination of:
  • Definition
  • Connection
  • Association
  • AttrGroup
INFORMATION: Properties defined at this level will be pushed to the all of the defined Operations (including the Properties defined in the high-level Element Contexts). Any Property can be added at this level. There are a number of required and optional INTERNAL Properties that need to be defined (see section below).

Syntax

<Context id="..." enabled="..." definition="..." connection="..." association="...">
   <Properties>
      <Property name="context.description"  value="Person to MySQL"/>
      <Property name="operation.classname"  value="org.openptk.spi.operations.JdbcOperations"/>
      <Property name="connection.table"     value="employee"/>
      <Property name="key"                  value="uniqueid"/>
      <Property name="timeout"              value="%{timeout.write}"/>
      <Property name="search.default.order" value="lastname,firstname,uniqueid,email"/>
      <Property name="search.operators"     value="AND,OR,CONTAINS,EQ"/>
   </Properties>
   <Query type="..."/>
   <Model id="...">
      <Relationships>
         ...
      </Relationships>
   </Model>
   <Operations>
      <Operation id="..." />
      ...
   </Operations>
   <Assignments>
      <Assignment id="..." />
      ...
   </Assignments>
</Context>


Arguments

Name Required Description Example
id Yes
A unique identifier for the Context id="Person-MySQL-JDBC"
enabled Yes
Set a given Context to be enabled or not. If this is set to true then the Context is available for use. This argument allows for multiple Contexts to be defined while only having a sub-set of them be available for use. enabled="true"
definition Yes
One of the defined Definitions definition="Person" 
connection Yes
A defined Connection. A Connection MUST either be defined at the Context level or within each Operation. If a Connection is defined in both locations, the Operation level Connection will be used. connection="MySQL"
association  Yes
A defined Association. An Association MUST either be defined at the Context level or within each Operation. If an Association is defined in both locations, the Operation level Association will be used. association="JDBC"


Properties

Be Careful: If a Property has the same name as a Property from the higher-level Element (Contexts) ... it will be replaced with the Property at this level.


Name Required Description Example Value
context.description   A description of the Context Production SPML Context for a Person
operation.classname Yes
The fully qualified name of a class that implements the OperationsIF. This Property is not actually used by the Context. If it is set at this level, the Context, it will be pushed to all of the Operations within the Context. Any (or all) of the Operations can set their own classname Property.  An Operation will use it's own classname Property instead of the Context's classname org.openptk.spi.operations.JdbcOperations 
key Yes
The name of the Attribute that is designated as the unique identifier. This Property is not actually used by the Context. If it is set at this level, the Context, it will be pushed to all of the Operations within the Context. Any (or all) of the Operations can set their own key Property. An Operation will use it's own key Property instead of the Context's uniqueid
timeout   Number of milliseconds an Operation should be allowed to process until it is stopped by the Context. This Property is used by the org.openptk.provision.common.TimeoutContext Context. If it is not set, the Context will use it's own internal default value. This Property is pushed to all Operations. An Operation can set (override) this Property. 5000
search.default.order  Yes
The order of which attributes the search mechanism will use to locate entries. If the Context can support AND and OR operators, then multiple attributes can be used in the process.  lastname,firstname
search.operators Yes
What search operators does the Context support. EQ