Skip to content

Modeling

Introduction

You can find general information about the Virtual Developer Modeler by visiting its online documentation. The page you are looking at right now teaches you how a model’s elements affect the generated code. The generator JSF Web-Application processes models that are made with the DSLs Basic, UI and Product. It processes a subset of the DSLs’ modeling concepts. In the following sections all modeling concepts are mentioned, along with the information as to whether they are handled or not.

Main Modeling Concepts

This documentation presumes that you have already read the documentation about how to model the input for the generator JSF Web-Fragment. So, the web pages that have been modeled and generated and are now part of web fragments now have to be brought together and assembled in a web application. That’s the focus of what you are currently reading.

Concept/Keyword DSL Description
application-ui Product defines a web application and lets you assign capabilities and UI modules to it

The following model

application-ui MyApplication {
    link Capabilities = MyCapability1, MyCapability2;

    link UiModules = MyUiModule1FromCap1, MyUiModule1FromCap2;
}

You have to reference at least one capability in order to include that capability’s web pages in your web application. If you only set the option Capabilities and ommit UiModules, then you will automatically be able to use all web pages that are contained in the linked capabilities. Then, if you want to choose only a subset of a capability’s web pages to be part of your web application, you need to set the UiModules option.

For every capability you get a file App[capability-Name]FeatureCustomization.java generated, where you can de-/activate features in your web application. Those features are defined in the capability part of the model. You find more information about features in the Feature Toggles section.

Similarly, you get many Java files generated that have names that start with App. All of those files are here to customize web pages in the context of a concrete web application. Their purpose is described in these documentations:

One of the most important ones is AppLayoutCustomizationBean.java. In that file you amongst others write code to define which parts of the web pages to display, which XHTML files to use for showing a menu, which template to use (PrimeFaces Premium Layout California for instance).

Please have a look at the documentation that describes the web page structure and content customization to learn more about the functioning of AppLayoutCustomizationBean.java.

Excluded Web Pages and XHTML Files

A capability can include more than one web page. In such a case you might only want to use a subset of those web pages. But how would you prevent the other, unwanted web pages from being opened? They are contained in the jar file that gets build for a web fragment. Here comes the generated file HiddenXhtmlFilesFilter.java to the rescue. It is a servlet filter for the servlet with the name Faces Servlet. Its implementation checks the incoming request URI to find out, whether it tries to reach an XHTML file that should not be made available. If it identifies such a request, it simply returns an HTTP status code 404 (‘Not Found’).

Customizable Internationalization

There are some .properties files generated for a modeled application. Their workings is documented in the Internationlization feature description.

Customizable Styling

There are a few file generated that are related to styling tasks. They are documented in the Styling feature description.

Home Page of the Application

The two generated files index.html and index.xhtml can be used to easiliy test out whether the WAR file that is deployed for a web application works fine. These two URLs should work once the WAR file is successfully deployed on your local application server (in case it uses port 8080):

The file index.html is of now real use for your web application. It is just there to test the availability of your web application. The file index.xhtml is important, though. In here you define the home page of your web application, by redirecting to it. The web application runtime framework, all generated code and all manually written code that wants to open a web application’s homepage navigate to index.xhtml when they want to go to the application’s home page.