Subversion Repositories SmartDukaan

Rev

Rev 536 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 536 Rev 545
Line 19... Line 19...
19
import org.apache.thrift.TException;
19
import org.apache.thrift.TException;
20
import org.w3c.dom.Node;
20
import org.w3c.dom.Node;
21
import org.w3c.dom.NodeList;
21
import org.w3c.dom.NodeList;
22
import org.xml.sax.InputSource;
22
import org.xml.sax.InputSource;
23
 
23
 
24
public class AramaxTrackingService {
24
public class AramexTrackingService {
25
	//public static String ARAMAX_URL = "http://www.aramex.com/track_xml.asp?ShipmentNumber=";
25
	//public static String ARAMAX_URL = "http://www.aramex.com/track_xml.asp?ShipmentNumber=";
26
	
26
	
27
	private static String ARAMAX_URL;
27
	private static String ARAMEX_URL;
28
 
28
 
29
	static{
29
	static{
30
		try {
30
		try {
31
			ARAMAX_URL = ConfigClient.getClient().get("aramex_update_url");
31
			ARAMEX_URL = ConfigClient.getClient().get("aramex_update_url");
32
			
32
			
33
		} catch (ConfigException e) {
33
		} catch (ConfigException e) {
34
			ARAMAX_URL = "file:///root/docs/logistics/AWB_Track.xml";
34
			ARAMEX_URL = "file:///root/docs/logistics/AWB_Track.xml";
35
			e.printStackTrace();
35
			e.printStackTrace();
36
		}
36
		}
37
		
37
		
38
	}
38
	}
39
	/*
39
	/*
Line 66... Line 66...
66
 
66
 
67
	
67
	
68
	public static void getShipmentUpdates(String awbNumber){
68
	public static void getShipmentUpdates(String awbNumber){
69
			String expression = "/HAWBs/HAWBDetails/HAWBHistory/HAWBUpdate";
69
			String expression = "/HAWBs/HAWBDetails/HAWBHistory/HAWBUpdate";
70
			//String uri = ARAMAX_URL + awbNumber; 
70
			//String uri = ARAMAX_URL + awbNumber; 
71
			String uri = ARAMAX_URL;
71
			String uri = ARAMEX_URL;
72
			InputSource inputSource = new InputSource(uri);
72
			InputSource inputSource = new InputSource(uri);
73
			XPath xpath= XPathFactory.newInstance().newXPath();
73
			XPath xpath= XPathFactory.newInstance().newXPath();
74
 
74
 
75
			NodeList nodes = null;
75
			NodeList nodes = null;
76
			try {
76
			try {
Line 106... Line 106...
106
	}
106
	}
107
 
107
 
108
	
108
	
109
	public static List<Map<String, String>> getUpdates(String awbNumber){
109
	public static List<Map<String, String>> getUpdates(String awbNumber){
110
		//String uri = ARAMAX_URL + awbNumber;
110
		//String uri = ARAMAX_URL + awbNumber;
111
		String uri = ARAMAX_URL;
111
		String uri = ARAMEX_URL;
112
		InputSource inputSource = new InputSource(uri);
112
		InputSource inputSource = new InputSource(uri);
113
		XPath xpath = XPathFactory.newInstance().newXPath();
113
		XPath xpath = XPathFactory.newInstance().newXPath();
114
 
114
 
115
		String expression = "/HAWBs/HAWBDetails/HAWBHistory/HAWBUpdate";
115
		String expression = "/HAWBs/HAWBDetails/HAWBHistory/HAWBUpdate";
116
		NodeList nodes = null;
116
		NodeList nodes = null;