Nasdanika application model provides model elements for building HTML applications such as static web sites, dynamic applications, and combinations of thereof.
Application models can be:
These approaches can be combined.
With Nasdanika App model user interface is constructed from actions organized in a hierarchy. Users activate actions to get results (action contents).
This approach allows developers to focus on the functionality of their application in terms of actions and select action placement in the UI and page styling/themes later. Changing of the action placement (e.g. from child to navigation or section) does not change the application functionality, just the appearance. It allows to adjust the application as it evolves. For example, an action of a documentation site might be in a section collection if it doesn’t have a lot of content and then can be moved to the children collection if it becomes large enough to be a page on its own.
In the UI an action goes through the following stages:
Section actions do not have activators and are displayed in the content panel of their parent action.
An application page is generated from 3 actions:
This section provides an overview of the page structure. You can hover over the diagram elements to see tooltips and click on the diagram elements to navigate to corresponding documentation sections. You may also hide/show diagram layers.
Displays the root action’s icon and text. Click on the icon/text activates the root action, if it has an activator.
Displays 1+ children of the root action - siblings of the principal action.
Displays the principal’s action icon and text. Click on the icon/text activates the principal action, if it as an activator.
Displays navigation actions of the principal action.
Displays children of the principal action. Navigation panels can display actions in several modes - list, tree, cards, cards with list or tree. Cards can be collapsible. This page uses collapsible cards with trees.
Displays content of the active action.
Containment path of the active action.
Icon and text of the active action.
Displays navigation actions of the active action. If a navigation action has children and no activator it is rendered as a drop-down. This also applies to the root, footer, and section navigation actions.
Displays leftNavigation
actions of the active action. Left navigation panel is displayed in a bootstrap column. It can be used to display, for example, a table of contents of the active action - the hierarchy of sections.
Displays floatLeftNavigation
actions of the active action. Left navigation panel is displayed in a div with float style. Similarly to the content left panel it can be used to display, for example, a table of contents of the active action - the hierarchy of sections.
Displays rightNavigation
actions of the active action. Right navigation panel is displayed in a bootstrap column. It can be used to display, for example, a list of useful links.
Displays floatRightNavigation
actions of the active action. Right navigation panel is displayed in a div with float style. Similarly to the content right panel it can be used to display, for example, a list of useful links.
Actions may have zero or more sections. Action may define how sections shall be displayed by specifying SectionStyle. Sections can be nested. A section is rendered in the same way as the active action, but without breadcrumb.
Icon and text of the section action.
Displays navigation actions of the section action.
Displays leftNavigation
actions of the section action. Left navigation panel is displayed in a bootstrap column.
Displays floatLeftNavigation
actions of the section action. Left navigation panel is displayed in a div with float style.
Displays rightNavigation
actions of the section action. Right navigation panel is displayed in a bootstrap column.
Displays floatRightNavigation
actions of the section action. Right navigation panel is displayed in a div with float style.
Displays navigation actions of the root action.
HTML pages are generated from actions by combining the action model with a page template. Example of a page template
Static sites are generated by traversing the action model and generating pages for action with location matching a specific condition, e.g. located under a specified output directory.
Static sites can be generated programmatically with SiteGenerator class and its subclasses.
There are also Site Generator Maven Plugins
This section explains how to create a dynamic web application with Nasdanika action models. The dynamic behavior approaches can be combined with each other and with static web site generation.
Server-side dynamic behavior can be implemented by creating a servlet or another type of Java HTTP request processor, e.g. a Spring RestController or Netty handler.
An action model can be generated or loaded from some resource and stored in HTTP session. Then individual pages would be generated on access.
The action model can be re-generated on specific events, e.g. user log-in/log-out or changes in data which affect the model content. If the action model is highly dynamic, it can be generated for every request instead of caching it in a session.
The dynamic part of a page (page content) can be injected via a context property. Some other options:
If the action model is constant and only the content panel shall be dynamic, then the server-side dynamic generation can be combined with static site generation: the static part would be hosted on a web server such as Apache HTTPD and dynamic requests would be forwarded to a servlet container.
Another option to introduce dynamic behavior is single page applications, e.g. built with:
search-documents.js
file used by a Vue applications.The client-side approach may be combined with the server-side approach - instead of application pages the server side would generate json responses used by the client side. Or it may generate both - an application page with a Vue/React application on it possibly parameterized during generation, and then json responses with data for the application. The server side may provide update endpoints for the single-page application as well.