Check-in [4ed5716b53]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:busqueda nacional
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:4ed5716b53b280eec6c257d90b053749583311e5
User & Date: malcon 2015-01-26 23:05:02
Context
2015-01-27
22:20
correccion de hector y mi busqueda de nacionales check-in: adf5a04eb7 user: malcon tags: trunk
2015-01-26
23:05
busqueda nacional check-in: 4ed5716b53 user: malcon tags: trunk
22:02
avance busqueda check-in: 4e975d90dc user: malcon tags: trunk
Changes

Changes to WebContent/WEB-INF/website/nacional.jsp.

21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39





40
41
42
43
44
45
46
                    });
                    $(function () {
                        $("#datepicker2").datepicker();
                    });
                </script>
                <!---/End-date-piker---->
                <div class="p-ww">
                    <form>
                        <span>DONDE</span>
                        <input class="dest" type="text" value="Destino" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Distination';}">
                        <span>DESDE</span>
                        <input class="date hasDatepicker" id="datepicker" type="text" value=" Fecha" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Seleccione Fecha';}">

                        <span>HASTA</span>
                        <input class="date hasDatepicker" id="datepicker2" type="text" value=" Fecha" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Seleccione Fecha';}">

                        <input type="submit" value="Buscar">
                    </form>
                </div>





                <div class="clear"></div>
            </div>
        </div>

        <!-- INICIO DEL  SLIPDER DE NACIONALES-->
    </div>
    <div class="destination-places">







|











>
>
>
>
>







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
                    });
                    $(function () {
                        $("#datepicker2").datepicker();
                    });
                </script>
                <!---/End-date-piker---->
                <div class="p-ww">
                    <form >
                        <span>DONDE</span>
                        <input class="dest" type="text" value="Destino" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Distination';}">
                        <span>DESDE</span>
                        <input class="date hasDatepicker" id="datepicker" type="text" value=" Fecha" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Seleccione Fecha';}">

                        <span>HASTA</span>
                        <input class="date hasDatepicker" id="datepicker2" type="text" value=" Fecha" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Seleccione Fecha';}">

                        <input type="submit" value="Buscar">
                    </form>
                </div>
                <s:debug></s:debug>
                <s:form action="buscarPaqueteNacional" namespace="/paquete">
					<s:select list="destinos" name="paquete.destino.codigo" listKey="codigo" listValue="nombre"  label="Destinos" />
					<s:submit value="Buscar"/>
				</s:form>
                <div class="clear"></div>
            </div>
        </div>

        <!-- INICIO DEL  SLIPDER DE NACIONALES-->
    </div>
    <div class="destination-places">

Changes to src/action/PaqueteAction.java.

1
2










3
4
5
6
7
8
9
10
11




12
13
14
15
16


17
18
19
20


21

22
23
24
25
26
27

28
29

30
31
32
33

package action;











import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.Preparable;

public class PaqueteAction extends ActionSupport implements Preparable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;





	@Override
	public void prepare() throws Exception {
		// TODO Auto-generated method stub
		


	}
/*
	private List<Paquete> paquetes;
	


	private PaqueteService paqueteService = new PaqueteServiceDAO();

	
	
	@Override
	public void prepare() throws Exception {
		
		

		DestinoService destinoService=new DestinoServiceDAO();
		destinos=destinoService.getDestinos();

		
	}*/

}



>
>
>
>
>
>
>
>
>
>





<
<
<

>
>
>
>
|
<
<
<
|
>
>

<
<

>
>
|
>
|



<
<
>

|
>
|
<

|
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17



18
19
20
21
22
23



24
25
26
27


28
29
30
31
32
33
34
35
36


37
38
39
40
41

42
43
44
package action;


import java.util.List;

import negocio.DestinoService;
import negocio.DestinoServiceDAO;
import negocio.PaqueteService;
import negocio.PaqueteServiceDAO;
import model.Destino;
import model.Paquete;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.Preparable;

public class PaqueteAction extends ActionSupport implements Preparable{




	private static final long serialVersionUID = 1L;
	private Paquete paquete= new Paquete();
	private List<Paquete> paquetes;
	private List<Destino> destinos;
	private PaqueteService paqueteService = new PaqueteServiceDAO();
	



	
	public Paquete getPaquete() {
		return paquete;
	}


	
	public String buscarNacional() throws Exception {
		int codigo = 1;
		paquetes= paqueteService.buscar(codigo);
		return SUCCESS;
	}
	
	@Override
	public void prepare() throws Exception {


		// TODO Auto-generated method stub
		DestinoService destinoService=new DestinoServiceDAO();
		destinos=destinoService.getDestinos("NA");
		System.out.println("action cliente" + destinos);
	}



}

Changes to src/model/Destino.java.

1
2
3
4
5




6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package model;

import java.io.Serializable;

public class Destino implements Serializable{




	private Integer codigo;
	private String nombre;
	private String descripcion;
	private String tipo_destino;
	
	
	public Destino(Integer codigo, String nombre, String descripcion,
			String tipo_destino) {
		super();
		this.codigo = codigo;
		this.nombre = nombre;
		this.descripcion = descripcion;
		this.tipo_destino = tipo_destino;
	}
	public Integer getCodigo() {
		return codigo;
	}
	public void setCodigo(Integer codigo) {
		this.codigo = codigo;
	}
	public String getNombre() {





>
>
>
>






<
<
<
<
<
<
<
<







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15








16
17
18
19
20
21
22
package model;

import java.io.Serializable;

public class Destino implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Integer codigo;
	private String nombre;
	private String descripcion;
	private String tipo_destino;
	
	








	public Integer getCodigo() {
		return codigo;
	}
	public void setCodigo(Integer codigo) {
		this.codigo = codigo;
	}
	public String getNombre() {

Changes to src/model/Paquete.java.

8
9
10
11
12
13
14



15
16
17
18
19
20
21
..
57
58
59
60
61
62
63


64







	private String codigo;
	private String nombre;
	private String descripcion;
	private String itinerario;
	private String tipo_paquete;
	private Float precio;
	private Moneda moneda;



	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
................................................................................
	}
	public Moneda getMoneda() {
		return moneda;
	}
	public void setMoneda(Moneda moneda) {
		this.moneda = moneda;
	}


}














>
>
>







 







>
>
|
>
>
>
>
>
>
>
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
..
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
	private String codigo;
	private String nombre;
	private String descripcion;
	private String itinerario;
	private String tipo_paquete;
	private Float precio;
	private Moneda moneda;
	private Destino destino;
	
		
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
................................................................................
	}
	public Moneda getMoneda() {
		return moneda;
	}
	public void setMoneda(Moneda moneda) {
		this.moneda = moneda;
	}
	public Destino getDestino() {
		return destino;
	}
	public void setDestino(Destino destino) {
		this.destino = destino;
	}
	
	
	
}

Changes to src/persistencia/mybatis/mapper/PaqueteMapper.xml.

12
13
14
15
16
17
18



19
20
21
22
23
24
25
26
27
28
29
30
        <result column="nombre" property="nombre"/>
        <result column="descripcion" property="descripcion"/>
        <result column="itinerario" property="itinerario"/>
        <result column="precio_base" property="precio_base"/>
        <association property="moneda" javaType="moneda">
            	<result column = "abrev" property="abrev"/>
        </association>



     </resultMap>
     
    <select id="buscar" resultMap="rmPaqueteBusqueda" parameterType="int">
    	SELECT pa.id, pa.codigo, pa.nombre, pa.descripcion, pa.itinerario,
			pa.precio_base, pa.abrev FROM paquete pa
			inner join paquete_has_destino pd on pd.paquete_id = pa.id
			WHERE pd.destino_id = #{id}
    </select>
    
    <resultMap type="paquete" id="rmPaqueteByPK">
        <id column="id" property="id"/>
		<result column="codigo" property="codigo"/>







>
>
>




|







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
        <result column="nombre" property="nombre"/>
        <result column="descripcion" property="descripcion"/>
        <result column="itinerario" property="itinerario"/>
        <result column="precio_base" property="precio_base"/>
        <association property="moneda" javaType="moneda">
            	<result column = "abrev" property="abrev"/>
        </association>
          <association property="destino" javaType="destino">
            	<result column = "nombre" property="nombre"/>
        </association>
     </resultMap>
     
    <select id="buscar" resultMap="rmPaqueteBusqueda" parameterType="int">
    	SELECT pa.id, pa.codigo, pa.nombre, pa.descripcion, pa.itinerario,
			pa.precio_base, pa.abrev, pd.nombre FROM paquete pa
			inner join paquete_has_destino pd on pd.paquete_id = pa.id
			WHERE pd.destino_id = #{id}
    </select>
    
    <resultMap type="paquete" id="rmPaqueteByPK">
        <id column="id" property="id"/>
		<result column="codigo" property="codigo"/>

Changes to src/struts-paquete.xml.

1




























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





























>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?xml version="1.0" encoding="UTF-8"?>

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

<struts>
	<package name="struts-paquete" extends="demo" namespace="/paquete">
		
		<action name="buscarPaqueteNacional" class="action.PaqueteAction"
			method="buscarNacional">
			<result type="tiles">d_nacional_web</result>
			<result name="input" type="tiles">d_nacional_web</result>
		</action>
		
		<action name="buscarPaqueteInternacional" class="action.PaqueteAction"
			method="buscarInternacional">
			<result type="tiles">d_internacional_web</result>
			<result name="input" type="tiles">d_internacional_web</result>
		</action>
		
		<action name="buscarPaqueteCrucero" class="action.PaqueteAction"
			method="buscarCrucero">
			<result type="tiles">d_crucero_web</result>
			<result name="input" type="tiles">d_crucero_web</result>
		</action>

	</package>
</struts>

Changes to src/struts.xml.

7
8
9
10
11
12
13

14
15
16
17
18
19
20
<struts>
	<constant name="struts.custom.i18n.resources" value="recursos.textos" />
	<constant name="struts.enable.DynamicMethodInvocation" value="false"/>
	 			
	<include file="struts-admin.xml"/>
	<include file="struts-cliente.xml"/>
	<include file="struts-reserva.xml"/>

	<include file="struts-web.xml"/>
    
	<package name="demo" extends="struts-default">
		<result-types>
			<result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult"></result-type>
		</result-types>
		







>







7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<struts>
	<constant name="struts.custom.i18n.resources" value="recursos.textos" />
	<constant name="struts.enable.DynamicMethodInvocation" value="false"/>
	 			
	<include file="struts-admin.xml"/>
	<include file="struts-cliente.xml"/>
	<include file="struts-reserva.xml"/>
	<include file="struts-paquete.xml"/>
	<include file="struts-web.xml"/>
    
	<package name="demo" extends="struts-default">
		<result-types>
			<result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult"></result-type>
		</result-types>