Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

MBS FileMaker Plugin Example Databases

HTTP Server local

All examples are included with download of MBS FileMaker Plugin.

HTTP Server local.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts6
Value Lists0
Custom Functions0
Custom Menus0
File Options
Default custom menu set[Standard FileMaker Menus]
When opening file
Minimum allowed version12.0
Login usingAccount Name; Account= Admin
Allow user to save passwordOff
Require iOS passcodeOff
Switch to layoutOff
Hide all toolbarsOff
Script triggers
OnFirstWindowOpenOff
OnLastWindowCloseOff
OnWindowOpenOff
OnWindowCloseOff
OnFileAVPlayerChangeOff
Thumbnail Settings
Generate ThumbnailsOn; Temporary

 

Tables

Table Name
Statistics
Occurrences in Relationship Graph
HTTP Server
5 fields defined, 0 record
HTTP Server

Fields

Table Name: HTTP Server - 5 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
ResponseNormal, TextAuto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Global
  • Repetitions: 1
  • Index Language: German
      RequestNormal, TextAuto-Enter:
      • Allow editing
      Validation:
      • Only during data entry
      Storage:
      • Repetitions: 1
      • Indexing: None
      • Automatically create indexes as needed
      • Index Language: German
          IPNormal, TextAuto-Enter:
          • Allow editing
          Validation:
          • Only during data entry
          Storage:
          • Repetitions: 1
          • Indexing: None
          • Automatically create indexes as needed
          • Index Language: German
              SocketHandleNormal, TextAuto-Enter:
              • Allow editing
              Validation:
              • Only during data entry
              Storage:
              • Global
              • Repetitions: 1
              • Index Language: German
                  TimeStampNormal, TimestampAuto-Enter:
                  • Creation timestamp
                  • Allow editing
                  Validation:
                  • Only during data entry
                  Storage:
                  • Repetitions: 1
                  • Indexing: None
                  • Automatically create indexes as needed
                  • Index Language: German

                        Layout Objects: HTTP Server

                        Regular Fields

                        Field Name: HTTP Server::Response
                        Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                        • Top: 10 pt
                        • Left: 90 pt
                        • Bottom: 105 pt
                        • Right: 409 pt
                        • Anchoring: Left, Top
                        Field Format:
                        • Edit Box
                        Field Behavior:
                        • Allow field to be entered: In Find mode, In Browse mode
                        • Touch keyboard type: Default for Data Type
                        • Go to next field using: Tab key
                        No

                        Field Name: HTTP Server::Request
                        Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                        • Top: 181 pt
                        • Left: 91 pt
                        • Bottom: 300 pt
                        • Right: 409 pt
                        • Anchoring: Left, Top
                        Field Format:
                        • Edit Box
                        Field Behavior:
                        • Allow field to be entered: In Find mode, In Browse mode
                        • Touch keyboard type: Default for Data Type
                        • Go to next field using: Tab key
                        Yes

                        Field Name: HTTP Server::IP
                        Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                        • Top: 209 pt
                        • Left: 520 pt
                        • Bottom: 231 pt
                        • Right: 773 pt
                        • Anchoring: Left, Top
                        Field Format:
                        • Edit Box
                        Field Behavior:
                        • Allow field to be entered: In Find mode, In Browse mode
                        • Touch keyboard type: Default for Data Type
                        • Go to next field using: Tab key
                        Yes

                        Field Name: HTTP Server::SocketHandle
                        Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                        • Top: 11 pt
                        • Left: 520 pt
                        • Bottom: 32 pt
                        • Right: 773 pt
                        • Anchoring: Left, Top
                        Field Format:
                        • Edit Box
                        Field Behavior:
                        • Allow field to be entered: In Find mode, In Browse mode
                        • Touch keyboard type: Default for Data Type
                        • Go to next field using: Tab key
                        No

                        Field Name: HTTP Server::TimeStamp
                        Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                        • Top: 181 pt
                        • Left: 520 pt
                        • Bottom: 202 pt
                        • Right: 773 pt
                        • Anchoring: Left, Top
                        Field Format:
                        • Edit Box
                        Field Behavior:
                        • Allow field to be entered: In Find mode, In Browse mode
                        • Touch keyboard type: Default for Data Type
                        • Go to next field using: Tab key
                        Yes

                        Buttons

                        Button PropertiesCoordinatesScript/Script Step
                          Type:
                        • Text: Initialize
                        • Top: 119 pt
                        • Left: 391 pt
                        • Bottom: 149 pt
                        • Right: 536 pt
                        • Anchoring: Left, Top
                        Perform Script [ “Initialize” ]

                        Scripts:


                        Button PropertiesCoordinatesScript/Script Step
                          Type:
                        • Text: Open Browser
                        • Top: 121 pt
                        • Left: 559 pt
                        • Bottom: 151 pt
                        • Right: 704 pt
                        • Anchoring: Left, Top
                        Open URL [ "http://127.0.0.1:9999" ] [ No dialog ]

                        Script Hierarchy

                        Initialize
                        ReadSomething
                        NewConnection
                        SocketError
                        PauseScript
                        Trace

                        Next Script: [ReadSomething]
                        Script NameInitialize
                        Run script with full access privilegesOff
                        Include In MenuYes
                        Layouts that use this script
                        Scripts that use this script
                          Script Definition
                          Script Steps
                          • Set Variable [ $r; Value:MBS("Trace") ]
                          • # close sockets already open by plugin, just to reset them all.
                          • Set Variable [ $r; Value:MBS("Socket.CloseAll") ]
                          • # now add a new socket
                          • Set Field [ HTTP Server::SocketHandle; MBS("Socket.NewTCPSocket") ]
                          • If [ MBS("IsError") ]
                          • Show Custom Dialog [ Title: "Failed to create Socket"; Message: HTTP Server::SocketHandle; Default Button: “OK”, Commit: “No”; Button 2: “Cancel”, Commit: “No” ]
                          • Exit Script [ ]
                          • End If
                          • # set our event handler scripts
                          • Set Variable [ $r; Value:MBS("Socket.SetNewConnectionHandler"; HTTP Server::SocketHandle; Get(FileName); "NewConnection") ]
                          • Set Variable [ $r; Value:MBS("Socket.SetErrorHandler"; HTTP Server::SocketHandle; Get(FileName); "SocketError") ]
                          • # and listen on port 9999
                          • Set Variable [ $r; Value:MBS("Socket.Listen"; HTTP Server::SocketHandle; 9999) ]
                          Fields used in this script
                          Scripts used in this script
                            Layouts used in this script
                              Tables used in this script
                              Table occurrences used by this script
                              Custom Functions used by this script
                                Custom menu set used by this script

                                  Previous Script: [Initialize]Next Script: [NewConnection]
                                  Script NameReadSomething
                                  Run script with full access privilegesOff
                                  Include In MenuNo
                                  Layouts that use this script
                                    Scripts that use this script
                                      Script Definition
                                      Script Steps
                                      • Set Variable [ $sock; Value:Get(ScriptParameter) ]
                                      • Set Variable [ $r; Value:MBS("Socket.Read"; $sock; 1500; "UTF-8") ]
                                      • If [ MBS("IsError") ]
                                      • Show Custom Dialog [ Title: "Error Reading"; Message: $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]
                                      • Else If [ Length($r) = 0 ]
                                      • // Show Custom Dialog [ Title: "Error Reading"; Message: "No data available."; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]
                                      • Else
                                      • Set Variable [ $r; Value:MBS( "Text.ReplaceNewline"; $r; 1 ) ]
                                      • New Record/Request
                                      • Set Field [ HTTP Server::Request; $r ]
                                      • Set Field [ HTTP Server::IP; MBS("Socket.RemoteIP"; $sock) ]
                                      • Commit Records/Requests [ No dialog ]
                                      • End If
                                      • Set Variable [ $response; Value:MBS( "Text.ReplaceNewline"; HTTP Server::Response; 3 ) ]
                                      • Set Variable [ $r; Value:MBS("Socket.Write"; $sock; $response; "UTF-8") ]
                                      • Set Variable [ $r; Value:MBS("Socket.Close"; $sock) ]
                                      Fields used in this script
                                      Scripts used in this script
                                        Layouts used in this script
                                          Tables used in this script
                                          Table occurrences used by this script
                                          Custom Functions used by this script
                                            Custom menu set used by this script

                                              Previous Script: [ReadSomething]Next Script: [SocketError]
                                              Script NameNewConnection
                                              Run script with full access privilegesOff
                                              Include In MenuNo
                                              Layouts that use this script
                                                Scripts that use this script
                                                  Script Definition
                                                  Script Steps
                                                  Fields used in this script
                                                    Scripts used in this script
                                                      Layouts used in this script
                                                        Tables used in this script
                                                          Table occurrences used by this script
                                                            Custom Functions used by this script
                                                              Custom menu set used by this script

                                                                Previous Script: [NewConnection]Next Script: [PauseScript]
                                                                Script NameSocketError
                                                                Run script with full access privilegesOff
                                                                Include In MenuNo
                                                                Layouts that use this script
                                                                  Scripts that use this script
                                                                    Script Definition
                                                                    Script Steps
                                                                    • Set Variable [ $sock; Value:Get(ScriptParameter) ]
                                                                    • Show Custom Dialog [ Title: "Socket Error"; Message: "For Socket " & $sock; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]
                                                                    • Set Variable [ $r; Value:MBS("Socket.Close"; $sock) ]
                                                                    • Set Variable [ $$sock; Value:"" ]
                                                                    Fields used in this script
                                                                      Scripts used in this script
                                                                        Layouts used in this script
                                                                          Tables used in this script
                                                                            Table occurrences used by this script
                                                                              Custom Functions used by this script
                                                                                Custom menu set used by this script

                                                                                  Previous Script: [SocketError]Next Script: [Trace]
                                                                                  Script NamePauseScript
                                                                                  Run script with full access privilegesOff
                                                                                  Include In MenuNo
                                                                                  Layouts that use this script
                                                                                    Scripts that use this script
                                                                                    Script Definition
                                                                                    Script Steps
                                                                                    • Pause/Resume Script [ Duration (seconds): 5 ]
                                                                                    • Perform Script on Server [ “PauseScript” ] [ Wait for completion ]
                                                                                    Fields used in this script
                                                                                      Scripts used in this script
                                                                                      Layouts used in this script
                                                                                        Tables used in this script
                                                                                          Table occurrences used by this script
                                                                                            Custom Functions used by this script
                                                                                              Custom menu set used by this script

                                                                                                Previous Script: [PauseScript]
                                                                                                Script NameTrace
                                                                                                Run script with full access privilegesOff
                                                                                                Include In MenuYes
                                                                                                Layouts that use this script
                                                                                                  Scripts that use this script
                                                                                                    Script Definition
                                                                                                    Script Steps
                                                                                                    • Set Variable [ $r; Value:MBS("Trace") ]
                                                                                                    • Set Variable [ $r; Value:MBS("Version") ]
                                                                                                    • Set Variable [ $r; Value:MBS("Platform") ]
                                                                                                    Fields used in this script
                                                                                                      Scripts used in this script
                                                                                                        Layouts used in this script
                                                                                                          Tables used in this script
                                                                                                            Table occurrences used by this script
                                                                                                              Custom Functions used by this script
                                                                                                                Custom menu set used by this script

                                                                                                                  Download example: HTTP Server local

                                                                                                                  Used functions: