<!DOCTYPE xwork PUBLIC "-//OpenSymphony Group//XWork 1.1.1//EN" "http://www.opensymphony.com/xwork/xwork-1.1.1.dtd">

<xwork>
    <include file="webwork-default.xml"/>
    
    <package name="common" extends="webwork-default">
    	<result-types>
			<result-type name="freemarker" default="true"
				class="com.opensymphony.webwork.views.freemarker.FreemarkerResult"/>
		</result-types>
    </package>  

    <package name="default" extends="common">
    
        <interceptors>
 			<interceptor name="userSession" class="com.ntsky.bbs.web.webwork.interceptor.UserInterceptor" />  
 			<interceptor name="commonStack" class="com.ntsky.bbs.web.webwork.interceptor.GlobalInterceptor" />  
 			<interceptor name="permission" class="com.ntsky.bbs.web.webwork.interceptor.PermissionInterceptor" />  

            <interceptor-stack name="basicStack">            	
                <interceptor-ref name="exception"/>
                <interceptor-ref name="servlet-config"/>
                <interceptor-ref name="prepare"/>
                <interceptor-ref name="static-params"/>
                <interceptor-ref name="params"/>
                <interceptor-ref name="conversionError"/>
            </interceptor-stack>        
         
            <interceptor-stack name="defaultStack">
                <interceptor-ref name="exception"/>
                <interceptor-ref name="alias"/>
                <interceptor-ref name="servlet-config"/>
                <interceptor-ref name="prepare"/>
                <!-- <interceptor-ref name="i18n"/>
                <interceptor-ref name="chain"/> -->
                <interceptor-ref name="model-driven"/>
                <interceptor-ref name="static-params"/>
                <interceptor-ref name="params"/>
                <interceptor-ref name="conversionError"/>
                <interceptor-ref name="validation">
                    <param name="excludeMethods">input,back,cancel</param>
                </interceptor-ref>
                <interceptor-ref name="workflow">
                    <param name="excludeMethods">input,back,cancel</param>
                </interceptor-ref>
            </interceptor-stack>
        </interceptors>   
		
		<global-results>
			<!-- common -->
			<result name="login">/login.ftl</result>
			<result name="noLogin">/common/noLogin.ftl</result>
			<result name="info">/common/info.ftl</result>
			<result name="warn">/common/warn.ftl</result>
			<result name="success">/common/success.ftl</result>
			<result name="noPermission">/common/noPermission.ftl</result>
            <result name="exception">/common/exception.ftl</result>
            
            <!-- special function -->
            <result name="global_lawless" type="dispatcher">/global_lawless.jsp</result>
            <result name="global_webclosed" type="dispatcher">/global_webclosed.jsp</result>
            
		</global-results>
		
        <global-exception-mappings>
            <exception-mapping exception="java.sql.SQLException" result="sqlException"/>
            <exception-mapping exception="com.ntsky.bbs.exception.ActionException" result="exception"/>
        </global-exception-mappings>

		<!-- /++++++++++ view +++++++++ -->
		<action name="index"
				class="com.ntsky.bbs.web.webwork.action.view.IndexAction">
			<interceptor-ref name="commonStack"/>
			<interceptor-ref name="basicStack"/>
			<result name="success">/index.ftl</result>
		</action>
		<action name="menu"
				class="com.ntsky.bbs.web.webwork.action.view.MenuAction">
			<interceptor-ref name="commonStack"/>
			<interceptor-ref name="basicStack"/>
			<result name="success">/menu.ftl</result>
		</action>
		<!-- ++++++++++ View +++++++++/ -->

		
		<action name="masterPanel"
				class="com.ntsky.bbs.web.webwork.action.view.MasterPanelAction">
			<interceptor-ref name="commonStack"/>
			<interceptor-ref name="userSession"/>
			<interceptor-ref name="basicStack"/>
			<result name="success">/masterPanel.ftl</result>
		</action>	
	
		<!-- /++++++++++ Poll +++++++++ -->
		<action name="hidden-vote"
				class="com.ntsky.bbs.web.webwork.action.poll.VoteAction">
			<interceptor-ref name="commonStack"/>
			<interceptor-ref name="userSession"/>
			<interceptor-ref name="basicStack"/>
			<result name="success">/hiddenPoll.ftl</result>
		</action>
		<!-- ++++++++++ Poll +++++++++/ -->	
		
		<!-- /++++++++++ OnlineUser +++++++++ -->
		<action name="onlineUsers"
				class="com.ntsky.bbs.web.webwork.action.view.OnlineUsersAction">
			<interceptor-ref name="commonStack"/>
			<interceptor-ref name="userSession"/>
			<interceptor-ref name="basicStack"/>
			<result name="success">/onlineUsers.ftl</result>
		</action>
		<!-- ++++++++++ OnlineUser +++++++++/ -->			
		
	</package>

    <package name="admin" extends="common" namespace="/admin">
    
        <interceptors>
			<interceptor name="adminSession" class="com.ntsky.bbs.web.webwork.interceptor.AdminInterceptor" />
			<interceptor name="validity" class="com.ntsky.bbs.web.webwork.interceptor.ValidityInterceptor" />
            <interceptor-stack name="adminBasicStack">
            	<interceptor-ref name="adminSession"/>
                <interceptor-ref name="basicStack"/>
            </interceptor-stack>   
   			<interceptor-stack name="adminDefaultStack">
   				<interceptor-ref name="adminSession"/>
                <interceptor-ref name="defaultStack"/>
            </interceptor-stack>   
        </interceptors>  

		<global-results>
			<result name="login">/admin/login.jsp</result>
			<result name="error">/common/error.html</result>
			<result name="noPermission">/common/noPermission.html</result>
			<result name="lawless">/common/lawless.html</result>						
		</global-results>

        <global-exception-mappings>
            <exception-mapping exception="java.sql.SQLException" result="sqlException"/>
            <exception-mapping exception="com.ntsky.bbs.exception.ActionException" result="exception"/>
        </global-exception-mappings>
        
        <action name="index"
			class="com.opensymphony.xwork.ActionSupport">
			<result name="success" type="freemarker">/admin/index.jsp</result>
		</action>
        
	</package>

	<include file="xwork_forum.xml"/>
	<include file="xwork_user.xml"/>
	<include file="xwork_manage.xml"/>
	<include file="xwork_admin.xml"/>
	<include file="xwork_common.xml"/>	
	<include file="xwork_config.xml"/>		
	<include file="xwork_service.xml"/>

	<package name="install" extends="admin" namespace="/install">
		<action name="popup-validateUnSaveMail" class="com.ntsky.bbs.web.webwork.action.install.ValidateEmailAction" method="checkUnSave">
			<interceptor-ref name="adminDefaultStack"/>
			<result name="success">/common/test-popup.ftl</result>														
			<result name="warn">/common/test-popup.ftl</result>												
		</action>			
	</package>

</xwork>
