I've been looking into it over night and it looks like I will be able to do this
in 2.0. I have to keep compatibility with the original system (some components like the ABMPDFViewer have internal redirects). The location of the .jar file is not something I can choose while B4J compiles. However, by setting up your develop folders in a certain way, you still can do everything as before. Once you deploy, copy the .jar to the appropriate folder.
Example (no nice graphics as yours, but you'll get the idea
)
1. Your development environment:
K:\
DATA\
Ideas\
ABMaterial\
StaticFilesFolderDemo\ ' = the MacThomas folder on the production server
DemoDynamic\
Files\
Objects\
demo.jar
demo.b4j
...
public_html\
application1.com\
abmwebapp\
css\
demo\
font\
js\
application2.com\
...
2. Your production server
usr/
home/
macthomas/ ' = the StaticFilesFolderDemo folder on the development env
b4j/
abmwebapp/
demo.jar
copymewithjars.needs
jetty.keystore
public_html/
application1.com/
abmwebapp/
css/
demo/
font/
js/
application2.com/
...
So it has the same structure (folder depths) in your development environment as on the production server with one difference:
In your develop environment, the demo.jar is in \objects (B4J defined) while on the production server it can be anywhere, as long as the depth of the folders match:
DemoDynamic\Objects\
b4j/abmwebapp/
What will be needed to change in the code (it is mostly the same change to MyStaticFilesFolder, but just to be complete):
In ABMShared you will need to create a variable:
Public MyStaticFilesFolder As String = ""
In Main:
ABMShared.MyStaticFilesFolder = ABM.CreateAbsolutePath(File.DirApp, "../public_html/application1.com/abmwebapp")
In ABMApplication you need to change/add a couple of lines:
In Initialize, change
#If RELEASE
...
folders.Add(ABMShared.MyStaticFilesFolder & "/" & ABMshared.AppName & "/images")
...
#End If
In AddPage, change
PageNeedsUpload.Add(ABM.WritePageToDisk(page, ABMShared.MyStaticFilesFolder & "/" & page.Name & "/", page.PageHTMLName, ABMShared.NeedsAuthorization))
In StartServer and StartServerHTTP2, change
ABM.WriteAppLauchPageToDisk(AppPage, ABMShared.MyStaticFilesFolder & "/" & ABMShared.AppName, "index.html", ABMShared.NeedsAuthorization)
In StartServer and StartServerHTTP2, add AFTER svr.Initialize
srvr.StaticFilesFolder = ABMShared.MyStaticFilesFolder
In EVERY BuildPage (
ABMApplication + every page you create), add
AppPage.StaticFilesFolder(ABMShared.MyStaticFilesFolder, ABMShared.AppName)
Additional:
If you are using a download folder (e.g. for a ABMUpload component, you must change the downloadFolder also:
Public DownloadFolder As String = ABMShared.MyStaticFilesFolder & "/" & ABMShared.AppName & "/uploads/"
This is the best I will be able to do. The reason it must be set on every page is because internally the ABMaterial class is unique and pages are unaware of an ABMApplication object. If this is ok, let me know and I implement it. Users that do not want to use this do not have to change anything.
Cheers,
Alwaysbusy