MBS FileMaker Plugin Example Databases

HTTP Server hosted

All examples are included with download of MBS FileMaker Plugin.

HTTP Server hosted.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts11
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: 124 pt
                          • Left: 91 pt
                          • Bottom: 243 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: 152 pt
                          • Left: 520 pt
                          • Bottom: 174 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::TimeStamp
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 124 pt
                          • Left: 520 pt
                          • Bottom: 145 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: 10 pt
                          • Left: 425 pt
                          • Bottom: 39 pt
                          • Right: 563 pt
                          • Anchoring: Left, Top
                          Perform Script [ “Init on server” ]

                          Scripts:


                          Button PropertiesCoordinatesScript/Script Step
                            Type:
                          • Text: Open in Browser
                          • Top: 10 pt
                          • Left: 578 pt
                          • Bottom: 39 pt
                          • Right: 716 pt
                          • Anchoring: Left, Top
                          Open URL [ "http://127.0.0.1:9999" ] [ No dialog ]

                          Script Hierarchy

                          Initialize
                          Init on server
                          ReadSomething
                          NewConnection
                          SocketError
                          PauseScript
                          Trace
                          Trace on server
                          Close Socket
                          Close Socket on server
                          Pause on Server

                          Next Script: [Init on server]
                          Script NameInitialize
                          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 [ $r; Value:MBS("Trace") ]
                            • Set Variable [ $r; Value:MBS("Socket.Close"; HTTP Server::SocketHandle) ]
                            • 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 Variable [ $r; Value:MBS("Socket.SetNewConnectionHandler"; HTTP Server::SocketHandle; Get(FileName) & ".fmp12"; "NewConnection") ]
                            • Set Variable [ $r; Value:MBS("Socket.SetErrorHandler"; HTTP Server::SocketHandle; Get(FileName) & ".fmp12"; "SocketError") ]
                            • Set Variable [ $r; Value:MBS("Socket.Listen"; HTTP Server::SocketHandle; 9999) ]
                            • #for server, keep a script running doing pause
                            • Perform Script [ “PauseScript” ]
                            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: [ReadSomething]
                                  Script NameInit on server
                                  Run script with full access privilegesOff
                                  Include In MenuYes
                                  Layouts that use this script
                                  Scripts that use this script
                                    Script Definition
                                    Script Steps
                                    • Perform Script on Server [ “Initialize” ]
                                    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: [Init on server]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): ,1 ]
                                                                                              • Set Variable [ $list; Value:MBS("Socket.CheckAll") ]
                                                                                              • If [ MBS("IsError") = 0 ]
                                                                                              • Set Variable [ $count; Value:ValueCount ( $list ) ]
                                                                                              • If [ $count > 0 ]
                                                                                              • Set Variable [ $index; Value:1 ]
                                                                                              • Loop
                                                                                              • Set Variable [ $ID; Value:GetValue($list; $index) ]
                                                                                              • Set Variable [ $typ; Value:GetValue($list; $index+1) ]
                                                                                              • If [ $typ = "accept" ]
                                                                                              • Perform Script [ “NewConnection”; Parameter: $ID ]
                                                                                              • End If
                                                                                              • If [ $typ = "read" ]
                                                                                              • Perform Script [ “ReadSomething”; Parameter: $ID ]
                                                                                              • End If
                                                                                              • Set Variable [ $index; Value:$index+2 ]
                                                                                              • Exit Loop If [ $index > $count ]
                                                                                              • End Loop
                                                                                              • End If
                                                                                              • Perform Script [ “PauseScript” ]
                                                                                              • End If
                                                                                              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]Next Script: [Trace on server]
                                                                                                          Script NameTrace
                                                                                                          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 [ $r; Value:MBS("Trace") ]
                                                                                                            • Set Variable [ $r; Value:MBS("Platform") ]
                                                                                                            • Set Variable [ $r; Value:MBS("Version") ]
                                                                                                            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: [Trace]Next Script: [Close Socket]
                                                                                                                          Script NameTrace on server
                                                                                                                          Run script with full access privilegesOff
                                                                                                                          Include In MenuYes
                                                                                                                          Layouts that use this script
                                                                                                                            Scripts that use this script
                                                                                                                              Script Definition
                                                                                                                              Script Steps
                                                                                                                              • Perform Script on Server [ “Trace” ]
                                                                                                                              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: [Trace on server]Next Script: [Close Socket on server]
                                                                                                                                          Script NameClose Socket
                                                                                                                                          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 [ $r; Value:MBS( "Socket.CloseAll" ) ]
                                                                                                                                            • Set Field [ HTTP Server::SocketHandle; "" ]
                                                                                                                                            • Commit Records/Requests [ Skip data entry validation; No dialog; Force Commit ]
                                                                                                                                            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: [Close Socket]Next Script: [Pause on Server]
                                                                                                                                                    Script NameClose Socket on server
                                                                                                                                                    Run script with full access privilegesOff
                                                                                                                                                    Include In MenuYes
                                                                                                                                                    Layouts that use this script
                                                                                                                                                      Scripts that use this script
                                                                                                                                                        Script Definition
                                                                                                                                                        Script Steps
                                                                                                                                                        • Perform Script on Server [ “Close Socket” ]
                                                                                                                                                        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: [Close Socket on server]
                                                                                                                                                                    Script NamePause on Server
                                                                                                                                                                    Run script with full access privilegesOff
                                                                                                                                                                    Include In MenuYes
                                                                                                                                                                    Layouts that use this script
                                                                                                                                                                      Scripts that use this script
                                                                                                                                                                        Script Definition
                                                                                                                                                                        Script Steps
                                                                                                                                                                        • Perform Script on Server [ “PauseScript” ]
                                                                                                                                                                        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 hosted

                                                                                                                                                                                    Used functions:




                                                                                                                                                                                    Links
                                                                                                                                                                                    MBS Xojo PDF Plugins