XI: Migrating your existing IntraWeb application to XI

XI: Migrating your existing IntraWeb application to XI

We list here some Required and Optional steps to migrate your Stand Alone or Service project to IW XI

Required Steps

Open the unit IWServerController.pas and click Ignone All… The IDE will remove non existing properties. Check the API Changes blog post for a list of properties that were removed from ServerController.

Optional Steps

Updating the project structure

IW XI has a new project structure and the new projects will be created based on it. If you want to update your project to match the new structure:

For Stand Alone Server like projects

  • Open your project main file
  • In the uses clause, replace the reference to the unit “IWMain.pas” by “IWStart.pas”
  • In the body of your project, replace

begin
  Application.Initialize;
  Application.CreateForm(TformIWMain, formIWMain);
  Application.Run;
end.

by

begin
  TIWStart.Execute(True);
end.

For Services like projects

  • Open your project main file
  • In the uses clause, replace the reference to the unit “IWInitService.pas” by “IWStart.pas”
  • In the body of your project, replace

begin
  IWRun;
end.

by

begin
  TIWStart.Execute(False);
end.

Note that in IX, we unified Stand Alone Server and Service type applications. Now we have only Stand Alone Applications and what defines if your IntraWeb application will run as a Service or as a Stand Alone Server with a GUI is the Boolean parameter in “TIWStart.Execute”. TIWStart.Execute(False) will initialize the application as a Service, and no GUI is showed. TIWStart.Execute(True) will initialize the application as Stand Alone Server with the usual GUI.

The new wwwroot folder

Create a new folder “wwwroot” and place all the plubic files of your application under it. The “wwwroot” is very similar in concept of the “Files” folder, but now much more flexible. You can have subfolders and store static content (JPG, HTML, PDF, etc.) in any folder under “wwwroot”. Now you can access the full path to the “wwwroot” folder referencing GServerController.ContentPath.

You can change references to WebApplication.ApplicationPath to the new property ContentPath from ServerController. You can use the global var GServerController (or simply gSC).

FPath := GServerController.ContentPath + ‘Downloads’;

If you are uploading files, you may need to change the upload location, using the reference GServerController.ContentPath.

The new Authentication components

Note: this document is a work in progress and it is subject to changes