Subversion Repositories SmartDukaan

Rev

Rev 2037 | Rev 2227 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2037 Rev 2130
Line 7... Line 7...
7
import in.shop2020.metamodel.util.ExpandedEntity;
7
import in.shop2020.metamodel.util.ExpandedEntity;
8
import in.shop2020.model.v1.catalog.Item;
8
import in.shop2020.model.v1.catalog.Item;
9
import in.shop2020.model.v1.catalog.status;
9
import in.shop2020.model.v1.catalog.status;
10
import in.shop2020.thrift.clients.CatalogServiceClient;
10
import in.shop2020.thrift.clients.CatalogServiceClient;
11
 
11
 
-
 
12
import java.io.File;
12
import java.util.ArrayList;
13
import java.util.ArrayList;
13
import java.util.Date;
14
import java.util.Date;
14
import java.util.List;
15
import java.util.List;
15
import java.util.Map;
16
import java.util.Map;
16
 
17
 
Line 56... Line 57...
56
	public ProductListGenerator() throws Exception {
57
	public ProductListGenerator() throws Exception {
57
		catalogServiceClient = new CatalogServiceClient();
58
		catalogServiceClient = new CatalogServiceClient();
58
		client = catalogServiceClient.getClient();
59
		client = catalogServiceClient.getClient();
59
	}
60
	}
60
	
61
	
61
 
-
 
62
	/**
62
	/**
63
	 * 
63
	 * 
64
	 * @param expEntity
64
	 * @param expEntity
65
	 * @return url
65
	 * @return url
66
	 */
66
	 */
Line 128... Line 128...
128
			
128
			
129
			String title = expEntity.getBrand() + " " + expEntity.getModelName() + " " + expEntity.getModelNumber();
129
			String title = expEntity.getBrand() + " " + expEntity.getModelName() + " " + expEntity.getModelNumber();
130
			irDataXMLSnippets.add(this.xmlIndentation[2] + "<ProductName>" + title + "</ProductName>");
130
			irDataXMLSnippets.add(this.xmlIndentation[2] + "<ProductName>" + title + "</ProductName>");
131
 
131
 
132
			String url = getEntityURL(expEntity);
132
			String url = getEntityURL(expEntity);
-
 
133
			
-
 
134
			String imageUrl = "http://static" + ((expEntity.getID()+1)%3) + ".saholic.com" + File.separator + "images" + File.separator + expEntity.getID() + File.separator + "icon.jpg";    
-
 
135
			
133
			irDataXMLSnippets.add(this.xmlIndentation[2] + "<ProductURL>" + url + "</ProductURL>");
136
			irDataXMLSnippets.add(this.xmlIndentation[2] + "<ProductURL>" + url + "</ProductURL>");
134
 
137
 
135
			
138
			
136
			irDataXMLSnippets.add(this.xmlIndentation[2] + "<ProductPrice>" + itemPrice + "</ProductPrice>");
139
			irDataXMLSnippets.add(this.xmlIndentation[2] + "<ProductPrice>" + itemPrice + "</ProductPrice>");
137
			
140
			
-
 
141
			irDataXMLSnippets.add(this.xmlIndentation[2] + "<ProductImageURL>" + imageUrl + "</ProductImageURL>");
-
 
142
			
138
			irDataXMLSnippets.add(this.xmlIndentation[1] + "</products>");		
143
			irDataXMLSnippets.add(this.xmlIndentation[1] + "</products>");		
139
		}
144
		}
140
	}
145
	}
141
	
146
	
142
	/**
147
	/**
Line 154... Line 159...
154
		String productDataXML = StringUtils.join(productXMLSnippets, "\n");
159
		String productDataXML = StringUtils.join(productXMLSnippets, "\n");
155
		
160
		
156
		Utils.info(productDataXML);
161
		Utils.info(productDataXML);
157
		
162
		
158
		// Write it to file
163
		// Write it to file
159
		String productXMLFilename = Utils.EXPORT_PARTNERS_CONTENT_PATH + "phonecurry.xml";
164
		String productXMLFilename = Utils.EXPORT_PARTNERS_CONTENT_PATH + "saholicmobilephones.xml";
160
		DBUtils.store(productDataXML, productXMLFilename);
165
		DBUtils.store(productDataXML, productXMLFilename);
161
	}
166
	}
162
}
167
}