# Creating a WebUI¶

Here you can find a summary of the steps to be taken for creating a WebUI for your AIMMS app:

1. Check the Requirements section.
3. Make sure you have the latest version of preferably the Chrome browser (as it performs the best), or Microsoft’s Internet Explorer 11 or Edge.
4. In the AIMMS development system, open an existing application or create a new one.
5. New application projects contain the AimmsPROLibrary and the AimmsWebUI system libraries by default. If you already have an older project, it might not contain these libraries, yet. In that case, you need to extend your model with these libraries. To add AIMMS libraries to your model: go to the Library Manager of AIMMS (in the File menu) and select Add System Library.
6. Start WebUI by clicking on WebUI in the AIMMS toolbar, or by using the WebUI (sub)menu in the AIMMS Tools menu. The first time, this will create a WebUI folder in your Main Project subfolder. When using Start WebUI, the WebUI is started without opening a browser. When you select one of the browsers, WebUI is started and the browser is opened at the home page of your app.
7. Now you can start adding widgets and adding pages to your WebUI. Once you are done, you can publish your app on AIMMS PRO.

Note

There is a known problem with Internet Explorer 11: if you face a blue screen after starting your WebUI app in the browser, you should verify that the setting “Display Intranet Sites in Compatibility View” is set to unchecked. You can find this option under “Compatibility View Options” in the main menu of IE11.

# Public Identifiers¶

To be able to control what identifiers are visible to the WebUI (e.g. when selecting the contents for a widget), you can extend your AIMMS model with a set called AllPublicIdentifiers (in the global Main namespace of your app). This set should be a subset of the predefined set AllIdentifiers and should be initialized with those identifiers which you want to make public to the WebUI.

When running in development mode, the contents of this set is ignored. This means that you can simply see all identifiers declared in your model from within the WebUI which you are building. When deploying your finished WebUI application on AIMMS PRO, only the identifiers which are in the set AllPublicIdentifiers are available to end users who try to add or modify contents of the existing widgets in the app. However, if you, as an app developer, have created widgets containing identifiers not present in the AllPublicIdentifiers set, the end-user is, of course, still able to see the data of these identifiers through these widgets.

As a result of the way of working described above, if the set AllPublicIdentifiers is declared in your model but is empty, then all identifiers are available to the WebUI app developer when in developer mode, but no identifiers are available to the end user when running the WebUI app on the PRO platform (i.e. if the end user tries to add or modify contents in existing widgets). In such a case, the end user may only use the existing widgets with the content identifiers set initially by the app developer.

If the set AllPublicIdentifiers is not declared, then all the identifiers in your model are available in both developer mode and the app published on PRO.

## Identifiers in a Library¶

To be able to show data for identifiers that are declared in an AIMMS library, you need to make those identifiers public by putting them in the Interface attribute of the library. The corresponding index domain sets need to be present in the library interface too. Please remember to add them to the set AllPublicIdentifiers, if you have specified this set in your model.

One may wonder why should the corresponding index domain sets be present in the library interface? The reason is that these index domain sets are used to display aggregated values (by pivoting/moving indices to the Aggregated group) in a widget. More precisely, AIMMS creates runtime identifiers in order to calculate these aggregated values (such as totals). To be able to evaluate the definitions of these runtime identifiers, the domain indices of the identifier need to be accessible too.

When adding project-specific translations to your WebUI project and (some of) the translation identifiers are located in a library, please make sure to include the library prefixes to the .properties translation file.