Atomia Web Frame


25 views 0

Questions related to SDK helpers

What is the scope of the LocalResource html helper, i.e. can I use it to fetch the local resources from some other controller?

The LocalResources html helper can be used to fetch the local resources from all the actions of the current controller. If you want to use the resources from some other controller from the same or other plugin, these resources should be declared as global and moved to theApp_GlobalResources folder. After moving, the GlobalResources html helper should be used instead.

Questions related to themes

How can I use my own View Engine instead of the ThemeViewEngine?

If the developer wants to use his own View Engine instead of the ThemeViewEngine, he/she should register it in the Application_Start method of the IGlobalEventsHandlerProvider interface implementer. For instance, if a developer’s view engine is named ComplexViewEngine, the Application_Start method should look like this:

protected void Application_Start()
base.Application_Start(sender, e);
ViewEngines.Engines.Add(new ComplexViewEngine());

Can I change the skin (theme) without changing the configuration file?

Yes, Atomia Web Frame has built-in support for dynamically switching themes. This is done by adding the theme={theme_name} to the URL’s query string (any URL of the Web application based on the Atomia Web Frame).

For example, “http://localhost:52143/DemoPlugin?theme=Blue” will set the theme named Blue to the currently active theme in the Web application.

Questions related to routing

Why implement Route areas through the config file of the application?

The main reason for this is to be able to specify the order of the routing areas and routes which belong to them – this order could not be determined if there was a class in each of the plugin which implements the AreaRegistration class, as suggested in the official ASP.NET MVC 2 document. Furthermore, it was not possible to put the routing areas definition in the plugin configuration files, since the plugin developer himself does not know the current order of the routing area in the application, so he/she would not be able to specify the order while developing the plugin through the config file.

Does Atomia Web Frame have some built-in routing areas?

No, there are no built-in routing areas in Atomia Web Frame. However, the config file of the application must have at least one routing area defined.

Questions related to action interceptor

I want to have two pre-interceptor and one post-interceptor for some action. How should I configure the actionInterceptorList configuration element?

The following example shows the proper way of configuring the multiple action interceptors for one action:

<routeData area="Demo" controller="Mysql" action="Add" preAction="true" httpMethod="POST">
<actionInterceptor type="Atomia.Web.Frame.Enterprise.Plugin.Controllers.MysqlController, Atomia.Web.Frame.Enterprise.Plugin" method="Add" order="1" />
<actionInterceptor type="Atomia.Web.Frame.Enterprise.Plugin.Controllers.MysqlController, Atomia.Web.Frame.Enterprise.Plugin" method="Manage" order="2" />
<routeData area="Demo" controller="Mysql" action="Add" preAction="false" httpMethod="POST">
<actionInterceptor type="Atomia.Web.Frame.Enterprise.Plugin.Controllers.MysqlController, Atomia.Web.Frame.Enterprise.Plugin" method="Finalize" order="1" />

This way, the Add action of the Mysql controller from the Demo routing area will be pre-intercepted with methods Add and Manage from the Atomia.Web.Frame.Enterprise.Plugin.Controllers.MysqlController class and post-intercepted with the Finalize method from the same class. Of course, these interceptor actions do not need to belong to the same controller, assembly or plugin.

Ok, so which view will be rendered in this situation?

The view that will be rendered is determined by the type of result which interceptor actions return, in the following way:

  1. The Atomia Web Frame checks if there’s any action interceptor that return the ActionResult type of result
  2. If there’s such action, the post-interceptors have the bigger priority than the pre-interceptors, and those with higher order have the bigger priority than the ones with the lower order.
  3. If there’s no such action, then the ActionResult from the original(intercepted) action will be rendered/invoked

This means that if the Finalize method returns the result of ActionResult type, it will be rendered, no matter what the pre-interceptors or original action return; the next in order is pre-interceptor Manage (due to higher order), then the pre-interceptor Add and finally the original action.

Questions related to configuration

How to allow cookieless sessions in Atomia?

The ASP.NET MVC feature cookieless session is vulnerable to the reflected XSS attack. Cookieless sessions are disabled in Atomia applications. The HTTP requests with a cookieless session are blocked. If you want to allow using cookieless sessions, you need to set AllowCookielessSessions = true in the Web.config files for Admin panel, Billing Customer Panel and Hosting Control Panel applications. The easiest way to enable it for all three applications is to add AllowCookielessSessions = true in the unattended.ini under the section [General].

Was this helpful?