Sw4   >   Misc   >   Create New SW App

Create New SW App

When you are learning StudioWorks the easiest way to create a new StudioWorks app is by following the instructions given in the Quick Startup Tutorial. The Quick Startup Tutorial takes you through the steps of modifying StartNewApp which is the demo app that comes which each release of StudioWorks.

If you want to create a new app from scratch, here are the steps to follow:

Note

Be sure to complete the Quick Start Tutorial before you attempt to create a new app from scratch.

  1. Download and unzip the lastest StartNewApp zip file from the StudioWorks FTP server.
  2. Decide on a 2 or 3 letter lower case acronym for your company name which you will use as a prefix for your library names. In this example we'll use xyz as the company prefix. You substitute your own company prefix.
  3. Decide on a short name for your application. In this example we'll use Great App as the application name. You substitute your own app name.
  4. Rename the unzipped StartNewApp folder to Great App. The Great App folder is referred to as the APP folder. The entire application is enclosed inside the APP folder.
  5. Inside the Great App folder, rename open_myApp to open_GreatApp.
  6. Inside the APP/libraries folder, rename myAppMain to xyzGreatAppMain.
  7. Inside the APP/libraries/modules folder, rename mySysAdmin.lbs to xyzSysAdmin.lbs. The SyAdmin module contains the users and groups schemas plus other classes which you need for your StudioWorks app.
  8. Inside the APP/libraries/modules folder, delete all of the other libraries and the app_prefs.df1 file. None of these files are needed for creating your new app. All that should be left in the modules folder is the xyzSysAdmin.lbs library.
  9. Inside the APP/startupitems folder, delete the NewData.df1 file. This file contains the initial data which gets inserted into a new database.
  10. Inside the APP/data folder, delete the myAppData.df1 file.
  11. If you are going to use something other than an Omnis data file located inside the APP/data folder, you will need to modify the logon settings in the startupsettings.txt file. For more information see StudioWorks > Configuration > Startup Settings > Logon
  12. Open the open_GreatApp library. This opens the xyzGreatAppMain library, which in turn opens the libraries (currently just xyzSysAdmin) located in the APP/libraries/modules folder and the libraries at the first level in the APP/studioworks folder. The StudioWorks framework libraries are located inside the studioworks folder.
  13. All going well you will get to the Sign-In window.
  14. If you are using the Omnis data file you can create one as follows:
    1. Click the Change Session button.
    2. Select the OMNISSQLDAM session and click the Edit button.
    3. Click the orange file cabinet icon to the right side of the Host Name field. The tooltip on the button says 'Create a new Omnis data file.'
    4. Navigate to the APP/data/ folder and create a new data file called GreatApp.df1
    5. Click the Save button in the Session Manager toolbar.
    6. Close the Sessions Manager window.

  15. If you are using a different RDBMS you will need to create the new database using the RDBMS of your choice (MySQL, FrontBase, etc.). If the RDBMS requires users and passwords, I recommend that you create the user DBADMIN as the user who will own all of the tables in the database.

  16. Test logging onto the new database by clicking the Change Session button in the Sign-In window, then select the correct session, and click the Test button in the Sessions Manager toolbar. If you can't logon through the Session Manager, you won't be able to logon through the Sign-In window! Tinker with the session settings in the Session Manager until you can successfully test logon. Once you can Test logon, close the Sessions Manager window.

  17. In the Sign-In window enter user name: SYS and password: pass. Click the Sign-In button.

  18. StudioWorks will logon to the database, discover that there are no tables in the database and prompt you to make sure you want to syncn the new database to the application. Click Continue.

  19. All going well the database will be correctly synchronized and you will be prompted with instructions on what to do next.

  20. Click the Sign In button again. All going well the My App main menu will be installed and the main window will be opened.

  21. Close the main window.

  22. You will notice in the F2 Browser that the library names have not been changed. You will need to change the $defaultname of each renamed library to match the new file name.

  23. Select myAppMain in the F2 Browser > F6 Properties > Prefs tab. Change the $defaultname to xyzGreatAppMain. The library name in the F2 Browser won't change until you close and reopen the library.

  24. Change the xyzSysAdmin default name to xyzSysAdmin.

  25. F2 Browser > select myAppMain > open the schema class sMn_stb.

  26. Change the description for the AppName column from My App to Great App. StudioWorks will now translate AppName to Great App where ever AppName is uses as a string table ID.

  27. Change the column name myAppMain to xyzGreatAppMain.

  28. My App menu > select Close My App. This closes any libraries located in the APP/libraries/modules folder and the main library located in the APP/libraries folder.

  29. Reopen the app by double-clicking the open_GreatApp file. All going well the string tables will be reloaded so that after you sign-in you will see Great App as the main menu name. In the main menu, Close My App will have changed to Close Great App.

  30. If the text didn't change rebuild the string tables. Programmer Menu > Reload String Tables.

  31. Create your a fresh new module using Programmer Menu > Create New Module...

Okay, you've got a fresh new StudioWorks app ready to go. Enjoy!