'Non-UI application (console / server application)
#Region Project Attributes
#CommandLineArgs:
#MergeLibraries: True
#AdditionalJar: sqlite-jdbc-3.7.2
#AdditionalJar: metadata-extractor-2.6.2
#End Region
Sub Process_Globals
Public srvr As Server
Dim ABM As ABMaterial
Public folder_file As String = "\send_files\"
Public dbImage As SQL
Public SQLite As SQL
'Public PG_sStoragePath As String = "D:\Program\B4J\Server\StorageService"
Public PG_sStoragePath As String = "C:\D\Program\B4J\Server\StorageService"
Public PG_sCStore As String = "c:/Users/Namn/AppData/EasyMedia"
Public PG_sCfile As String = "file:///c:/Users/Namn/AppData/EasyMedia"
Public PG_sAppPath As String = File.DirApp & "\www\easymedia"
Public PG_bSQLRFirsttime As Boolean = True
Public filesFolder As String = "D:\Program\B4J\exempel\Fileserver\Uploaded"
Private domain As String = "DATOR"
Private token As String = "code-code"
Private updateIp As Timer
Type GoObj (id As String, lat As Double, lng As Double, iZoom As Int)
End Sub
Sub AppStart (Args() As String)
dbImage.InitializeSQLite(PG_sStoragePath & "\Databases", "dbsImage.db", True) 'OBS ändrat
dbImage.ExecNonQuery("PRAGMA journal_mode = wal")
dbImage.ExecNonQuery("PRAGMA integrity_check")
DateTime.DateFormat ="yyyy-MM-dd"
DateTime.TimeFormat = "hh:mm:ss"
ABMShared.Globals.Initialize
' Build the Theme
ABMShared.BuildTheme("mytheme")
' the user needs to login
ABMShared.NeedsAuthorization = True
ABMShared.TrackingID = "UA-1"
' create the app
Dim myApp As ABMApplication
myApp.Initialize
Dim PageDatachoiser As EasyDatachoiser
PageDatachoiser.Initialize
Dim PageEasyTreeview As EasyTreeview
PageEasyTreeview.Initialize
Dim PageEasyImages As EasyImages
PageEasyImages.Initialize
Dim PageEasyEditimages As EasyEditimages
PageEasyEditimages.Initialize
Dim PageEasyImageslider As EasyImageslider
PageEasyImageslider.Initialize
Dim PageEasyGooglemap As EasyGooglemap
PageEasyGooglemap.Initialize
Dim EasyStartPage As EasyStart
EasyStartPage.Initialize
Dim pageEasyRedig As EasyRedig
pageEasyRedig.Initialize
Dim PageEasyFileDialog As EasyFileDialog
PageEasyFileDialog.Initialize
Dim PageEasyVideos As EasyVideos
PageEasyVideos.Initialize
Dim PageEasyPres As EasyPres
PageEasyPres.Initialize
Dim PageEasyText As EasyText
PageEasyText.Initialize
myApp.AddPage(PageEasyEditimages.Page)
myApp.AddPage(PageDatachoiser.Page)
myApp.AddPage(PageEasyFileDialog.page)
myApp.AddPage(PageEasyTreeview.Page)
myApp.AddPage(PageEasyImages.Page)
myApp.AddPage(PageEasyImageslider.Page)
myApp.AddPage(PageEasyGooglemap.Page)
myApp.AddPage(EasyStartPage.Page)
myApp.AddPage(pageEasyRedig.page)
myApp.AddPage(PageEasyVideos.page)
myApp.AddPage(PageEasyPres.page)
myApp.AddPage(PageEasyText.page)
updateIp.Initialize("UpdateIp", 10 * 60 * 1000) '10 minutes
updateIp.Enabled = True
UpdateIp_Tick
File.MakeDir(File.DirApp, filesFolder)
' start the server
myApp.StartServer(srvr, "srvr", xxxxx)
ABMShared.RedirectOutput(File.DirApp, "logs.txt")
ABM.ViewerOpen("http://localhost:xxxxx/easymedia?" & ABMShared.AppVersion)
StartMessageLoop
End Sub
Sub UpdateIp_Tick()
Dim j As HttpJob
j.Initialize("j", Me)
j.Download2("http://www.duckdns.org/update", Array As String("domains", domain, "token", token, "ip", ""))
End Sub
Sub JobDone (j As HttpJob)
If j.Success = True Then
Log("Update DuckDNS: " & j.GetString)
Else
Log("Error updating Duck DNS: " & j.ErrorMessage)
End If
j.Release
End Sub