NxFilter Tutorial

Directory structure and naming rule
The GUI layer of NxFilter is separated from its core part for easy customization.

We have an example GUI pack for customization. To find out more, read Sandwatch GUI pack for NxFilter


Naming rule for JSP files
The GUI layer of NxFilter is designed for easy customization. It is completely separated from its core part. And it has a naming convention corresponding to its menu structure so that you can find the file you need to modify easily. For example, if you want to modify 'Policy > Free Time' on NxFilter menu the file you need to edit is /nxfilter/webapps/policy,free_time.jsp.

In NxCloud's case, it has an operator specific menu. If a JSP file is for an operator specific menu then it has 'zop' prefix.

    ex) zop,policy,free_time.jsp


Structure of /nxfilter/webapps directory
We put all the JSP pages into /nxfilter/webapps and we don't use any subdirectory for keeping JSP pages. This is for simplicity. Everything you need to modify is in /nxfilter/webapps  directory. It has the following structure.

/nxfilter/webapps
- error
- example
- img
- include
- lib
- WEB-INF

In //webapps/error directory, we have the error pages for HTTP error codes. If you want to have an error page for a specific HTTP error code, you can define it in /webapps/WEB-INF/web.xml.

We use HTTP 404 error for special purpose. You shouldn't define any error page for HTTP 404 error.

In /nxfilter/webapps/example directory, we have some example JSP pages for custom login module.

In /nxfilter/webapps/img, we keep the image files for webpages.

In /nxfilter/webapps/include, we have common JSP files to be included into the other JSP files.

/include/lib.jsp is a common library file for all JSP files. It has some utility functions for web development and it executes the initialization code for JSP pages and does authentication checking as well.

In /nxfilter/webapps/lib, we have CSS and javascript files.

We have 'WEB-INF' since we use an embedded Tomcat as NxFilter's built-in webserver.


Separating your customized GUI into another directory

When you customize NxFilter GUI, it is not a good idea to modify the original files directly. It would be better to keep it for future reference and create another directory and copy all the files inside /nxfilter/webapps into the new directory and then modify these copied files. To make things easier, NxFilter supports 'www_dir' option on /nxfilter/conf/cfg.properties file.

When you have your own custom GUI in /nxfilter/myweb directory and you want to use it as the root directory of NxFilter's webserver, you need to add the following line into 'cfg.properties' file.

    www_dir = myweb

Then restart your NxFilter.