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

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

<struts-config>

<!-- ================================================ Form Bean Definitions -->

    <form-beans>
        <form-bean name="selectTaskForm" type="net.yher.workstyle.action.task.SelectForm" />
        <form-bean name="selectFileForm" type="net.yher.workstyle.action.SelectFileForm" />
        <form-bean name="selectTagForm" type="net.yher.workstyle.action.tag.SelectForm" />
        <form-bean name="selectTagTypeForm" type="net.yher.workstyle.action.tagType.SelectForm" />
        
        <form-bean name="selectTaskTagForm" type="net.yher.workstyle.action.task.SelectTagForm" />
        <form-bean name="searchTaskForm" type="net.yher.workstyle.action.task.SearchForm" />
        <form-bean name="searchUnlinkedTaskForm" type="net.yher.workstyle.action.task.SearchUnlinkedTaskForm" />
        <form-bean name="addTaskForm" type="net.yher.workstyle.action.task.AddForm" />
        <form-bean name="addFileForm" type="net.yher.workstyle.action.task.AddFileForm" />

        <form-bean name="changeTaskStatusForm" type="net.yher.workstyle.action.task.rest.ChangeStatusForm" />
        <form-bean name="addCommentForm" type="net.yher.workstyle.action.task.rest.AddCommentForm" />
        <form-bean name="addLinkedTaskForm" type="net.yher.workstyle.action.task.rest.AddLinkedTaskForm" />
        <form-bean name="editTaskContentsForm" type="net.yher.workstyle.action.task.rest.EditContentsForm" />
        <form-bean name="editTaskEstimatedManHourForm" type="net.yher.workstyle.action.task.rest.EditEstimatedManHourForm" />
        <form-bean name="editTaskTagListForm" type="net.yher.workstyle.action.task.rest.EditTagListForm" />
        <form-bean name="linkForm" type="net.yher.workstyle.action.task.rest.LinkForm" />

        <form-bean name="changeTagTypeForm" type="net.yher.workstyle.action.tag.rest.ChangeTypeForm" />
        <form-bean name="addTagForm" type="net.yher.workstyle.action.tag.rest.AddForm" />

        <form-bean name="addTagTypeForm" type="net.yher.workstyle.action.tagType.rest.AddForm" />
        <form-bean name="editTagTypeForm" type="net.yher.workstyle.action.tagType.rest.EditForm" />
        <form-bean name="changeTagTypeStyleForm" type="net.yher.workstyle.action.tagType.rest.ChangeStyleForm" />
    </form-beans>


<!-- ========================================= Global Exception Definitions -->

    <global-exceptions>
        <!-- sample exception handler
        <exception
            key="expired.password"
            type="app.ExpiredPasswordException"
            path="/changePassword.jsp"/>
        end sample -->
    </global-exceptions>


<!-- =========================================== Global Forward Definitions -->

    <global-forwards>
        <!-- Default forward to "Welcome" action -->
        <!-- Demonstrates using index.jsp to forward -->
<!-- 
        <forward
            name="welcome"
            path="/Welcome.do"/>
 -->
    </global-forwards>


<!-- =========================================== Action Mapping Definitions -->

    <action-mappings>
		<!-- ======================================= -->
		<!-- ATOM									 -->
		<!-- ======================================= -->
<!--
		<action
			path="/atom/searchLatest"
			type="net.yher.workstyle.action.task.SearchLatestAction"
			name="searchTaskForm"
			scope="request"
			validate="false">
			<forward name="success"	path="/atom0.3.vxml"/>
		</action>
-->
		<!-- ======================================= -->
		<!-- HTML									 -->
		<!-- ======================================= -->
		<action
			path="/search"
			type="net.yher.workstyle.action.task.SearchAction"
			name="searchTaskForm"
			scope="request"
			validate="false"
			input="/TaskList.vhtml">
			<forward name="success"	path="/TaskList.vhtml"/>
		</action>
		<action
			path="/searchUnlinkedTask"
			type="net.yher.workstyle.action.task.SearchUnlinkedTaskAction"
			name="searchUnlinkedTaskForm"
			scope="request"
			validate="false"
			input="/UnlinkedTaskList.vhtml">
			<forward name="success"	path="/UnlinkedTaskList.vhtml"/>
		</action>
		<action
			path="/openAddForm"
			type="org.apache.struts.actions.ForwardAction"
			name="addTaskForm"
			scope="request"
			validate="false"
			parameter="/SimpleTaskForm.vhtml"/>
		<action
			path="/add"
			type="net.yher.workstyle.action.task.AddAction"
			name="addTaskForm"
			scope="request"
			validate="true"
			input="/SimpleTaskForm.vhtml">
			<forward name="success"	path="/ForwardTaskDetail.vhtml"/>
		</action>
<!--
		<action
			path="/view"
			type="net.yher.workstyle.action.task.ViewTaskAction"
			name="selectTaskForm"
			scope="request"
			validate="true"
			input="/TaskDetail.vhtml">
			<forward name="success"	path="/TaskDetail.vhtml"/>
		</action>
-->
		<action
			path="/downloadFile"
			type="net.yher.workstyle.action.DownloadFileAction"
			name="selectFileForm"
			scope="request"
			validate="true"
			input="/TaskDetail.vhtml">
		</action>
		<action
			path="/addFile"
			type="net.yher.workstyle.action.task.AddFileAction"
			name="addFileForm"
			scope="request"
			validate="true"
			input="/TaskDetail.vhtml">
			<forward name="success"	path="/TaskDetail.vhtml"/>
		</action>
		<action
			path="/addTag"
			type="net.yher.workstyle.action.task.AddTagAction"
			name="selectTaskTagForm"
			scope="request"
			validate="true"
			input="/TaskDetail.vhtml">
			<forward name="success"	path="/TaskDetail.vhtml"/>
		</action>
		<action
			path="/deleteTag"
			type="net.yher.workstyle.action.task.DeleteTagAction"
			name="selectTaskTagForm"
			scope="request"
			validate="true"
			input="/TaskDetail.vhtml">
			<forward name="success"	path="/TaskDetail.vhtml"/>
		</action>

		<action
			path="/tag/list"
			type="net.yher.workstyle.action.tag.ListAction">
			<forward name="success"	path="/TagList.vhtml"/>
		</action>
		
		<action
			path="/tagType/list"
			type="net.yher.workstyle.action.tagType.ListAction">
			<forward name="success"	path="/TagTypeList.vhtml"/>
		</action>

		<action
			path="/rest/delete"
			type="net.yher.workstyle.action.task.rest.DeleteAction"
			name="selectTaskForm"
			scope="request"
			validate="true"
			input="/xml/Error.vxml">
			<forward name="success"	path="/xml/SimpleResult.vxml"/>
		</action>
		<action
			path="/rest/changeStatus"
			type="net.yher.workstyle.action.task.rest.ChangeStatusAction"
			name="changeTaskStatusForm"
			scope="request"
			validate="true"
			input="/xml/Error.vxml">
			<forward name="success"	path="/xml/Task.vxml"/>
		</action>
		<action
			path="/rest/editTagList"
			type="net.yher.workstyle.action.task.rest.EditTagListAction"
			name="editTaskTagListForm"
			scope="request"
			validate="true"
			input="/xml/Error.vxml">
			<forward name="success"	path="/xml/Task.vxml"/>
		</action>
		<action
			path="/rest/editContents"
			type="net.yher.workstyle.action.task.rest.EditContentsAction"
			name="editTaskContentsForm"
			scope="request"
			validate="true"
			input="/xml/Error.vxml">
			<forward name="success"	path="/xml/Task.vxml"/>
		</action>
		<action
			path="/rest/editEstimatedManHour"
			type="net.yher.workstyle.action.task.rest.EditEstimatedManHourAction"
			name="editTaskEstimatedManHourForm"
			scope="request"
			validate="true"
			input="/xml/Error.vxml">
			<forward name="success"	path="/xml/Task.vxml"/>
		</action>
		<action
			path="/rest/addComment"
			type="net.yher.workstyle.action.task.rest.AddCommentAction"
			name="addCommentForm"
			scope="request"
			validate="true"
			input="/xml/Error.vxml">
			<forward name="success"	path="/xml/Task.vxml"/>
		</action>
		<action
			path="/rest/addLinkedTask"
			type="net.yher.workstyle.action.task.rest.AddLinkedTaskAction"
			name="addLinkedTaskForm"
			scope="request"
			validate="true"
			input="/xml/Error.vxml">
			<forward name="success"	path="/xml/Task.vxml"/>
		</action>
		<action
			path="/rest/link"
			type="net.yher.workstyle.action.task.rest.LinkAction"
			name="linkForm"
			scope="request"
			validate="true"
			input="/xml/Error.vxml">
			<forward name="success"	path="/xml/SimpleResult.vxml"/>
		</action>
		<action
			path="/rest/unlink"
			type="net.yher.workstyle.action.task.rest.UnlinkAction"
			name="linkForm"
			scope="request"
			validate="true"
			input="/xml/Error.vxml">
			<forward name="success"	path="/xml/SimpleResult.vxml"/>
		</action>
		<action
			path="/rest/deleteFile"
			type="net.yher.workstyle.action.task.rest.DeleteFileAction"
			name="selectFileForm"
			scope="request"
			validate="true"
			input="/xml/Error.vxml">
			<forward name="success"	path="/xml/SimpleResult.vxml"/>
		</action>

		<action
			path="/rest/tag/delete"
			type="net.yher.workstyle.action.tag.rest.DeleteAction"
			name="selectTagForm"
			scope="request"
			validate="true"
			input="/xml/Error.vxml">
			<forward name="success"	path="/xml/SimpleResult.vxml"/>
		</action>

		<action
			path="/rest/tag/add"
			type="net.yher.workstyle.action.tag.rest.AddAction"
			name="addTagForm"
			scope="request"
			validate="true"
			input="/xml/Error.vxml">
			<forward name="success"	path="/xml/Tag.vxml"/>
		</action>
		<action
			path="/rest/tag/toggleActivity"
			type="net.yher.workstyle.action.tag.rest.ToggleActivityAction"
			name="selectTagForm"
			scope="request"
			validate="true"
			input="/xml/Error.vxml">
			<forward name="success"	path="/xml/Tag.vxml"/>
		</action>
		<action
			path="/rest/tag/changeType"
			type="net.yher.workstyle.action.tag.rest.ChangeTypeAction"
			name="changeTagTypeForm"
			scope="request"
			validate="true"
			input="/xml/Error.vxml">
			<forward name="success"	path="/xml/Tag.vxml"/>
		</action>

		<action
			path="/rest/tagType/add"
			type="net.yher.workstyle.action.tagType.rest.AddAction"
			name="addTagTypeForm"
			scope="request"
			validate="true"
			input="/xml/Error.vxml">
			<forward name="success"	path="/xml/TagType.vxml"/>
		</action>
		<action
			path="/rest/tagType/edit"
			type="net.yher.workstyle.action.tagType.rest.EditAction"
			name="editTagTypeForm"
			scope="request"
			validate="true"
			input="/xml/Error.vxml">
			<forward name="success"	path="/xml/TagType.vxml"/>
		</action>
		<action
			path="/rest/tagType/delete"
			type="net.yher.workstyle.action.tagType.rest.DeleteAction"
			name="selectTagTypeForm"
			scope="request"
			validate="true"
			input="/xml/Error.vxml">
			<forward name="success"	path="/xml/SimpleResult.vxml"/>
		</action>
		<action
			path="/rest/tagType/changeStyle"
			type="net.yher.workstyle.action.tagType.rest.ChangeStyleAction"
			name="changeTagTypeStyleForm"
			scope="request"
			validate="true"
			input="/xml/Error.vxml">
			<forward name="success"	path="/xml/TagType.vxml"/>
		</action>
    </action-mappings>


<!-- ============================================= Controller Configuration -->

    <controller
       processorClass="org.apache.struts.tiles.TilesRequestProcessor"/>


<!-- ======================================== Message Resources Definitions -->

    <message-resources parameter="MessageResources" />


<!-- =============================================== Plug Ins Configuration -->

  <!-- ======================================================= Tiles plugin -->
  <!--
     This plugin initialize Tiles definition factory. This later can takes some
	 parameters explained here after. The plugin first read parameters from
	 web.xml, thenoverload them with parameters defined here. All parameters
	 are optional.
     The plugin should be declared in each struts-config file.
       - definitions-config: (optional)
            Specify configuration file names. There can be several comma
		    separated file names (default: ?? )
       - moduleAware: (optional - struts1.1)
            Specify if the Tiles definition factory is module aware. If true
            (default), there will be one factory for each Struts module.
			If false, there will be one common factory for all module. In this
            later case, it is still needed to declare one plugin per module.
            The factory will be initialized with parameters found in the first
            initialized plugin (generally the one associated with the default
            module).
			  true : One factory per module. (default)
			  false : one single shared factory for all modules
	   - definitions-parser-validate: (optional)
	        Specify if xml parser should validate the Tiles configuration file.
			  true : validate. DTD should be specified in file header (default)
			  false : no validation

	  Paths found in Tiles definitions are relative to the main context.
  -->

    <plug-in className="org.apache.struts.tiles.TilesPlugin" >

      <!-- Path to XML definition file -->
      <set-property property="definitions-config"
                       value="/WEB-INF/tiles-defs.xml" />
      <!-- Set Module-awareness to true -->
      <set-property property="moduleAware" value="true" />
    </plug-in>


  <!-- =================================================== Validator plugin -->

  <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
    <set-property
        property="pathnames"
        value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
  </plug-in>

</struts-config>

