Developer Defined Window (DDW)
From Daxipedia
Contents |
[edit] Overview
Developer Defined Window (or DDW) gives a power to the developers to add a floating window with any Web content into the frontend. The content in the window is defined by the developer. Therefore, it can be anything that can be displayed on a Web Browser.
[edit] Requirement for creating a DDW
The following parameters are the requirement information when you create a DDW:
Type - Object Type (LinkDynamic or LinkStatic)
Title - Title of the object (Can be used as a label of the DDW object)
Method - Name of the method you want to execute for the DDW
or URL that will be loaded for the DDW
AssociateTo - "Portal" or "Other" (Selection/Record or Field)
If you passed Portal, the DDW would not be associated to any other objects.
Note: A URL can be specified instead of method. The specified URL must either be absolute (http://www.domain.com/...) or relative (/4DCGI/Commands...).
Once a DDW is created, it can be used in one of the followings:
Selection - 1. The DDW option appears at the Toolbar level in the Grid (List) window)
2. The DDW option appears at the Button Set (Save and Cancel) level.
Field - The DDW option appears next to the field object.
ALL DDW ID HAS THE STARTING RANGE OF 100001 AND UP.
[edit] Using a DDW with Portal view, Selection and field
Portal View: This process happens when a you create a DDW. Once you have set a DDW to be associated to "Portal", it will automatically become a new portlet view in the sidebar.
Selection: Using a DDW in a selection means that the DDW option will be available at the top of the Grid (List) Window and at the bottom of the Editor (Detail) Window as a button next to the Save and Cancel buttons. To use a DDW in a selection, you must pass an appropriate information to the backend. Some are mandatory and some aren't. Here they are:
| DDW for | Virtual Table ID | Virtual Field ID |
|---|---|---|
| Physical table | Mandatory | Optional |
| View | Mandatory | Mandatory |
| DCS | Mandatory | Optional |
Important!!! If a Virtual Field ID is selected for Physical or DCS, you can obtain all values from that field when the DDW method is executed by calling the command DAX_Dev_DDW_GetAttributes.
Field: Setting a DDW to a field requires the Virtual Table ID and Field ID to be passed to the backend. The format is the following:
Virtual Table ID - (+/-) Numeric
Field ID - [Physical Table ID][Physical Field ID]
e.g. [2][4]
Once a DDW is set to a field, the DDW option will appear in 2 locations:
1. In the Grid (List) window as the link in the field column. The text
that appears to in the Grid will appear as a clickable-link.
2. In the Editor (Detail) window as a button next to the field.
Defining DDWs from Administration dialog
From the Administration dialog, you can create a DDW and choose different options:
You can display a static HTML page or refer a static link to another web site:
Select 'New Window - Link' and enter the URL in the Contents area.
Choose 'Portal' if you want the URL to be available from the Portal list.
Choose 'Others' if you want the URL to be available from a selection or a field.
You can display a dynamic HTML page or dynamic link to another web site, returned by a method:
Select 'New Window - HTML method' and enter the name of the method in the Contents area.
This method must return the HTML code in $0. The type of $0 will be Blob.
Choose 'Portal' if you want the URL to be available from the Portal list.
Choose 'Others' if you want the URL to be available from a selection or a field.
You can display a message at the bottom of the current selection or record window:
Select 'Status Message - Text Method' and define a method name in the Contents area.
This method must return a text message in $0.
You can only choose 'Others'. The DDW will be available for objects (table, field..).
This feature cannot be used with 'Portal'.
You can now assign your DDWs with the 'Others' setting to your selections or your fields. DDWs created with 'Portal' will automatically be displayed in the Portal window.
[edit] Backend Responsibility
When the command GetDDW is called, the backend will attempt to load all posted and related attributes before executing the method set to the DDW. Here are some of the attributes that can be access by the developers:
Type - TEXT - The type of the DDW that the frontend posted to the backend.
(Selection, Field)
TableName - TEXT - Name of the Table
TablePointer - POINTER - Pointer to the table
Null if DCS
FieldData - TEXT - The posted data in a given field (Always returned in TEXT)
RecordNumbers - POINTER - Pointer to arrays to be populated with data record number
ViewArray - POINTER - (OBSOLETE in 1.1) Pointer to an array to get populate with the
data from the field set in DDW. You should only attempt
to populate this array when the Type is "Selection" and
the current access table is a View (Virtual Table).
In the DDW method, the above attributes can be access by calling the command DAX_Dev_DDW_GetAttributes.
[edit] Commands for Developers
[edit] Command: DAX_Dev_DDW_GetAttributes
Retrieve one or more DDW attributes and related information about the current DDW call.
Syntax: DAX_Dev_DDW_GetAttributes(AttrName;PointerToVar{;PointerToVar{;PointerToVar...}})
Parameters:
$0 - PointerToTable - Returns Pointer to the posted table only if AttrName is "TablePointer"
Otherwise NULL
$1 - AttrName - Name of the attributes you are trying to access
$2 - PointerToVar - Pointer to a variable
e.g.
Pointer to a TEXT variable for AttrName="Type"
Pointer to a TEXT variable for AttrName="TableName"
Pointer to a LONGINT variable for AttrName="FieldType"
Pointer to a TEXT variable for AttrName="FieldData"
Pointer to a LONGINT ARRAY variable for AttrName="RecordNumbers"
For examples:
Retrieve the DDW type:
DAX_Dev_DDW_GetAttributes("Type";->$Type_t)
Retrieve the table name:
DAX_Dev_DDW_GetAttributes("TableName";->$TableName_t)
Retrieve the pointer to the physical table:
$TablePointer_p:=DAX_Dev_DDW_GetAttributes("TablePointer")
Retrieve the type of the posted field:
DAX_Dev_DDW_GetAttributes("FieldType";->$FieldType_l)
Retrieve the data of the posted field
DAX_Dev_DDW_GetAttributes("FieldData";->$FieldData_t)
Populate the all record number into the arrays:
DAX_Dev_DDW_GetAttributes("RecordNumbers";->$Recordnumber_al)
The "RecordNumbers" tag returns an array that contains record numbers for highlighted records in the selection. If no record has been selected, the selection is considered the records they are viewing. This array will contain all record numbers for that selection.
[edit] Command: DAX_Dev_MimeType
Get or Set the mime type for an http return. It should generally only be used within a DDW return method.
Syntax: DAX_Dev_MimeType(MimeType) -> MimeType
Parameters: $1 TEXT - Set the mime type for the http return $0 TEXT - Get the mime type for the http return
[edit] Tips: How to ignore backend error
In some cases, you may need to ignore the backend error (such as InternalError) to avoid an interuption of the frontend. This can be done by completing the following steps:
1. Assign 0 to a variable named "Error"
e.g. Error:=0
2. Assign an empty string ("") to the internal DAX error
DAX_Dev_Session_Error("")
[edit] About Your DDW Method
When a DDW is executed, the method that associated with DDW will be executed. This method is called DDW method. The method will be executed only when the /DAX/GetDDW... request is sent to the backend. It is up to the developer to perform appropriate action inside the DDW method. Often you will use DDW method to create a dynamic Web content or URL. Here are some examples of what you can do inside a DDW method:
[edit] Create a Dynamic Web Content
` DDW Method: Customer_info
` Description: Base on the customer id, find the customer and compose an
` HTML layout with his or her information and send it to the Web Frontend
C_BLOB($0)
C_TEXT($info_t)
ARRAY LONGINT($RecordNumbers_al;0)
DAX_Dev_DDW_GetAttributes ("RecordNumbers";->$RecordNumbers_al)
If (Size of array($RecordNumbers_al)=1)
GOTO RECORD([Company];$RecordNumbers_al{1})
$Info_t:="<b>"+[Company]Name+"<b><br>"
$Info_t:=$Info_t+" <i>"+[Company]Address+"<br>"
$Info_t:=$Info_t+" <i>"+[Company]City+", "
$Info_t:=$Info_t+[Company]State+" "+[Company]ZipCode+"</i>"
Else
$Info_t:="<b>The requested company does not exist in the database.</b>"
End if
TEXT TO BLOB($Info_t;$0;Text without length )
In this example, the DDW method named Customer_info is installed to the field named [Company]Name.
` Component method: DAX_DevHook_DDW_Install
$ddwID_l:=DAX_Dev_DDW_Create ("LinkStatic";"More Info";"Customer_info";"Other")
DAX_Dev_DDW_AssignToObject ($ddwID_l;"Selection";Table name(->[Company]);Field name(->[Company]Name))
When the Web frontend display the selection, the customer name will appear as a link.
When the user clicks on the link, the /DAX/GetDDW is made to the backend. As the result,
the method Customer_info is executed.
Here is example of the result:
James Williams
9128 Benton Street
Santa Clara, CA 98172
[edit] Create a Dynamic Web URL
` DDW Method: Map_Address
` Description: Base on the customer id, find the customer and compose a Google
` map URL for the customer's address and return to the frontend.
C_TEXT($0;$saddr_t;$daddr_t)
ARRAY LONGINT($RecordNumbers_al;0)
DAX_Dev_DDW_GetAttributes ("RecordNumbers";->$RecordNumbers_al)
If (Size of array($RecordNumbers_al)=1)
GOTO RECORD([Company];$RecordNumbers_al{1})
$saddr_t:="saddr=3031+Tisch+Way,+San+Jose,+CA+95128"
$daddr_t:="daddr="+[Company]Address+","+[Company]City+","+[Company]State+[Company]ZipCode
End if
$0:="http://maps.google.com/maps?"+$saddr_t+"&"+$daddr_t
In this example, the DDW method named Map_Address is installed to the field named [Company]Name.
` Component method: DAX_DevHook_DDW_Install
$ddwID_l:=DAX_Dev_DDW_Create ("LinkDynamic";"MapIt";"Map_Address";"Other")
DAX_Dev_DDW_AssignToObject ($ddwID_l;"Selection";Table name(->[Company]);Field name(->[Company]Name))
The frontend will received the Google Map URL where it can be loaded anywhere in the frontend.
[edit] Execute a Javascript v1.2
This type of DDW method is very powerful. We give the developer much more freedom in v1.2. A javascript call can now be triggered through a DDW method. You can even use it to display another DataView such as DataGrid dynamically.
REQUIREMENTS
Setting DDW from Admin Control Panel:
Type=New Window - Link, Content=MethodName (a method that generates a javascript call)
Setting DDW from method DAX_DevHook_DDW_Install:
Type=LinkDynamic&Method=MethodName&Title=MyTitle&AssociatedTo=Other
or
Type=LinkDynamic&Method=MethodName&Title=MyTitle&AssociatedTo=Portal
SYNTAX
The DDW method must return a TEXT value as the result. The returned value must be in the following format:
JS:<Any Javascript Code> => $0:="JS:<Any Javascript Code>"
EXAMPLES
To see how this works, here are some of the examples:
1. Display an alert dialog
` DDW Method: Server_Time
` Description: This method cause the frontend to display a alert
` dialog with the current time on the Server
C_TEXT($0)
$0:="JS:alert('"+String(Current time)+"');"
` Component method: DAX_DevHook_DDW_Install
$ddwID_l:=DAX_Dev_DDW_Create ("LinkDynamic";"Server Time";"Server_Time";"Portal")
2. Display a Data View object
` DDW Method: All_Company
` Description: This method cause the frontend to display a new Window
` with a DataGrid object for Table named Company.
C_TEXT($0)
$0:="JS:var myDataWindow=new DataWindow('Company',null,null,null,null,true,false);"
` Component method: DAX_DevHook_DDW_Install
$ddwID_l:=DAX_Dev_DDW_Create ("LinkDynamic";"All Company";"All_Company";"Portal")
[edit] Create and Assign DDW from the Backend
The installation of the DDW can be done programmatically in the method named DAX_DevHook_DDW_Install. To create a DDW, you need to execute the command named DAX_Dev_DDW_Create which returns a new DDW id as the result. The DDW id can be used to assign to one or more objects with the command DAX_Dev_DDW_AssignToObject.
[edit] Command: DAX_Dev_DDW_Create
Syntax: DAX_Dev_DDW_Create(Type;Title;Method/URL{;AssociatedTo}) -> DDW ID
Parameters: $0 - LONGINT - DDW ID $1 - TEXT - Type of the DDW (LinkDynamic or LinkStatic) $2 - TEXT - Title/Label to be displayed $3 - TEXT - Method/URL that will be executed or loaded $4 - TEXT - "Portal" or "Other" (Optional)
[edit] Command: DAX_Dev_DDW_AssignToObject
Syntax: DAX_Dev_DDW_AssignToObject(DDW ID;AssignTo;ObjectName;SubobjectName)
Parameters: $1 - LONGINT - DDW ID $2 - TEXT - "Selection" or "Field" $3 - TEXT - Name of the object $4 - TEXT - Name of the subobject
For example
In both examples, we are just calling a static URL, "www.4d.com"
` *** Create a DDW as a new Portlet
$ddwID_l:=DAX_Dev_DDW_Create ("LinkStatic";"My New Portlet";"http://www.4d.com/";"Portal")
` *** Create a DDW and assign it to multiple fields
$ddwID_l:=DAX_Dev_DDW_Create ("LinkStatic";"Click Me";"http://www.4d.com/";"Other")
DAX_Dev_DDW_AssignToObject ($ddwID_l;"Field";Table name(->[ConfSpecs]);Field name(->[ConfSpecs]CPU))
DAX_Dev_DDW_AssignToObject ($ddwID_l;"Field";Table name(3);Field name(3;1))
DAX_Dev_DDW_AssignToObject ($ddwID_l;"Field";Table name(3);Field name(3;2))
In this example, the mHelp method must return a blob that contains the HTML code that needs to be displayed
` *** Create a DDW and assign it to a Table level
$ddwID_l:=DAX_Dev_DDW_Create ("LinkStatic";"Click Me";"mHelp")
DAX_Dev_DDW_AssignToObject ($ddwID_l;"Selection";Table name(2))
In this example, the mHelp2 method must return a text that contains the required URL (dynamic URL for example)
` *** Create a DDW and assign it to a Table level
$ddwID_l:=DAX_Dev_DDW_Create ("LinkDynamic";"More Help";"mHelp2")
DAX_Dev_DDW_AssignToObject ($ddwID_l;"Selection";Table name(3))
[edit] Command: DAX_Dev_DDW_Delete v11.1
Syntax: DAX_Dev_DDW_Delete(DDW ID) -> Result
Parameters: $0 - LONGINT - Result (1 for success) $1 - LONGINT - DDW ID
[edit] Retrieve DDW ID and State from the Backend v1.2
The developer can retrieve the id and state through the following commands:
[edit] Command: DAX_Dev_DDW_GetID
This method allows the developer to get the DDW ID for a particular DDW name programmatically.
Syntax: DAX_Dev_DDW_GetID(DDW Name{;Mode}) -> DDW ID
Parameters: $0 - LONGINT - DDW ID $1 - TEXT - DDW Title or Name (e.g. DDW_1, DDW_2, ..., DDW_[n]) $2 - LONGINT - Mode (0 or Omitted for Get-By-Title, 1 or more for Get-By-Name)
[edit] Command: DAX_Dev_DDW_GetTitle
This method allos the developer to get the DDW title for a particular DDW ID programmatically.
Syntax: DAX_Dev_DDW_GetTitle(DDW ID) -> DDW Title
Parameters: $0 - TEXT - DDW Title $1 - LONGINT - DDW ID
[edit] Command: DAX_Dev_DDW_GetState
This method allows the developer to find out the current state of a particular DDW. Once executed, one of the following state will be returned:
State = 1 (The DDW exists and can be executed) State = 0 (The DDW does not exist) State = -1 (The DDW was deleted)
Syntax: DAX_Dev_DDW_GetState(DDW ID) -> DDW State
Parameters: $0 - LONGINT - DDW state (1 for exists, 0 for does not exist, -1 for deleted) $1 - LONGINT - DDW ID
For example
` *** Create a DDW as a new Portlet
$ddwID_l:=DAX_Dev_DDW_GetID ("DDW_1")
$ddwState_l:=DAX_Dev_DDW_GetState ($ddwID_l)
[edit] Command: DAX_Dev_DDW_GetList
This method allows the developer to retrieve the information for all DDWs (including deleted ones).
Syntax: DAX_Dev_DDW_GetList(->arrayLong{;->arrayText{;->arrayText{;->arrayText{;->arrayText{;->arrayText{;->arrayLong}}}}}})
Parameters:
$1 - LONG - Pointer to an array for DDW ID
$2 - TEXT - Pointer to an array for DDW Name
$3 - TEXT - Pointer to an array for DDW Type
$4 - TEXT - Pointer to an array for DDW Title
$5 - TEXT - Pointer to an array for DDW Content
$6 - TEXT - Pointer to an array for DDW Assigned To
$7 - LONG - Pointer to an array for DDW State (1 for exists and enable, -1 for deleted)
[edit] Frontend Commands
[edit] Command: AdminCreateDDWInfo
/DAX/AdminCreateDDWInfo
This command allows a DDW to be created by the frontend. This command should be called by the Admin connection only.
Parameters
| Name | Type | Example Value |
|---|---|---|
| Type | TEXT | "LinkDynamic" or "LinkStatic" |
| Title | TEXT | Title/Label that will appear when displaying the DDW object. |
| Method | TEXT | Method name or URL (Absolute or Relative) |
| AssociatedTo | TEXT | "Portal" for displaying the DDW as a new portlet, "Other" or omitted for allowing the DDW to be assigned to other objects. |
More about Type
If Frontend set: Type=Link, Content=URL
Must send to Backend: Type=LinkStatic&Method=MethodName&Title=MyTitle&AssociatedTo=Other
or
Type=LinkStatic&Method=MethodName&Title=MyTitle&AssociatedTo=Portal
If Frontend set: Type=Link, Content=MethodName (a method that generates a URL)
Must send to Backend: Type=LinkDynamic&Method=MethodName&Title=MyTitle&AssociatedTo=Other
or
Type=LinkDynamic&Method=MethodName&Title=MyTitle&AssociatedTo=Portal
If Frontend set: Type=Link, Content=MethodName (a method that generates an HTML content/blob)
Must send to Backend: Type=LinkStatic&Method=MethodName&Title=MyTitle&AssociatedTo=Other
or
Type=LinkStatic&Method=MethodName&Title=MyTitle&AssociatedTo=Portal
If Frontend set: Type=Web Content, Content=MethodName (a method that generates an HTML content/blob)
Must send to Backend: Type=LinkStatic&Method=MethodName&Title=MyTitle&AssociatedTo=Other
or
Type=LinkStatic&Method=MethodName&Title=MyTitle&AssociatedTo=Portal
If Frontend set: Type=Message, Content=MethodName (a method returns a text message)
Must send to Backend: Type=Message&Method=MethodName&Title=MyTitle&AssociatedTo=Other
or
Type=Message&Method=MethodName&Title=MyTitle&AssociatedTo=Portal
Important!!! All specified URL in a DDW for a Dynamic type is automatically converted to static. The reason is that the backend needs a method to compose a Dynamic URL. If a URL is specified in the Method parameter, then there will not be a method to generate URL
For example
1. Create a DDW as a new portlet
Type = "LinkDynamic" Title = "My New Portlet" Method = "My4DMethod" AssociatedTo = "Portal" http://localhost/DAX/AdminCreateDDWInfo?sessionId=S9222006150444CCWB&Type=LinkDynamic&Title=My New Portlet&Method=My4DMethod&AssociatedTo=Portal
2. Create a DDW to be assign for other objects
Type = "LinkStatic" Title = "Report" Method = "mGenReport" AssociatedTo = "Other" http://localhost/DAX/AdminCreateDDWInfo?sessionId=S9222006150444CCWB&Type=LinkStatic&Title=Report&Method=mGenReport&AssociatedTo=Other
Reply
<CreateDDWInfo> <DDW ddwid="100001" name="DDW_1" type="LinkStatic" title="Report" method="mGenReport" associatedto="Other" /> </CreateDDWInfo>
[edit] Command: AdminModifyDDWInfo
/DAX/AdminModifyDDWInfo
This command allows the frontend to modify one or more information in a specific DDW. This command should be called by the Admin connection only.
Parameters
| Name | Type | Example Value |
|---|---|---|
| ddwid | NUMERIC | DDW ID (Required) |
| name | TEXT | Name of the DDW |
| Type | TEXT | "LinkDynamic" or "LinkStatic" |
| Title | TEXT | Title/Label that will appear when displaying the DDW object. |
| Method | TEXT | Method name or URL (Absolute or Relative) |
| AssociatedTo | TEXT | "Portal" for displaying the DDW as a new portlet, "Other" or omitted for allowing the DDW to be assigned to other objects. |
For example
1. Modify a the name of a DDW and its object title.
ddwid = 100001 name = "Special Report" Title = "Company Report" http://localhost/DAX/AdminModifyDDWInfo?sessionId=S9222006150444CCWB&ddwid=100001&name=Special Report&Title=Company Report
Reply
<CreateDDWInfo> <DDW ddwid="100001" name="Special Report" type="LinkStatic" title="Company Report" method="mGenReport" associatedto="Other" /> </CreateDDWInfo>
[edit] Command: AdminDeleteDDW
/DAX/AdminDeleteDDW
This command allows the frontend to delete a DDW.
Parameters
| Name | Type | Example Value |
|---|---|---|
| ddwid | NUMERIC | DDW ID (Required) |
For example
http://localhost/DAX/AdminDeleteDDW?sessionId=S9222006150444CCWB&ddwid=100001
Reply
<AdminDeleteDDW> <Status Success="True" /> </AdminDeleteDDW>
[edit] Command: AdminSetDDWToObject
/DAX/AdminSetDDWToObject
This command allows the frontnd to assign a DDW to an object. Objects can either be "Selection" or "Field" level (type).
Parameters
| Name | Type | Example Value |
|---|---|---|
| ddwid | TEXT | DDW ID (Required) |
| type | TEXT | "Selection" or "Field" |
| objectref | NUMERIC | Object ID |
| subobjectref | [NUMERIC][NUMERIC] | [Table ID][Field ID] (required when assigning a DDW to a field or a View Selection) |
When sending only the object id, the backend will assume that the frontend wants to assign the DDW to a Selection level of the given object. If both object and subobject id (in the format of [Object ID][Subobject ID]) are sent, the backend will assign the DDW to the field level of the given object ids.
Note: [Object ID] can be a physical table, view or DCS id
[Subobject ID] is a field id of physical table, view or DCS
For example
1. Set a DDW to a Selection level of a Physical Table (ID = 1)
ddwid = 100001 type = "Selection" objectref = 1 http://localhost/DAX/AdminSetDDWToObject?sessionId=S9222006150444CCWB&ddwid=100001&type=Selection&objectref=1
Reply
<SetDDWToObject> <Status Success="True" /> </SetDDWToObject>
2. Set a DDW to a Selection level of a View (ID = 32001)
ddwid = 100001 type = "Selection" objectref = 32001 http://localhost/DAX/AdminSetDDWToObject?sessionId=S9222006150444CCWB&ddwid=100001&type=Selection&objectref=32001
Reply
<SetDDWToObject> <Status Success="True" /> </SetDDWToObject>
3. Set a DDW to a Selection level of a View (ID = -1).
Because the structure of the view consists of fields from multiple tables, a field must be sent with the request. The field id will be used later to load all values of the field into a text array when the GetDDW is called. Please the GetDDW section for more information.
ddwid = 100001 type = "Selection" objectref = -1 subobjectref = [3][4] http://localhost/DAX/AdminSetDDWToObject?sessionId=S9222006150444CCWB&ddwid=100001&type=Selection&objectref=-1&subobjectref=[3][4]
Reply
<SetDDWToObject> <Status Success="True" /> </SetDDWToObject>
4. Set a DDW to a Field level
ddwid = 100001 type = "Field" objectref = 1 subobjectref = [1][4] http://localhost/DAX/AdminSetDDWToObject?sessionId=S9222006150444CCWB&ddwid=100001&type=Field&objectref=1&subobjectref=[1][4]
Reply
<SetDDWToObject> <Status Success="True" /> </SetDDWToObject>
[edit] Command: GetDDWInfo
/DAX/GetDDWInfo
This command returns the Information about a DDW or DDW that is assigned to a selection or field.
Parameter
| Name | Type | Example Value |
|---|---|---|
| type | TEXT | "DDW", "Portal", "Other", "Selection", "Field" or "All" (Required) |
| objectid | NUMERIC | DDW or Physical/View/DCS (Not required when type is Portal) |
| subobjectid | [NUMERIC][NUMERIC] | [Table ID][Field ID] (Not required when type is Portal) |
For example
1. Get information for a DDW
type = DDW
objectid = 100001
http://localhost/DAX/GetDDWInfo?sessionId=S9222006150444CCWB&type=DDW&objectid=100001
Reply
<GetDDWInfo> <DDW ddwid="100001" name="Special Report" type="LinkDynamic" title="Company Report" method="mGenReport" associatedto="Other" /> </GetDDWInfo>
2. Get all DDW that are set to Portal
type = Portal
http://localhost/DAX/GetDDWInfo?sessionId=S9222006150444CCWB&type=Portal
Reply
<GetDDWInfo> <DDW ddwid="100004" name="MyLocations1" type="LinkDynamic" title="California" method="mShowLocationCA" associatedto="Portal" /> <DDW ddwid="100007" name="MyLocations2" type="LinkDynamic" title="New York" method="mShowLocationNY" associatedto="Portal" /> </GetDDWInfo>
3. Get all DDW that are set to Other (can be assigned to other objects)
type = Other
http://localhost/DAX/GetDDWInfo?sessionId=S9222006150444CCWB&type=Other
Reply
<GetDDWInfo> <DDW ddwid="100001" name="Special Report" type="LinkDynamic" title="Company Report" method="mGenReport" associatedto="Other" /> <DDW ddwid="100002" name="Drive" type="LinkDynamic" title="Driving Direction" method="mGetMap" associatedto="Other" /> </GetDDWInfo>
4. Get information for a Selection
type = Selection
objectid = 1 (Physical ID = 1) or -1 (View ID = -1) or 32001 (DCS ID = 32000)
http://localhost/DAX/GetDDWInfo?sessionId=S9222006150444CCWB&type=Selection&objectid=1
http://localhost/DAX/GetDDWInfo?sessionId=S9222006150444CCWB&type=Selection&objectid=-1
http://localhost/DAX/GetDDWInfo?sessionId=S9222006150444CCWB&type=Selection&objectid=32000
Reply
<GetDDWInfo> <DDW ddwid="100001" name="Special Report" type="LinkStatic" title="Company Report" method="mGenReport" associatedto="Other" /> </GetDDWInfo>
5. Get information for a Field
4.1 Part of Physical Table Portlet:
type = Selection
objectid = 1 (Physical ID = 1)
subobjectid = [1][3]
http://localhost/DAX/GetDDWInfo?sessionId=S9222006150444CCWB&type=Selection&objectid=1&subobjectid=[1][3]
Reply
<GetDDWInfo> <DDW ddwid="100001" name="Special Report" type="LinkDynamic" title="Company Report" method="mGenReport" associatedto="Other" /> </GetDDWInfo>
5.2 Part of View Portlet:
type = Selection
objectid = -1 (View ID = -1)
subobjectid = [5][3]
http://localhost/DAX/GetDDWInfo?sessionId=S9222006150444CCWB&type=Selection&objectid=1&subobjectid=[5][3]
Reply
<GetDDWInfo> <DDW ddwid="100001" name="Special Report" type="LinkDynamic" title="Company Report" method="mGenReport" associatedto="Other" /> </GetDDWInfo>
5.3 Part of DCS Portlet:
type = Selection
objectid = 32001 (DCS ID = 32001)
subobjectid = [32001][3]
http://localhost/DAX/GetDDWInfo?sessionId=S9222006150444CCWB&type=Selection&objectid=1&subobjectid=[32001][3]
Reply
<GetDDWInfo> <DDW ddwid="100001" name="Special Report" type="LinkDynamic" title="Company Report" method="mGenReport" associatedto="Other" /> </GetDDWInfo>
[edit] Command: GetDDWOption
/DAX/GetDDWOption
This command retrieve a DDW option for the Selection level. It should be called when the frontend wants to display a window (Grid/D-Tree/...) or the Editor. The return information will allow the frontend to determine whether it has a DDW option set to the current Selection or Record view.
Parameter
| Name | Type | Example Value |
|---|---|---|
| objectid | NUMERIC | Physical/View/DCS ID |
For example
http://localhost/DAX/GetDDWOption?sessionId=S1020200695349OOLN&objectid=4
Reply
<GetDDWOption> <DDW title="Click Me" type="LinkStatic" url="http://localhost/DAX/GetDDW?sessionid=S1020200695349OOLN&ddwid=100003&type=Selection"/> </GetDDWOption>
[edit] Command: GetDDW
/DAX/GetDDW
This command executes the DDW method from the backend and returns the HTML result back to the frontend.
Parameter
| Name | Type | Example Value |
|---|---|---|
| ddwid | NUMERIC | DDW ID |
| tableid | NUMERIC | Physical, View, DCS ID (+/-) |
| queryid | TEXT | Query ID |
| type | TEXT | "Selection" or "Field" (Optional) |
| data | TEXT | data in the field (Optional) |
| recordid | [NUMERIC][NUMERIC] or [NUMERIC][NUMERIC][NUMERIC] | [TABLE ID][RECORD ID] or [TABLE ID][FIELD ID][RECORD ID] (Optional) |
For example
DDW 1 is set to execute a method name mHelloWorld. This method returns the following HTML result <html> <body><i>Hello World</i></body> </html>
ddwid = 1 http://localhost/DAX/GetDDW?sessionId=S9222006150444CCWB&ddwid=1
Reply
<html> <body><i>Hello World</i></body> </html>
[edit] Frontend behavior when calling a DDW
Portlet Type: Physical Table/View/DCS
DAX Form: Grid/List Form
DDW Location: Toolbar
DDW Used By: Selection
DDW Appears As: Button/Link
Parameters that needs to be passed in the URL:
ddwid - 1, 2, 3,..., N type - "Selection" queryid - Query id of the current selection tableid - 1
For example:
/DAX/GetDDW?ddwid=1&type=Selection&queryid=SCU234559900000000&tableid=1
Portlet Type: Physical Table/View/DCS
DAX Form: Editor
DDW Location: Toolbar
DDW Used By: Selection
DDW Appears As: Button/Link
Parameters that needs to be passed in the URL:
ddwid - 1, 2, 3,..., N
type - "Selection"
tableid - 1
recordid - [Table ID][Record ID]
Record ID (0 or higher for existing record, -3 for new record)
For example:
/DAX/GetDDW?ddwid=1&type=Selection&recordid=[1][1]&tableid=1
Portlet Type: Physical Table/View/DCS
DAX Form: Editor/Detail Form
DDW Location: Next to a field
DDW Used By: Field
DDW Appears As: Button/Link
Parameters that needs to be passed in the URL:
ddwid - 1, 2, 3,..., N type - "Field" data - Current value in the field
For example:
/DAX/GetDDW?ddwid=1&type=Field&data=95118
Portlet Type: Physical Table/View/DCS
DAX Form: Grid/List Form
DDW Location: Field Column
DDW Used By: Field
DDW Appears As: Link (in the field column)
If the DDW is set with a method name, the front end will automatically get the link for each record. This link can then be used to compose a <a href...> for each row of the field column.
http://www.domain.com
http://www.domain.com/DAX/DAX_GetDDW?ddwid=1
http://www.domain.com/4DCGI/....
/4DCGI/MyCommand...
Note: No additional parameters need to be added to the URL
