<?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="admin" extends="adminAuxiliary">

         <action name="connectionRequest" class="connectionRequestAction">
             <result name="success" type="stream">
                <param name="contentType">text/html</param>
                <param name="inputName">result</param>
             </result>
             <result name="error" type="stream">
                <param name="contentType">text/html</param>
                <param name="inputName">result</param>
            </result>
         </action>

         <action name="viewServerSecurity"  class="viewServerSecurityAction" method="view">
             <result name="success" type="tiles" >admin.server.security.view</result>
              <result name="error" type="redirect" >error.action</result>
         </action>

         <action name="changeServer"   class="viewServerSecurityAction"   method="change">
             <result name="success" type="redirect">viewServerSecurity.action</result>
             <result name="input"  type="chain">viewServerSecurity</result>
             <result name="error" type="redirect" >error.action</result>
         </action>

         <action name="adminNetworks"  class="adminNetworksAction" method="view">
             <result name="success" type="tiles" >admin.networks.view</result>
              <result name="error" type="redirect" >error.action</result>
         </action>

         <action name="addNewNetwork" class="addNewNetworkAction" >
             <result name="success" type="stream">
                <param name="contentType">text/html</param>
                <param name="inputName">result</param>
             </result>
             <result name="error" type="stream">
                <param name="contentType">text/html</param>
                <param name="inputName">result</param>
            </result>
             <!--<result name="error" type="redirect" >error.action</result>-->
         </action>

         <action name="viewUploadFile" class="viewFwUploadFileAction">
             <result name="success" type="tiles" >admin.fw.upload.view</result>
             <result name="error" type="redirect" >error.action</result>
         </action>

         <action name="uploadFile" class="uploadFileAction">
              <result name="success" type="redirect" >viewUploadFile.action</result>
              <result name="error" type="redirect" >error.action</result>
              <result name="input"  type="redirect">viewUploadFile.action</result>
         </action>

         <action name="viewFwUpgrade" class="viewFwUpgradeAction">
             <result name="success" type="tiles" >admin.fwUpgrade.view</result>
             <result name="error" type="redirect" >error.action</result>
         </action>


         <action name="fwUpgrade" class="fwUpgradeAction" >
            <result name="success" type="stream">
                <param name="contentType">text/html</param>
                <param name="inputName">result</param>
            </result>
             <result name="error" type="stream">
                <param name="contentType">text/html</param>
                <param name="inputName">result</param>
            </result>
        </action>




        <action name="adminUsers" class="adminUsersAction" method="view" >
             <result name="success" type="tiles">admin.users.view</result>
             <result name="error" type="redirect" >error.action</result>
        </action>

        <action name="removeUser" class="removeUserAction">
             <result name="input" type="tiles">admin.users.view</result>
             <result name="error" type="redirect">error.action</result>
             <result name="success" type="tiles">admin.users.view</result>
        </action>



        <action name="configView" >
           <result name="success" type="tiles">admin.config.view</result>
           <result name="error" type="redirect">error.action</result>
        </action>

        <action name="setDefaultParams" class="setDefaultParamsAction" >
             <result name="success" type="tiles">defaultParams.set</result>
             <result name="error" type="redirect">error.action</result>
         </action>

       <action name="settings" class="settingsAction" method="view">
           <result name="success" type="tiles">admin.settings.view</result>
           <result name="error" type="redirect">error.action</result>
       </action>





       <action name="selectParamsForUser" class="selectParamsForUser" method="selectParamsForUser">
               <result name="success" type="redirect">settings.action</result>
               <result name="error" type="redirect">error.action</result>
       </action>

       <action name="viewModelsByType" class="viewModelsByTypeAction">
           <result name="success" type="tiles">admin.model.view</result>
           <result name="error" type="redirect">error.action</result>
       </action>


         <action name="unknownUser" class="viewUnknovns" method="viewUnknownUsers">
            <result name="success" type="tiles" >admin.unknown</result>
            <result name="error" type="redirect">error.action</result>
        </action>

        <action name="notInGlossary" class="viewUnknovns" method="viewNotInGlossary">
            <result name="success" type="tiles" >admin.unknown</result>
            <result name="error" type="redirect">error.action</result>
        </action>

        <action name="viewModelsByManufacturer" class="viewModelsByManufacturerAction">
            <result name="success" type="tiles">admin.model.view</result>
            <result name="error" type="redirect">error.action</result>
        </action>

        <action name="viewAllModels" class="viewAllModelsAction" >
            <result name="success" type="tiles">admin.model.view</result>
            <result name="error" type="redirect">error.action</result>
        </action>

         <action name="profileViewAdmin" >
            <result name="success" type="tiles">profile.view</result>
            <result name="error" type="redirect">error.action</result>
        </action>

         <action name="profileEditAdmin">
             <result name="success" type="tiles">profile.edit</result>
             <result name="error" type="redirect">error.action</result>
         </action>



         <action name="addNewModel" class="addNewModel" method="view">
             <result name="success" type="tiles">addModel.view</result>
             <result name="error" type="redirect">error.action</result>
         </action>

         <action name="saveNewModel"  class="addNewModel" method="saveNewModel">
            <result name="success" type="stream">
                <param name="contentType">text/html</param>
                <param name="inputName">result</param>
            </result>
         </action>

         <action name="setDefault" class="setDefaultAction">
            <result name="success" type="stream">
                <param name="contentType">text/html</param>
                <param name="inputName">result</param>
            </result>
            <result name="error" type="stream">
                <param name="contentType">text/html</param>
                <param name="inputName">result</param>
            </result>
        </action>

        <action name="viewConfigs" class="viewConfigsAction" method="packagesList">
             <result name="success" type="tiles">config.view</result>
             <result name="error" type="redirect">error.action</result>
        </action>

        <action name="viewConfigFoldersContent"    class="viewConfigsAction">
             <result name="success" >pages/admin/configFiles.jsp</result>
             <result name="no_config_file">pages/admin/no_configFiles.jsp</result>
             <result name="error" type="redirect">error.action</result>
        </action>

       <action name="readFile" class="readFileAction">
             <result name="success" type="stream">
                  <param name="contentType">application/octet-stream</param>
                  <param name="inputName">fileInputStream</param>
                  <param name="contentDisposition">attachment;filename=${fileName}</param>
                  <param name="bufferSize">1024</param>
             </result>
         </action>

         <action name="sendUpload" class="sendUploadAction">
            <result name="success" type="stream">
                <param name="contentType">text/html</param>
                <param name="inputName">result</param>
            </result>
            <result name="error" type="stream">
                <param name="contentType">text/html</param>
                <param name="inputName">result</param>
            </result>
         </action>

         <action name="saveConfigFiles" class="viewConfigsAction" method="saveNewConfigs" >
              <result name="success" type="redirect" >viewConfigs.action</result>
              <result name="error" type="redirect">error.action</result>
         </action>

         <action name="uploadConfigFiles" class="uploadConfigFilesAction">

             <result name="success" type="stream">
                <param name="contentType">text/html</param>
                <param name="inputName">result</param>
            </result>
             <result name="error" type="stream">
                <param name="contentType">text/html</param>
                <param name="inputName">result</param>
            </result>

         </action>
    </package>
    <package name="adminJson" extends="json-default" >


         <action name="saveChangesInFile" class="saveChangesInFileAction">
                <result name="success" type="stream">
                <param name="contentType">text/html</param>
                <param name="inputName">result</param>
            </result>
             <result name="error" type="stream">
                <param name="contentType">text/html</param>
                <param name="inputName">result</param>
            </result>

         </action>



         <action name="removeNetwork" class="removeNetworkAction">
             <result type="json" />
         </action>

        <action name="checkDb" class="checkDbAction">
            <result type="json" />
        </action>

        <action name="checkServerStatus" class="checkServerStatusAction" method="checkServer">
            <result type="json" />
        </action>

        <action name="addNewUser" class="RegistrationAction" method="register" >
            <result type="json" />
        </action>


        <action name="startServer" class="startServer" method="start">
            <result name="success" type="stream">
                <param name="contentType">text/html</param>
                <param name="inputName">result</param>
            </result>
             <result name="error" type="stream">
                <param name="contentType">text/html</param>
                <param name="inputName">result</param>
            </result>
        </action>

        <action name="stopServer" class="startServer" method="stop">
            <result name="success" type="stream">
                <param name="contentType">text/html</param>
                <param name="inputName">result</param>
            </result>
             <result name="error" type="stream">
                <param name="contentType">text/html</param>
                <param name="inputName">result</param>
            </result>
        </action>

    </package>

</struts>