Home » Documentation » Extending » Extending the administration interface (Back Office)
In a Scensum solution the customer implementation will usually have the need to customize the administration user interface to change or add functionality needed to suit the current customer business model.
In order to facilitate upgrading it's recommended to do changes to existing functionality in a copy of the original code and instanciate the copy. This prevents accidental overwriting of changed functionallity.
Technology
The administrative interface is an asp.net 3.5 web application. Changing existing functionality would simply be a matter copying the aspx-file, rename and change the configuration file to instanciate the copy instead of the original, but you could just as well load a totally seperate file hosted on the same or other web server.
Back Office tab menu
The administrative interface accesses functionality via a horizontal tab menu with a main and a sub level. Each tab have attributes which control the look and behavior of the tab.
Configuration file
The file Navigation.xml in the root of the Back Office startup project controls which tabs are displayed in Back Office. This can be edited to add new tabs or change the existing ones.
XML
<?xml version="1.0"encoding="utf-8"?>
<root>
<tab name="Start" imageActivePath="~/Media/Images/MasterPage/start-item-active.gif"
imagePath="~/Media/Images/MasterPage/start-item.gif" />
<tab name="Assortment" caption="Assortment" >
<tab name="Products" caption="Products" isDefault="FALSE" securedBy="Assortment.Product" />
<tab name="Variations" caption="Variations" securedBy="Assortment.Variation" />
<tab name="RelationLists" caption="Relation lists" securedBy="Assortment.Relation" />
<tab name="Categories" caption="Categories" securedBy="Assortment.Category" />
<tab name="Pricelists" caption="Pricelists" securedBy="Assortment.Pricelist" />
</tab>
...
</root>
name
Is used for the path to the page. The link will point to "/[name]/Default.aspx" or if it's a sub tab "/[parent.name]/[name]/Default.aspx".
caption
The text displayed in the tab.
imagePath
Instead of using a text, it's possible to show an image in the tab instead. Specify the path to it with this attribute. (*)
imageActivePath
The image displayed when the tab is active. Activating a sub tab, automatically activates the corresponding main tab. (*)
securedBy
If a tab should be limited to users with a certain privilege, the privilege can be specified in this attribute. (**)
isDefault
If a sub tab should be page to go to when clicking the parent tab, set this to true.
hidden
Hides the tab. Can be used to temporarily hide a tab without removing it.
* This attribute is not applicable to the sub menu.
** Note that this attribute only hides the tab. The corresponing page also needs to implement user privilege validation to ensure that the page cannot be accessed directly via the url.
To change the order of the tabs in the GUI, just re-order them in the XML-file.
Ensure user privilege validation
To ensure user privilege validation the page added to the solution should inherit from Litium.Scensum.BackOffice.Controller.SecurePage. Extending the SecurePage will ensure that the user has signed in and validate the users access against the privilege defined in the Navigation.xml file. If the user has not logged in or does not have sufficient access the system will redirect to a custom error page.
Scensum Secure Page hierarchy
It's recommended (but not required) to implement one of Scensums page classes when adding functionality to Back Office. The following list displays different levels of support that a page can be implemented.
namespace Litium.Scensum.BackOffice.Controller
public abstract class StatePageController<T> : PageController
Abstract base page controller class for Scensum.BackOffice page controllers with typed access to ViewState. T would normally be ICustomer, IProduct or the type that the page will be administering.
public abstract class PageController : SecurePage
Abstract base page controller class for Scensum.BackOffice page controllers with framework for entity id, setup of event handlers and populating of form.
public class SecurePage : FileSystemStatePage
Authenticates Back Office users.
public class FileSystemStatePage : System.Web.UI.Page
Saves ViewState on disk. Performs ViewState file cleanup on application start.