Server Module (PRIM_SRVM)
Server module executes on the server
Ancestors - Object (PRIM_OBJT)
Details
Server Modules are used for server-side processing for Visual LANSA Web applications.
Server Modules are primarily comprised of individual routines (SrvRoutines) that are typically coded to perform database centric processing. They also provide Session handling features allowing data to persist between calls to the server and a timeout to be specified. For complex applications requiring multiple Server Modules, a SessionIdentifier can be specified.
Example
This example shows a simple Server Module managing a Personnel table. It has routines that return all employee records as well as create, update and delete routines.
Begin_Com Role(*EXTENDS #PRIM_SRVM)
Def_List Name(#Employees) Fields(#Empno #Surname #Givename #Address1 #Address2 #Address3 #Postcode #Phonehme #Phonebus #Deptment #Section #Salary #Startdte #Termdate) Type(*working) Entrys(999)
Group_By Name(#Employee) Fields(#Empno #Surname #Givename #Address1 #Address2 #Address3 #Postcode #Phonehme #Phonebus #Deptment #Section #Salary #Startdte #Termdate)
Srvroutine Name(GetEmployees)
List_Map For(*Output) List(#Employees)
- Get all employee data
Select Fields(#Employees) From_File(pslmst)
Add_Entry To_List(#Employees)
Endselect
Endroutine - Get a complete employee record
Srvroutine Name(GetEmployee)
Field_Map For(*Input) Field(#Empno)
Group_Map For(*output) Group(#Employee)
Field_Map For(*output) Field(#io$sts) Parameter_Name(Status)
Fetch Fields(#Employee) From_File(pslmst) With_Key(#Empno)
Endroutine
Srvroutine Name(SaveEmployee)
Group_Map For(*input) Group(#Employee)
Field_Map For(*output) Field(#io$sts) Parameter_Name(Status)
Update Fields(#Employee) In_File(pslmst) With_Key(#Empno) Val_Error(*Next)
Endroutine
Srvroutine Name(CreateEmployee)
Group_Map For(*input) Group(#Employee)
Field_Map For(*output) Field(#io$sts) Parameter_Name(Status)
Insert Fields(#Employee) To_File(pslmst) Val_Error(*Next)
Endroutine
Srvroutine Name(CreateEmployee)
Field_Map For(*Input) Field(#Empno)
Field_Map For(*output) Field(#io$sts) Parameter_Name(Status)
Delete From_File(pslmst) With_Key(#Empno) Val_Error(*Next)
Endroutine
End_ComProperties
Name
Description
ComponentClassName is the name of the component's class. Inherited from Object (PRIM_OBJT)
ComponentMembers provides access to all the member components of this component Inherited from Object (PRIM_OBJT)
ComponentPatternName is used to qualify the class of the component. Inherited from Object (PRIM_OBJT)
Generic space allowing a value to be stored for the instance Inherited from Object (PRIM_OBJT)
ComponentType gives you access to the type information about the component Inherited from Object (PRIM_OBJT)
ComponentTypeName is the fully qualified name of the component's class. Inherited from Object (PRIM_OBJT)
Name identifies the component Inherited from Object (PRIM_OBJT)
Owner owns this component Inherited from Object (PRIM_OBJT)
The component instance to which this instance is attached. The visual container for a control or the collector of a set of child instances Inherited from Object (PRIM_OBJT)
Name of the session used to connect multiple Server Modules
Determines how session information is moved between the client and server
Events
Name
Description
CreateInstance is signalled when an instance of a component is created [Inherited from Server Module (PRIM_SRVM)
DestroyInstance is signalled when an instance of a component is about to be destroyed [Inherited from Server Module (PRIM_SRVM)
Fired when the a request is made but the session is no longer valid SenderName
Methods
Name
Description
Terminate the session
Start a session Timeout
See also
All Component Classes
Technical Reference