<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE struts PUBLIC
        "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
        "http://struts.apache.org/dtds/struts-2.0.dtd">

<struts>

    <package name="generalMain" extends="generalMainAuxiliary">


        <action name="error">
            <result>/pages/error/error.jsp</result>
        </action>

        <action name="ajaxError">
            <result>/pages/error/ajaxerror.jsp</result>
        </action>

        <action name="globalError">
            <result>/pages/error/globalError.jsp</result>
        </action>

        <action name="main" class="mainAction" method="view">
            <result name="success" type="tiles">main.view</result>
        </action>

        <action name="login" class="loginAction">
            <result name="success" type="redirect">authentication.action</result>
            <result name="input" type="tiles">main.view</result>
            <result name="error" type="redirect">error.action</result>
        </action>

        <action name="authentication" class="authenticationAction" method="authenticate">
            <result name="administrator" type="tiles">admin.view</result>
            <result name="operator" type="tiles">operator.view</result>
            <result name="login" type="redirect">main.action</result>
        </action>

        <action name="viewDevices" class="viewDevicesAction">
            <result name="success">/pages/devices.jsp</result>
            <result name="error" type="redirect">ajaxError.action</result>
            <result name="no_device">/pages/no-device.jsp</result>
            <result name="ajax_login" type="redirect">/empty.jsp</result>
        </action>

        <action name="viewUserInfo" class="viewUserInfoAction" method="view">
            <result name="success">/pages/userInfo.jsp</result>
            <result name="error" type="redirect">error.action</result>
            <result name="ajax_login" type="redirect">/empty.jsp</result>
        </action>

        <action name="adminUsersView" class="adminUsersViewAction" method="view">
            <result name="success">/pages/users.jsp</result>
            <result name="error" type="redirect">ajaxError.action</result>
            <result name="ajax_login" type="redirect">/empty.jsp</result>
        </action>

        <action name="viewDeviceInfo" class="viewDeviceInfoAction">
            <result name="success">/pages/deviceInfo.jsp</result>
            <result name="no_info">/pages/no-info.jsp</result>
            <result name="error" type="redirect">ajaxError.action</result>
            <result name="ajax_login" type="redirect">/empty.jsp</result>
        </action>

        <action name="viewParams" class="viewModelParamsAction">
            <result name="success">pages/admin/paramsList.jsp</result>
            <result name="error" type="redirect">error.action</result>
            <result name="ajax_login" type="redirect">/empty.jsp</result>
        </action>

        <action name="viewModelParams" class="viewModelParamsAction">
            <result name="success">pages/admin/newModelParams.jsp</result>
            <result name="error" type="redirect">error.action</result>
            <result name="ajax_login" type="redirect">/empty.jsp</result>
        </action>

        <action name="getDevicesByModel" class="getDevicesByModelAction">
            <result name="success">pages/admin/modelDevices.jsp</result>
            <result name="ajax_login" type="redirect">/empty.jsp</result>
        </action>

        <action name="viewNetworks" class="viewNetworksAction">
            <result name="success">/pages/networks.jsp</result>
            <result name="error" type="redirect">ajaxError.action</result>
            <result name="ajax_login" type="redirect">/empty.jsp</result>
        </action>

        <action name="searchDevicesBySubscriber" class="searchDevicesBySubscriberAction">
            <result name="success">/pages/devices.jsp</result>
            <result name="error" type="redirect">ajaxError.action</result>
            <result name="no_device">/pages/no-device.jsp</result>
            <result name="ajax_login" type="redirect">/empty.jsp</result>
        </action>

        <action name="searchDevicesBySerial" class="searchDevicesAction">
            <result name="success">/pages/devices.jsp</result>
            <result name="error" type="redirect">ajaxError.action</result>
            <result name="no_device">/pages/no-device.jsp</result>
            <result name="ajax_login" type="redirect">/empty.jsp</result>
        </action>

        <action name="getSubMenusManufacturer" class="getSubMenusAction" method="selectManufacturers">
            <result name="success">pages/admin/sub_menus_manufacturer.jsp</result>
            <result name="error" type="redirect">ajaxError.action</result>
            <result name="ajax_login" type="redirect">/empty.jsp</result>
        </action>

        <action name="getSubMenusTypeCPE" class="getSubMenusAction" method="selectTypesCPE">
            <result name="success">pages/admin/sub_menus_device_type.jsp</result>
            <result name="error" type="redirect">ajaxError.action</result>
            <result name="ajax_login" type="redirect">/empty.jsp</result>
        </action>

        <action name="activate" class="activateAction">
            <result name="success" type="tiles">main.view</result>
            <result name="error" type="redirect">error.action</result>
        </action>

         <action name="forgotPassword">
             <result name="success" type="tiles">forgot.view</result>
         </action>

         <action name="changeForgotPassword"  class="changePassword"  method="checkCode">
             <result name="success" type="tiles">changepass.view</result>
             <result name="error" type="redirect">error.action</result>
         </action>

         <action name="sendMailToChangePassword" class="changePassword" method="sendMail">
             <result name="success" type="stream">
                <param name="contentType">text/html</param>
                <param name="inputName">result</param>
             </result>
         </action>
    </package>

</struts>