| Line 1... |
Line 1... |
| 1 |
package in.shop2020.util;
|
1 |
package in.shop2020.util;
|
| 2 |
|
2 |
|
| 3 |
import in.shop2020.metamodel.core.Bullet;
|
3 |
import in.shop2020.metamodel.core.Bullet;
|
| 4 |
import in.shop2020.metamodel.core.BulletDataObject;
|
- |
|
| 5 |
import in.shop2020.metamodel.core.Entity;
|
4 |
import in.shop2020.metamodel.core.Entity;
|
| 6 |
import in.shop2020.metamodel.core.EntityState;
|
5 |
import in.shop2020.metamodel.core.EntityState;
|
| 7 |
import in.shop2020.metamodel.core.EntityStatus;
|
6 |
import in.shop2020.metamodel.core.EntityStatus;
|
| 8 |
import in.shop2020.metamodel.core.EnumDataObject;
|
7 |
import in.shop2020.metamodel.core.EnumDataObject;
|
| 9 |
import in.shop2020.metamodel.core.ExpertReview;
|
8 |
import in.shop2020.metamodel.core.ExpertReview;
|
| Line 12... |
Line 11... |
| 12 |
import in.shop2020.metamodel.core.FreeformContent;
|
11 |
import in.shop2020.metamodel.core.FreeformContent;
|
| 13 |
import in.shop2020.metamodel.core.Media;
|
12 |
import in.shop2020.metamodel.core.Media;
|
| 14 |
import in.shop2020.metamodel.core.Media.Type;
|
13 |
import in.shop2020.metamodel.core.Media.Type;
|
| 15 |
import in.shop2020.metamodel.core.PrimitiveDataObject;
|
14 |
import in.shop2020.metamodel.core.PrimitiveDataObject;
|
| 16 |
import in.shop2020.metamodel.core.Slide;
|
15 |
import in.shop2020.metamodel.core.Slide;
|
| 17 |
import in.shop2020.metamodel.definitions.BulletDefinition;
|
- |
|
| 18 |
import in.shop2020.metamodel.definitions.Catalog;
|
16 |
import in.shop2020.metamodel.definitions.Catalog;
|
| 19 |
import in.shop2020.metamodel.definitions.Category;
|
17 |
import in.shop2020.metamodel.definitions.Category;
|
| 20 |
import in.shop2020.metamodel.definitions.CategorySlideDefinition;
|
18 |
import in.shop2020.metamodel.definitions.CategorySlideDefinition;
|
| 21 |
import in.shop2020.metamodel.definitions.DefinitionsContainer;
|
19 |
import in.shop2020.metamodel.definitions.DefinitionsContainer;
|
| 22 |
import in.shop2020.metamodel.definitions.FeatureDefinition;
|
- |
|
| 23 |
import in.shop2020.metamodel.definitions.SlideDefinition;
|
- |
|
| 24 |
import in.shop2020.metamodel.definitions.SlideFeatureDefinition;
|
- |
|
| 25 |
import in.shop2020.metamodel.util.ContentPojo;
|
20 |
import in.shop2020.metamodel.util.ContentPojo;
|
| 26 |
import in.shop2020.metamodel.util.CreationUtils;
|
21 |
import in.shop2020.metamodel.util.CreationUtils;
|
| 27 |
import in.shop2020.metamodel.util.CreationUtils1;
|
22 |
import in.shop2020.metamodel.util.CreationUtils1;
|
| 28 |
import in.shop2020.metamodel.util.ExpandedBullet;
|
23 |
import in.shop2020.metamodel.util.ExpandedBullet;
|
| 29 |
import in.shop2020.metamodel.util.ExpandedEntity;
|
24 |
import in.shop2020.metamodel.util.ExpandedEntity;
|
| 30 |
import in.shop2020.metamodel.util.ExpandedFeature;
|
25 |
import in.shop2020.metamodel.util.ExpandedFeature;
|
| 31 |
import in.shop2020.metamodel.util.ExpandedSlide;
|
26 |
import in.shop2020.metamodel.util.ExpandedSlide;
|
| - |
|
27 |
import in.shop2020.metamodel.util.MediaPojo;
|
| 32 |
import in.shop2020.metamodel.util.Specification;
|
28 |
import in.shop2020.metamodel.util.Specification;
|
| 33 |
import in.shop2020.metamodel.util.SpecificationGroup;
|
29 |
import in.shop2020.metamodel.util.SpecificationGroup;
|
| - |
|
30 |
import in.shop2020.model.v1.user.ItemQuantity;
|
| 34 |
import in.shop2020.model.v1.catalog.CatalogService.Client;
|
31 |
import in.shop2020.model.v1.user.UserContextService.Client;
|
| 35 |
import in.shop2020.model.v1.catalog.Item;
|
32 |
import in.shop2020.model.v1.catalog.Item;
|
| 36 |
import in.shop2020.model.v1.catalog.status;
|
33 |
import in.shop2020.model.v1.catalog.status;
|
| 37 |
import in.shop2020.storage.mongo.StorageManager;
|
34 |
import in.shop2020.storage.mongo.StorageManager;
|
| 38 |
import in.shop2020.thrift.clients.CatalogClient;
|
35 |
import in.shop2020.thrift.clients.CatalogClient;
|
| - |
|
36 |
import in.shop2020.thrift.clients.UserClient;
|
| 39 |
import in.shop2020.utils.Logger;
|
37 |
import in.shop2020.ui.util.NewVUI;
|
| 40 |
|
38 |
|
| 41 |
import java.io.BufferedReader;
|
- |
|
| 42 |
import java.io.ByteArrayInputStream;
|
39 |
import java.io.ByteArrayInputStream;
|
| 43 |
import java.io.ByteArrayOutputStream;
|
40 |
import java.io.ByteArrayOutputStream;
|
| 44 |
import java.io.DataInputStream;
|
- |
|
| 45 |
import java.io.File;
|
41 |
import java.io.File;
|
| 46 |
import java.io.FileInputStream;
|
42 |
import java.io.FileInputStream;
|
| 47 |
import java.io.FileNotFoundException;
|
- |
|
| 48 |
import java.io.FileOutputStream;
|
43 |
import java.io.FileOutputStream;
|
| 49 |
import java.io.FileReader;
|
44 |
import java.io.IOException;
|
| 50 |
import java.io.InputStream;
|
45 |
import java.io.InputStream;
|
| 51 |
import java.io.InputStreamReader;
|
- |
|
| 52 |
import java.io.ObjectInputStream;
|
46 |
import java.io.ObjectInputStream;
|
| 53 |
import java.io.ObjectOutputStream;
|
47 |
import java.io.ObjectOutputStream;
|
| 54 |
import java.io.OutputStream;
|
48 |
import java.io.OutputStream;
|
| 55 |
import java.io.Reader;
|
- |
|
| 56 |
import java.text.MessageFormat;
|
49 |
import java.text.MessageFormat;
|
| 57 |
import java.util.ArrayList;
|
50 |
import java.util.ArrayList;
|
| 58 |
import java.util.Arrays;
|
- |
|
| 59 |
import java.util.Calendar;
|
51 |
import java.util.Calendar;
|
| 60 |
import java.util.Collection;
|
52 |
import java.util.Collection;
|
| 61 |
import java.util.Collections;
|
53 |
import java.util.Collections;
|
| 62 |
import java.util.Date;
|
54 |
import java.util.Date;
|
| 63 |
import java.util.HashMap;
|
55 |
import java.util.HashMap;
|
| 64 |
import java.util.HashSet;
|
- |
|
| 65 |
import java.util.Iterator;
|
56 |
import java.util.Iterator;
|
| 66 |
import java.util.LinkedHashMap;
|
57 |
import java.util.LinkedHashMap;
|
| 67 |
import java.util.LinkedHashSet;
|
- |
|
| 68 |
import java.util.List;
|
58 |
import java.util.List;
|
| 69 |
import java.util.Map;
|
59 |
import java.util.Map;
|
| 70 |
import java.util.Set;
|
- |
|
| 71 |
import java.util.TreeMap;
|
60 |
import java.util.zip.DeflaterOutputStream;
|
| 72 |
|
61 |
|
| 73 |
import org.apache.commons.collections.CollectionUtils;
|
- |
|
| 74 |
import org.apache.commons.io.IOUtils;
|
62 |
import org.apache.commons.io.IOUtils;
|
| 75 |
import org.apache.commons.lang.StringUtils;
|
63 |
import org.apache.commons.lang.StringUtils;
|
| 76 |
|
- |
|
| - |
|
64 |
import org.apache.commons.net.util.Base64;
|
| 77 |
import com.google.gson.Gson;
|
65 |
import org.json.JSONArray;
|
| 78 |
import com.google.gson.reflect.TypeToken;
|
66 |
import org.json.JSONObject;
|
| 79 |
|
67 |
|
| 80 |
/*
|
68 |
/*
|
| 81 |
* @author rajveer
|
69 |
* @author rajveer
|
| 82 |
*
|
70 |
*
|
| 83 |
*
|
71 |
*
|
| Line 86... |
Line 74... |
| 86 |
public class ContentMigrator {
|
74 |
public class ContentMigrator {
|
| 87 |
private static final String HYPHON = "-";
|
75 |
private static final String HYPHON = "-";
|
| 88 |
private static final String SPACE = " ";
|
76 |
private static final String SPACE = " ";
|
| 89 |
private String sourceDbPath;
|
77 |
private String sourceDbPath;
|
| 90 |
private String destinationDbPath;
|
78 |
private String destinationDbPath;
|
| - |
|
79 |
private static final String IMG_URL_TEMPLATE ="http://static{0}.saholic.com/images/media/{1}/{2}";
|
| 91 |
|
80 |
|
| 92 |
public static void main(String[] args) throws Exception {
|
81 |
public static void main(String[] args) throws Exception {
|
| 93 |
String usage = "Usage: ContentMigrator {source db path}{destination db path}";
|
82 |
ContentMigrator cm = new ContentMigrator("","");
|
| 94 |
|
83 |
cm.printExceptionEntities();
|
| 95 |
String sourceDbPath = null, destinationDbPath = null;
|
84 |
/*UserClient userServiceClient = new UserClient();
|
| 96 |
String dryRun = null;
|
85 |
Client client = userServiceClient.getClient();
|
| - |
|
86 |
List<ItemQuantity> itemQty = new ArrayList<ItemQuantity>();
|
| 97 |
// if(args.length < 2) {
|
87 |
itemQty.add(new ItemQuantity(14366, 4));
|
| 98 |
// System.out.println(usage);
|
88 |
itemQty.add(new ItemQuantity(14367, 4));
|
| 99 |
// System.exit(-1);
|
89 |
itemQty.add(new ItemQuantity(14368, 4));
|
| - |
|
90 |
client.addItemsToCart(496741, itemQty, "POPE");
|
| - |
|
91 |
System.out.println(client.validateCartNew(496741l, "201306", -1));
|
| - |
|
92 |
String cartMap="{\"cartItems\":[{\"itemId\":3243, \"quantity\":6}, {\"itemId\":3244, \"quantity\":16 }]}";
|
| 100 |
// }else{
|
93 |
try{
|
| - |
|
94 |
List<ItemQuantity> itemQuantities = new ArrayList<ItemQuantity>();
|
| - |
|
95 |
JSONObject jsonObj = new JSONObject(cartMap);
|
| - |
|
96 |
JSONArray cartItems = jsonObj.getJSONArray("cartItems");
|
| 101 |
// sourceDbPath = args[0];
|
97 |
for (int i=0; i< cartItems.length(); i++) {
|
| - |
|
98 |
JSONObject obj = cartItems.getJSONObject(i);
|
| 102 |
// destinationDbPath = args[1];
|
99 |
int itemId = obj.getInt("itemId");
|
| - |
|
100 |
Integer quantity = obj.getInt("quantity");
|
| - |
|
101 |
ItemQuantity iq = new ItemQuantity(itemId, quantity);
|
| 103 |
// dryRun = args[2];
|
102 |
itemQuantities.add(iq);
|
| 104 |
// }
|
103 |
}
|
| - |
|
104 |
}catch (Exception e) {
|
| - |
|
105 |
// TODO: handle exception
|
| 105 |
//
|
106 |
}*/
|
| 106 |
ContentMigrator contentmigrator = new ContentMigrator(sourceDbPath,destinationDbPath);
|
- |
|
| 107 |
contentmigrator.renameTitles();
|
- |
|
| 108 |
|
107 |
|
| 109 |
}
|
108 |
}
|
| - |
|
109 |
public static String compress(String text) {
|
| - |
|
110 |
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
| - |
|
111 |
try {
|
| - |
|
112 |
OutputStream out = new DeflaterOutputStream(baos);
|
| - |
|
113 |
out.write(text.getBytes("UTF-8"));
|
| - |
|
114 |
out.close();
|
| - |
|
115 |
} catch (IOException e) {
|
| - |
|
116 |
throw new AssertionError(e);
|
| - |
|
117 |
}
|
| - |
|
118 |
return Base64.encodeBase64String(baos.toByteArray());
|
| - |
|
119 |
}
|
| 110 |
|
120 |
|
| 111 |
|
121 |
|
| 112 |
private void testProd() throws Exception {
|
122 |
private void testProd() throws Exception {
|
| 113 |
Map<Long, EntityState> es1 = StorageManager.getStorageManager().getEntitiesMetadata();
|
123 |
Map<Long, EntityState> es1 = StorageManager.getStorageManager().getEntitiesMetadata();
|
| 114 |
for(Map.Entry<Long, EntityState> estate : es1.entrySet()){
|
124 |
for(Map.Entry<Long, EntityState> estate : es1.entrySet()){
|
| Line 753... |
Line 763... |
| 753 |
CreationUtils.updateEntity(entity);
|
763 |
CreationUtils.updateEntity(entity);
|
| 754 |
}
|
764 |
}
|
| 755 |
return true;
|
765 |
return true;
|
| 756 |
}
|
766 |
}
|
| 757 |
|
767 |
|
| 758 |
public boolean migrateBrandModel(String dryRun) throws Exception {
|
768 |
/*public boolean migrateBrandModel(String dryRun) throws Exception {
|
| 759 |
CatalogClient catalogServiceClient = new CatalogClient();
|
769 |
CatalogClient catalogServiceClient = new CatalogClient();
|
| 760 |
Client client = catalogServiceClient.getClient();
|
770 |
Client client = catalogServiceClient.getClient();
|
| 761 |
List<Item> items = client.getAllItemsByStatus(status.ACTIVE);
|
771 |
List<Item> items = client.getAllItemsByStatus(status.ACTIVE);
|
| 762 |
items.addAll(client.getAllItemsByStatus(status.PAUSED));
|
772 |
items.addAll(client.getAllItemsByStatus(status.PAUSED));
|
| 763 |
items.addAll(client.getAllItemsByStatus(status.CONTENT_COMPLETE));
|
773 |
items.addAll(client.getAllItemsByStatus(status.CONTENT_COMPLETE));
|
| Line 809... |
Line 819... |
| 809 |
}
|
819 |
}
|
| 810 |
System.out.println(sb.toString());
|
820 |
System.out.println(sb.toString());
|
| 811 |
return true;
|
821 |
return true;
|
| 812 |
}
|
822 |
}
|
| 813 |
|
823 |
|
| 814 |
/**
|
824 |
*//**
|
| 815 |
* this function will read source definition and source entities, and will
|
825 |
* this function will read source definition and source entities, and will
|
| 816 |
* convert source entities to destination entities according to destination
|
826 |
* convert source entities to destination entities according to destination
|
| 817 |
* definitions.
|
827 |
* definitions.
|
| 818 |
*
|
828 |
*
|
| 819 |
* @return boolean
|
829 |
* @return boolean
|
| 820 |
* @throws Exception
|
830 |
* @throws Exception
|
| 821 |
*/
|
831 |
*//*
|
| 822 |
|
832 |
|
| 823 |
public void printSlides() throws Exception {
|
833 |
public void printSlides() throws Exception {
|
| 824 |
DefinitionsContainer defc = Catalog.getInstance()
|
834 |
DefinitionsContainer defc = Catalog.getInstance()
|
| 825 |
.getDefinitionsContainer();
|
835 |
.getDefinitionsContainer();
|
| 826 |
for (Category category : defc.getCategories().values()) {
|
836 |
for (Category category : defc.getCategories().values()) {
|
| Line 838... |
Line 848... |
| 838 |
+ "\t"
|
848 |
+ "\t"
|
| 839 |
+ defc.getSlideDefinition(defs.getSlideDefintionID())
|
849 |
+ defc.getSlideDefinition(defs.getSlideDefintionID())
|
| 840 |
.getChildrenSlideDefinitionIDs());
|
850 |
.getChildrenSlideDefinitionIDs());
|
| 841 |
}
|
851 |
}
|
| 842 |
}
|
852 |
}
|
| 843 |
}
|
853 |
}*/
|
| 844 |
|
854 |
|
| 845 |
public void removeBrowserBullets() throws Exception {
|
855 |
public void removeBrowserBullets() throws Exception {
|
| 846 |
Map<Long, List<ExpandedBullet>> learnedBullets = CreationUtils
|
856 |
Map<Long, List<ExpandedBullet>> learnedBullets = CreationUtils
|
| 847 |
.getLearnedBullets();
|
857 |
.getLearnedBullets();
|
| 848 |
learnedBullets.get(new Long(120076));
|
858 |
learnedBullets.get(new Long(120076));
|
| Line 897... |
Line 907... |
| 897 |
}
|
907 |
}
|
| 898 |
}
|
908 |
}
|
| 899 |
}
|
909 |
}
|
| 900 |
return true;
|
910 |
return true;
|
| 901 |
}
|
911 |
}
|
| - |
|
912 |
|
| - |
|
913 |
public void printExceptionEntities() throws Exception {
|
| - |
|
914 |
Map<Long, Entity> entities = CreationUtils.getEntities();
|
| - |
|
915 |
for (Entity entity : entities.values()) {
|
| - |
|
916 |
try{
|
| - |
|
917 |
EntityState es = CreationUtils.getEntityState(entity.getID());
|
| - |
|
918 |
if(es.getStatus().equals(EntityStatus.READY)){
|
| - |
|
919 |
List<Slide> slides = entity.getSlides();
|
| - |
|
920 |
Media defaultMedia = null;
|
| - |
|
921 |
if(slides!=null){
|
| - |
|
922 |
boolean summarySlide = false;
|
| - |
|
923 |
for(Slide slide : slides){
|
| - |
|
924 |
if (slide != null){
|
| - |
|
925 |
if(slide.getSlideDefinitionID() == 130054l){
|
| - |
|
926 |
summarySlide = true;
|
| - |
|
927 |
if(slide.getFreeformContent().getMedias()==null){
|
| - |
|
928 |
System.out.println("No media in summary for entity:" + entity.getID());
|
| - |
|
929 |
break;
|
| - |
|
930 |
}
|
| - |
|
931 |
defaultMedia = slide.getFreeformContent().getMedias().get("default");
|
| - |
|
932 |
if(defaultMedia==null){
|
| - |
|
933 |
System.out.println("Could not find default image in summary for entity:" + entity.getID());
|
| - |
|
934 |
break;
|
| - |
|
935 |
}
|
| - |
|
936 |
}
|
| - |
|
937 |
}
|
| - |
|
938 |
}
|
| - |
|
939 |
if(!summarySlide) {
|
| - |
|
940 |
System.out.println("Summary Slide is missing for entity: " + entity.getID());
|
| - |
|
941 |
}
|
| - |
|
942 |
}
|
| - |
|
943 |
}
|
| - |
|
944 |
} catch (Exception e){
|
| - |
|
945 |
System.out.println("Some error occurred while processing entity: " + entity.getID());
|
| - |
|
946 |
}
|
| - |
|
947 |
}
|
| - |
|
948 |
}
|
| 902 |
|
949 |
|
| 903 |
public boolean migrateData() throws Exception {
|
950 |
public boolean migrateData() throws Exception {
|
| 904 |
Map<Long, Entity> entities = CreationUtils.getEntities();
|
951 |
Map<Long, Entity> entities = CreationUtils.getEntities();
|
| 905 |
for (Entity entity : entities.values()) {
|
952 |
for (Entity entity : entities.values()) {
|
| 906 |
ExpandedEntity expEntity = new ExpandedEntity(entity);
|
953 |
ExpandedEntity expEntity = new ExpandedEntity(entity);
|
| Line 998... |
Line 1045... |
| 998 |
}
|
1045 |
}
|
| 999 |
}
|
1046 |
}
|
| 1000 |
return true;
|
1047 |
return true;
|
| 1001 |
}
|
1048 |
}
|
| 1002 |
|
1049 |
|
| 1003 |
public boolean migrateModel2() throws Exception {
|
1050 |
/* public boolean migrateModel2() throws Exception {
|
| 1004 |
Map<Long, Entity> entities = CreationUtils.getEntities();
|
1051 |
Map<Long, Entity> entities = CreationUtils.getEntities();
|
| 1005 |
for (Entity entity : entities.values()) {
|
1052 |
for (Entity entity : entities.values()) {
|
| 1006 |
List<Slide> slides = entity.getSlides();
|
1053 |
List<Slide> slides = entity.getSlides();
|
| 1007 |
if (slides != null) {
|
1054 |
if (slides != null) {
|
| 1008 |
for (Slide slide : slides) {
|
1055 |
for (Slide slide : slides) {
|
| Line 1032... |
Line 1079... |
| 1032 |
CreationUtils.updateEntity(entity);
|
1079 |
CreationUtils.updateEntity(entity);
|
| 1033 |
}
|
1080 |
}
|
| 1034 |
return true;
|
1081 |
return true;
|
| 1035 |
}
|
1082 |
}
|
| 1036 |
|
1083 |
|
| 1037 |
/*
|
1084 |
|
| 1038 |
* public boolean migrateModel1() throws Exception{ //DefinitionsContainer
|
1085 |
* public boolean migrateModel1() throws Exception{ //DefinitionsContainer
|
| 1039 |
* oldDfc = new DefinitionsContainer(Utils.CONTENT_DB_PATH +
|
1086 |
* oldDfc = new DefinitionsContainer(Utils.CONTENT_DB_PATH +
|
| 1040 |
* "olddefinitions" + File.separator); //DefinitionsContainer newDfc = new
|
1087 |
* "olddefinitions" + File.separator); //DefinitionsContainer newDfc = new
|
| 1041 |
* DefinitionsContainer(Utils.CONTENT_DB_PATH + "olddefinitions" +
|
1088 |
* DefinitionsContainer(Utils.CONTENT_DB_PATH + "olddefinitions" +
|
| 1042 |
* File.separator);
|
1089 |
* File.separator);
|
| Line 1225... |
Line 1272... |
| 1225 |
* newSequence.add(removeMap.get(id)); }else{ newSequence.add(id); } }
|
1272 |
* newSequence.add(removeMap.get(id)); }else{ newSequence.add(id); } }
|
| 1226 |
* entity.setSlideSequence(newSequence); CreationUtils.updateEntity(entity);
|
1273 |
* entity.setSlideSequence(newSequence); CreationUtils.updateEntity(entity);
|
| 1227 |
* } }
|
1274 |
* } }
|
| 1228 |
*
|
1275 |
*
|
| 1229 |
* return true; }
|
1276 |
* return true; }
|
| 1230 |
*/
|
1277 |
|
| 1231 |
|
1278 |
|
| 1232 |
public void printSlideContent(Slide slide) {
|
1279 |
public void printSlideContent(Slide slide) {
|
| 1233 |
|
1280 |
|
| 1234 |
System.out.println("Slide: "
|
1281 |
System.out.println("Slide: "
|
| 1235 |
+ slide.getFreeformContent().getFreeformText());
|
1282 |
+ slide.getFreeformContent().getFreeformText());
|
| Line 1255... |
Line 1302... |
| 1255 |
}
|
1302 |
}
|
| 1256 |
}
|
1303 |
}
|
| 1257 |
|
1304 |
|
| 1258 |
}
|
1305 |
}
|
| 1259 |
|
1306 |
|
| 1260 |
/*
|
1307 |
|
| 1261 |
* public boolean migrateModel() throws Exception{ //DefinitionsContainer
|
1308 |
* public boolean migrateModel() throws Exception{ //DefinitionsContainer
|
| 1262 |
* oldDfc = new DefinitionsContainer(Utils.CONTENT_DB_PATH +
|
1309 |
* oldDfc = new DefinitionsContainer(Utils.CONTENT_DB_PATH +
|
| 1263 |
* "olddefinitions" + File.separator); //DefinitionsContainer newDfc = new
|
1310 |
* "olddefinitions" + File.separator); //DefinitionsContainer newDfc = new
|
| 1264 |
* DefinitionsContainer(Utils.CONTENT_DB_PATH + "olddefinitions" +
|
1311 |
* DefinitionsContainer(Utils.CONTENT_DB_PATH + "olddefinitions" +
|
| 1265 |
* File.separator);
|
1312 |
* File.separator);
|
| Line 1427... |
Line 1474... |
| 1427 |
*
|
1474 |
*
|
| 1428 |
* default: newSlides.add(slide); break; } } entity.setSlides(newSlides);
|
1475 |
* default: newSlides.add(slide); break; } } entity.setSlides(newSlides);
|
| 1429 |
* CreationUtils.updateEntity(entity); } }
|
1476 |
* CreationUtils.updateEntity(entity); } }
|
| 1430 |
*
|
1477 |
*
|
| 1431 |
* return true; }
|
1478 |
* return true; }
|
| 1432 |
*/
|
1479 |
|
| 1433 |
public boolean migrateRemoveBorrowedCategoryIdFromSlide() throws Exception {
|
1480 |
public boolean migrateRemoveBorrowedCategoryIdFromSlide() throws Exception {
|
| 1434 |
Map<Long, Entity> entities = CreationUtils.getEntities();
|
1481 |
Map<Long, Entity> entities = CreationUtils.getEntities();
|
| 1435 |
for (Entity entity : entities.values()) {
|
1482 |
for (Entity entity : entities.values()) {
|
| 1436 |
if (entity.getID() == 0) {
|
1483 |
if (entity.getID() == 0) {
|
| 1437 |
CreationUtils.deleteEntity(entity.getID());
|
1484 |
CreationUtils.deleteEntity(entity.getID());
|
| Line 1452... |
Line 1499... |
| 1452 |
}
|
1499 |
}
|
| 1453 |
return true;
|
1500 |
return true;
|
| 1454 |
}
|
1501 |
}
|
| 1455 |
|
1502 |
|
| 1456 |
public boolean migrate() throws Exception {
|
1503 |
public boolean migrate() throws Exception {
|
| 1457 |
/*
|
1504 |
|
| 1458 |
* DefinitionsContainer sourceDefs = new
|
1505 |
* DefinitionsContainer sourceDefs = new
|
| 1459 |
* DefinitionsContainer(sourceDbPath); DefinitionsContainer
|
1506 |
* DefinitionsContainer(sourceDbPath); DefinitionsContainer
|
| 1460 |
* destinationDefs = new DefinitionsContainer(destinationDbPath);
|
1507 |
* destinationDefs = new DefinitionsContainer(destinationDbPath);
|
| 1461 |
* EntityContainer sourceEnts = new EntityContainer(sourceDbPath);
|
1508 |
* EntityContainer sourceEnts = new EntityContainer(sourceDbPath);
|
| 1462 |
* EntityContainer destinationEnts = new
|
1509 |
* EntityContainer destinationEnts = new
|
| Line 1518... |
Line 1565... |
| 1518 |
* newMedia.toString()); // OldCreationUtils.removeMedia(entity.getID(),
|
1565 |
* newMedia.toString()); // OldCreationUtils.removeMedia(entity.getID(),
|
| 1519 |
* label); // CreationUtils.addMedia(entity.getID(), newMedia); } }
|
1566 |
* label); // CreationUtils.addMedia(entity.getID(), newMedia); } }
|
| 1520 |
*
|
1567 |
*
|
| 1521 |
* int totalVideos = 0; int totalImages = 0; if(rawMedia==null){
|
1568 |
* int totalVideos = 0; int totalImages = 0; if(rawMedia==null){
|
| 1522 |
* for(Slide slide: slides ){
|
1569 |
* for(Slide slide: slides ){
|
| 1523 |
*/
|
1570 |
|
| 1524 |
/*
|
1571 |
|
| 1525 |
* FreeformContent ffc = slide.getFreeformContent(); List<String>
|
1572 |
* FreeformContent ffc = slide.getFreeformContent(); List<String>
|
| 1526 |
* vidList = new ArrayList<String>(); List<String> imgList = new
|
1573 |
* vidList = new ArrayList<String>(); List<String> imgList = new
|
| 1527 |
* ArrayList<String>();
|
1574 |
* ArrayList<String>();
|
| 1528 |
*
|
1575 |
*
|
| 1529 |
* if(ffc!=null){ List<String> vidFfcLabels = ffc.getYoutubeRefs();
|
1576 |
* if(ffc!=null){ List<String> vidFfcLabels = ffc.getYoutubeRefs();
|
| Line 1552... |
Line 1599... |
| 1552 |
* ffc.removeMedia("image",imglab); ffc.addMedia("image", (new
|
1599 |
* ffc.removeMedia("image",imglab); ffc.addMedia("image", (new
|
| 1553 |
* StringTokenizer(imglab, "~!~")).nextToken()); }
|
1600 |
* StringTokenizer(imglab, "~!~")).nextToken()); }
|
| 1554 |
* slide.setFreeformContent(ffc); System.out.println("Slide id is " +
|
1601 |
* slide.setFreeformContent(ffc); System.out.println("Slide id is " +
|
| 1555 |
* slide.getSlideDefinitionID() + " vid labels: " + vidFfcLabels +
|
1602 |
* slide.getSlideDefinitionID() + " vid labels: " + vidFfcLabels +
|
| 1556 |
* " img labels" + imgFfcLabels); }
|
1603 |
* " img labels" + imgFfcLabels); }
|
| 1557 |
*/
|
1604 |
|
| 1558 |
/*
|
1605 |
|
| 1559 |
* newEntity.addSlide(slide); }
|
1606 |
* newEntity.addSlide(slide); }
|
| 1560 |
*
|
1607 |
*
|
| 1561 |
* // System.out.println("entity:"+ entity.getID() + ":trv:" +
|
1608 |
* // System.out.println("entity:"+ entity.getID() + ":trv:" +
|
| 1562 |
* totalRawVideos + ":tri:" + totalRawImages +":tv:" + totalVideos
|
1609 |
* totalRawVideos + ":tri:" + totalRawImages +":tv:" + totalVideos
|
| 1563 |
* +":ti:" + totalImages); // sb.append("entity:"+ entity.getID() +
|
1610 |
* +":ti:" + totalImages); // sb.append("entity:"+ entity.getID() +
|
| Line 1580... |
Line 1627... |
| 1580 |
* CreationUtils.rewriteRepository(xentities, entitiesByCategory); }
|
1627 |
* CreationUtils.rewriteRepository(xentities, entitiesByCategory); }
|
| 1581 |
* else{ sb.append(" " + entity.getID() + "\n"); } }
|
1628 |
* else{ sb.append(" " + entity.getID() + "\n"); } }
|
| 1582 |
*
|
1629 |
*
|
| 1583 |
*
|
1630 |
*
|
| 1584 |
* out.write(sb.toString()); out.close();
|
1631 |
* out.write(sb.toString()); out.close();
|
| 1585 |
*/
|
1632 |
|
| 1586 |
return true;
|
1633 |
return true;
|
| 1587 |
}
|
1634 |
}
|
| 1588 |
|
1635 |
|
| 1589 |
private boolean makeEntitiesObject() throws Exception {
|
1636 |
private boolean makeEntitiesObject() throws Exception {
|
| 1590 |
// DefinitionsContainer sourceDefs = new
|
1637 |
// DefinitionsContainer sourceDefs = new
|
| Line 1593... |
Line 1640... |
| 1593 |
// DefinitionsContainer(destinationDbPath);
|
1640 |
// DefinitionsContainer(destinationDbPath);
|
| 1594 |
// EntityContainer sourceEnts = new EntityContainer(sourceDbPath);
|
1641 |
// EntityContainer sourceEnts = new EntityContainer(sourceDbPath);
|
| 1595 |
// EntityContainer destinationEnts = new
|
1642 |
// EntityContainer destinationEnts = new
|
| 1596 |
// EntityContainer(destinationDbPath);
|
1643 |
// EntityContainer(destinationDbPath);
|
| 1597 |
|
1644 |
|
| 1598 |
/*
|
1645 |
|
| 1599 |
* Map<Long, List<Entity>> catEntities =
|
1646 |
* Map<Long, List<Entity>> catEntities =
|
| 1600 |
* sourceEnts.getEntitiesbyCategory();
|
1647 |
* sourceEnts.getEntitiesbyCategory();
|
| 1601 |
*
|
1648 |
*
|
| 1602 |
* Map<Long, Entity> entities = sourceEnts.getEntities(); for(Long
|
1649 |
* Map<Long, Entity> entities = sourceEnts.getEntities(); for(Long
|
| 1603 |
* catId: catEntities.keySet()){ List<Entity> ents =
|
1650 |
* catId: catEntities.keySet()){ List<Entity> ents =
|
| 1604 |
* catEntities.get(catId); for(Entity entity: ents){
|
1651 |
* catEntities.get(catId); for(Entity entity: ents){
|
| 1605 |
* entities.put(entity.getID(), entity);
|
1652 |
* entities.put(entity.getID(), entity);
|
| 1606 |
* System.out.println(entity.getID() + ":" + entity.getCategoryID() +
|
1653 |
* System.out.println(entity.getID() + ":" + entity.getCategoryID() +
|
| 1607 |
* ":"+ entity.getBrand() + " "+ entity.getModelName() + " " +
|
1654 |
* ":"+ entity.getBrand() + " "+ entity.getModelName() + " " +
|
| 1608 |
* entity.getModelNumber()); } }
|
1655 |
* entity.getModelNumber()); } }
|
| 1609 |
*/
|
1656 |
|
| 1610 |
|
1657 |
|
| 1611 |
Map<Long, List<Entity>> catEntities = new TreeMap<Long, List<Entity>>();
|
1658 |
Map<Long, List<Entity>> catEntities = new TreeMap<Long, List<Entity>>();
|
| 1612 |
Map<Long, Entity> entities = new TreeMap<Long, Entity>();
|
1659 |
Map<Long, Entity> entities = new TreeMap<Long, Entity>();
|
| 1613 |
|
1660 |
|
| 1614 |
FileInputStream fstream = new FileInputStream("/home/rajveer/Desktop/1");
|
1661 |
FileInputStream fstream = new FileInputStream("/home/rajveer/Desktop/1");
|
| Line 1724... |
Line 1771... |
| 1724 |
}
|
1771 |
}
|
| 1725 |
}
|
1772 |
}
|
| 1726 |
sb.append("\n");
|
1773 |
sb.append("\n");
|
| 1727 |
}
|
1774 |
}
|
| 1728 |
|
1775 |
|
| 1729 |
/*
|
1776 |
|
| 1730 |
* for(FeatureDefinition featureDef: featureDefs){
|
1777 |
* for(FeatureDefinition featureDef: featureDefs){
|
| 1731 |
* BulletDefinition bulletDef =
|
1778 |
* BulletDefinition bulletDef =
|
| 1732 |
* featureDef.getBulletDefinition(); System.out.println(" " +
|
1779 |
* featureDef.getBulletDefinition(); System.out.println(" " +
|
| 1733 |
* featureDef.getLabel() + " " + featureDef.allowsBlank() + " "
|
1780 |
* featureDef.getLabel() + " " + featureDef.allowsBlank() + " "
|
| 1734 |
* + bulletDef.isLearned() + " " + bulletDef.isMultivalue());
|
1781 |
* + bulletDef.isLearned() + " " + bulletDef.isMultivalue());
|
| Line 1740... |
Line 1787... |
| 1740 |
* System.out.println(" " +
|
1787 |
* System.out.println(" " +
|
| 1741 |
* dfc.getDatatypeDefinition(bulletDef
|
1788 |
* dfc.getDatatypeDefinition(bulletDef
|
| 1742 |
* .getDatatypeDefinitionID()).getName());
|
1789 |
* .getDatatypeDefinitionID()).getName());
|
| 1743 |
*
|
1790 |
*
|
| 1744 |
* } }
|
1791 |
* } }
|
| 1745 |
*/
|
1792 |
|
| 1746 |
}
|
1793 |
}
|
| 1747 |
}
|
1794 |
}
|
| 1748 |
System.out.println(sb.toString());
|
1795 |
System.out.println(sb.toString());
|
| 1749 |
return true;
|
1796 |
return true;
|
| 1750 |
}
|
1797 |
}
|
| Line 1947... |
Line 1994... |
| 1947 |
map.put("iOS 5", 110366L);
|
1994 |
map.put("iOS 5", 110366L);
|
| 1948 |
|
1995 |
|
| 1949 |
return map;
|
1996 |
return map;
|
| 1950 |
|
1997 |
|
| 1951 |
}
|
1998 |
}
|
| 1952 |
|
1999 |
*/
|
| 1953 |
private Object clone(Object object) throws Exception{
|
2000 |
private Object clone(Object object) throws Exception{
|
| 1954 |
// Serializing and deserializing to clone the slide
|
2001 |
// Serializing and deserializing to clone the slide
|
| 1955 |
// serialize
|
2002 |
// serialize
|
| 1956 |
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
2003 |
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
| 1957 |
ObjectOutputStream out = new ObjectOutputStream(bos);
|
2004 |
ObjectOutputStream out = new ObjectOutputStream(bos);
|
| Line 1997... |
Line 2044... |
| 1997 |
IOUtils.closeQuietly(in);
|
2044 |
IOUtils.closeQuietly(in);
|
| 1998 |
IOUtils.closeQuietly(out);
|
2045 |
IOUtils.closeQuietly(out);
|
| 1999 |
}
|
2046 |
}
|
| 2000 |
media.setLocation(mediaFilePath);
|
2047 |
media.setLocation(mediaFilePath);
|
| 2001 |
}
|
2048 |
}
|
| 2002 |
|
2049 |
/*
|
| 2003 |
private void migrateHeadSetBack() throws Exception {
|
2050 |
private void migrateHeadSetBack() throws Exception {
|
| 2004 |
Map<Long, Long>migratorMap = new HashMap<Long, Long>();
|
2051 |
Map<Long, Long>migratorMap = new HashMap<Long, Long>();
|
| 2005 |
migratorMap.put(77777000L,1000291L);
|
2052 |
migratorMap.put(77777000L,1000291L);
|
| 2006 |
migratorMap.put(77777001L,1000292L);
|
2053 |
migratorMap.put(77777001L,1000292L);
|
| 2007 |
migratorMap.put(77777002L,1000293L);
|
2054 |
migratorMap.put(77777002L,1000293L);
|
| Line 2111... |
Line 2158... |
| 2111 |
Long newId = entry.getKey();
|
2158 |
Long newId = entry.getKey();
|
| 2112 |
Long validId = entry.getValue();
|
2159 |
Long validId = entry.getValue();
|
| 2113 |
Entity entity = CreationUtils.getEntity(newId);
|
2160 |
Entity entity = CreationUtils.getEntity(newId);
|
| 2114 |
EntityState es = CreationUtils.getEntityState(newId);
|
2161 |
EntityState es = CreationUtils.getEntityState(newId);
|
| 2115 |
Slide sl = entity.getSlide(130130);
|
2162 |
Slide sl = entity.getSlide(130130);
|
| 2116 |
/*entity.setID(validId);
|
2163 |
entity.setID(validId);
|
| 2117 |
es.setID(validId);*/
|
2164 |
es.setID(validId);
|
| 2118 |
|
2165 |
|
| 2119 |
|
2166 |
|
| 2120 |
|
2167 |
|
| 2121 |
CreationUtils.updateEntity(entity);
|
2168 |
CreationUtils.updateEntity(entity);
|
| 2122 |
CreationUtils.updateEntityState(es);
|
2169 |
CreationUtils.updateEntityState(es);
|
| Line 2167... |
Line 2214... |
| 2167 |
|
2214 |
|
| 2168 |
|
2215 |
|
| 2169 |
}
|
2216 |
}
|
| 2170 |
|
2217 |
|
| 2171 |
}
|
2218 |
}
|
| 2172 |
|
2219 |
*/
|
| 2173 |
public String getTitle(Entity entity){
|
2220 |
public String getTitle(Entity entity){
|
| 2174 |
String brand = entity.getBrand();
|
2221 |
String brand = entity.getBrand();
|
| 2175 |
String modelName = entity.getModelName();
|
2222 |
String modelName = entity.getModelName();
|
| 2176 |
String modelNumber = entity.getModelNumber();
|
2223 |
String modelNumber = entity.getModelNumber();
|
| 2177 |
String titleString = "";
|
2224 |
String titleString = "";
|
| Line 2198... |
Line 2245... |
| 2198 |
} else {
|
2245 |
} else {
|
| 2199 |
System.out.println("category is null for : " + expEntity.getID());
|
2246 |
System.out.println("category is null for : " + expEntity.getID());
|
| 2200 |
return "";
|
2247 |
return "";
|
| 2201 |
}
|
2248 |
}
|
| 2202 |
}
|
2249 |
}
|
| 2203 |
|
2250 |
/*
|
| 2204 |
public void migrateTablets() throws Exception {
|
2251 |
public void migrateTablets() throws Exception {
|
| 2205 |
|
2252 |
|
| 2206 |
//Starting entity id for new Category with 10000
|
2253 |
//Starting entity id for new Category with 10000
|
| 2207 |
Collection<Entity> entities = CreationUtils.getEntities(10010);
|
2254 |
Collection<Entity> entities = CreationUtils.getEntities(10010);
|
| 2208 |
long newCounter;
|
2255 |
long newCounter;
|
| Line 2215... |
Line 2262... |
| 2215 |
List<Slide> entitySlides = entity.getSlides();
|
2262 |
List<Slide> entitySlides = entity.getSlides();
|
| 2216 |
if (entity == null || entitySlides == null) {
|
2263 |
if (entity == null || entitySlides == null) {
|
| 2217 |
continue;
|
2264 |
continue;
|
| 2218 |
}
|
2265 |
}
|
| 2219 |
List<Slide> newEntitySlides = new ArrayList<Slide>();
|
2266 |
List<Slide> newEntitySlides = new ArrayList<Slide>();
|
| 2220 |
/*Slide introSlide = entity.getSlide(130001);
|
2267 |
Slide introSlide = entity.getSlide(130001);
|
| 2221 |
Slide summarySlide = entity.getSlide(130054);
|
2268 |
Slide summarySlide = entity.getSlide(130054);
|
| 2222 |
Slide packageContents = entity.getSlide(130025);*/
|
2269 |
Slide packageContents = entity.getSlide(130025);
|
| 2223 |
for (Slide slide : entitySlides) {
|
2270 |
for (Slide slide : entitySlides) {
|
| 2224 |
if (Arrays.asList(130054L, 130025L, 130001L).contains(slide.getSlideDefinitionID())) {
|
2271 |
if (Arrays.asList(130054L, 130025L, 130001L).contains(slide.getSlideDefinitionID())) {
|
| 2225 |
slide=(Slide)this.clone(slide);
|
2272 |
slide=(Slide)this.clone(slide);
|
| 2226 |
newEntitySlides.add(slide);
|
2273 |
newEntitySlides.add(slide);
|
| 2227 |
}
|
2274 |
}
|
| Line 2288... |
Line 2335... |
| 2288 |
if (newEntity == null) {
|
2335 |
if (newEntity == null) {
|
| 2289 |
continue;
|
2336 |
continue;
|
| 2290 |
}
|
2337 |
}
|
| 2291 |
Slide introSlide = newEntity.getSlide(130001L);
|
2338 |
Slide introSlide = newEntity.getSlide(130001L);
|
| 2292 |
Slide looknfeelSlide = entity.getSlide(130002L);
|
2339 |
Slide looknfeelSlide = entity.getSlide(130002L);
|
| 2293 |
/*
|
2340 |
|
| 2294 |
* Slide introSlide = entity.getSlide(130001); Slide
|
2341 |
* Slide introSlide = entity.getSlide(130001); Slide
|
| 2295 |
* summarySlide = entity.getSlide(130054); Slide packageContents
|
2342 |
* summarySlide = entity.getSlide(130054); Slide packageContents
|
| 2296 |
* = entity.getSlide(130025);
|
2343 |
* = entity.getSlide(130025);
|
| 2297 |
*/
|
2344 |
|
| 2298 |
|
2345 |
|
| 2299 |
if (looknfeelSlide != null) {
|
2346 |
if (looknfeelSlide != null) {
|
| 2300 |
FreeformContent ffc1 = looknfeelSlide.getFreeformContent();
|
2347 |
FreeformContent ffc1 = looknfeelSlide.getFreeformContent();
|
| 2301 |
if (ffc1 != null) {
|
2348 |
if (ffc1 != null) {
|
| 2302 |
Map<String, Media> mediaMap = ffc1.getMedias();
|
2349 |
Map<String, Media> mediaMap = ffc1.getMedias();
|
| Line 2339... |
Line 2386... |
| 2339 |
System.out.println("Could not migrate " + entityId);
|
2386 |
System.out.println("Could not migrate " + entityId);
|
| 2340 |
}
|
2387 |
}
|
| 2341 |
}
|
2388 |
}
|
| 2342 |
|
2389 |
|
| 2343 |
|
2390 |
|
| 2344 |
}
|
2391 |
}*/
|
| 2345 |
private void miscilleniousPopulate() throws Exception{
|
2392 |
/*private void miscilleniousPopulate() throws Exception{
|
| 2346 |
|
2393 |
|
| 2347 |
DefinitionsContainer defContainer = Catalog.getInstance().getDefinitionsContainer();
|
2394 |
DefinitionsContainer defContainer = Catalog.getInstance().getDefinitionsContainer();
|
| 2348 |
|
2395 |
|
| 2349 |
//Get All Enum Values of Communication facilities 70114;
|
2396 |
//Get All Enum Values of Communication facilities 70114;
|
| 2350 |
Map <Long, Entity> allEntities = CreationUtils.getEntities();
|
2397 |
Map <Long, Entity> allEntities = CreationUtils.getEntities();
|
| 2351 |
/*Map <Long, Entity> allEntities =new HashMap<Long, Entity>();
|
2398 |
Map <Long, Entity> allEntities =new HashMap<Long, Entity>();
|
| 2352 |
allEntities.put(1000069l, CreationUtils.getEntity(1000069l));*/
|
2399 |
allEntities.put(1000069l, CreationUtils.getEntity(1000069l));
|
| 2353 |
for (Map.Entry<Long, Entity> entry:allEntities.entrySet()){
|
2400 |
for (Map.Entry<Long, Entity> entry:allEntities.entrySet()){
|
| 2354 |
Entity entity = entry.getValue();
|
2401 |
Entity entity = entry.getValue();
|
| 2355 |
Long categoryId = entity.getCategoryID();
|
2402 |
Long categoryId = entity.getCategoryID();
|
| 2356 |
EntityState es = CreationUtils.getEntityState(entity.getID());
|
2403 |
EntityState es = CreationUtils.getEntityState(entity.getID());
|
| 2357 |
if ((categoryId == 10002 || categoryId == 10003 || categoryId == 10004 || categoryId == 10005)
|
2404 |
if ((categoryId == 10002 || categoryId == 10003 || categoryId == 10004 || categoryId == 10005)
|
| Line 2502... |
Line 2549... |
| 2502 |
}
|
2549 |
}
|
| 2503 |
|
2550 |
|
| 2504 |
private void step4() throws Exception {
|
2551 |
private void step4() throws Exception {
|
| 2505 |
//Get All Enum Values of Communication facilities 70114;
|
2552 |
//Get All Enum Values of Communication facilities 70114;
|
| 2506 |
Map <Long, Entity> allEntities = CreationUtils.getEntities();
|
2553 |
Map <Long, Entity> allEntities = CreationUtils.getEntities();
|
| 2507 |
/*Map <Long, Entity> allEntities = new HashMap<Long, Entity>();
|
2554 |
Map <Long, Entity> allEntities = new HashMap<Long, Entity>();
|
| 2508 |
allEntities.put(1002529l, CreationUtils.getEntity(1002529l));
|
2555 |
allEntities.put(1002529l, CreationUtils.getEntity(1002529l));
|
| 2509 |
allEntities.put(1007932l, CreationUtils.getEntity(1007932l));
|
2556 |
allEntities.put(1007932l, CreationUtils.getEntity(1007932l));
|
| 2510 |
allEntities.put(1007930l, CreationUtils.getEntity(1007930l));
|
2557 |
allEntities.put(1007930l, CreationUtils.getEntity(1007930l));
|
| 2511 |
allEntities.put(1007934l, CreationUtils.getEntity(1007934l));
|
2558 |
allEntities.put(1007934l, CreationUtils.getEntity(1007934l));
|
| 2512 |
allEntities.put(1007936l, CreationUtils.getEntity(1007936l));
|
2559 |
allEntities.put(1007936l, CreationUtils.getEntity(1007936l));
|
| 2513 |
allEntities.put(1007935l, CreationUtils.getEntity(1007935l));*/
|
2560 |
allEntities.put(1007935l, CreationUtils.getEntity(1007935l));
|
| 2514 |
for (Map.Entry<Long, Entity> entry:allEntities.entrySet()){
|
2561 |
for (Map.Entry<Long, Entity> entry:allEntities.entrySet()){
|
| 2515 |
Entity entity = entry.getValue();
|
2562 |
Entity entity = entry.getValue();
|
| 2516 |
Long categoryId = entity.getCategoryID();
|
2563 |
Long categoryId = entity.getCategoryID();
|
| 2517 |
EntityState es = CreationUtils.getEntityState(entity.getID());
|
2564 |
EntityState es = CreationUtils.getEntityState(entity.getID());
|
| 2518 |
if ((categoryId == 10002 || categoryId == 10003 || categoryId == 10004 || categoryId == 10005) && es != null && !es.getStatus().equals(EntityStatus.UNASSIGNED)) {
|
2565 |
if ((categoryId == 10002 || categoryId == 10003 || categoryId == 10004 || categoryId == 10005) && es != null && !es.getStatus().equals(EntityStatus.UNASSIGNED)) {
|
| Line 2678... |
Line 2725... |
| 2678 |
as[tabletFds.indexOf(entry.getKey())] = entry.getValue();
|
2725 |
as[tabletFds.indexOf(entry.getKey())] = entry.getValue();
|
| 2679 |
}
|
2726 |
}
|
| 2680 |
sb.append(entity.getID() + "\t").append(StringUtils.join(as, "\t")).append("\n");
|
2727 |
sb.append(entity.getID() + "\t").append(StringUtils.join(as, "\t")).append("\n");
|
| 2681 |
}
|
2728 |
}
|
| 2682 |
System.out.println(sb);
|
2729 |
System.out.println(sb);
|
| 2683 |
}
|
2730 |
}*/
|
| 2684 |
|
2731 |
|
| 2685 |
private void migrateSoftCategories() throws Exception{
|
2732 |
/* private void migrateSoftCategories() throws Exception{
|
| 2686 |
Long ANDROID = 110614l;
|
2733 |
Long ANDROID = 110614l;
|
| 2687 |
Long WINDOWS = 110615l;
|
2734 |
Long WINDOWS = 110615l;
|
| 2688 |
Long DUALSIM = 110616l;
|
2735 |
Long DUALSIM = 110616l;
|
| 2689 |
Long TRISIM = 110617l;
|
2736 |
Long TRISIM = 110617l;
|
| 2690 |
Long CDMA = 110618l;
|
2737 |
Long CDMA = 110618l;
|
| Line 2962... |
Line 3009... |
| 2962 |
}
|
3009 |
}
|
| 2963 |
}
|
3010 |
}
|
| 2964 |
CreationUtils.storeExpertReview(entry.getKey(), ers);
|
3011 |
CreationUtils.storeExpertReview(entry.getKey(), ers);
|
| 2965 |
}
|
3012 |
}
|
| 2966 |
}
|
3013 |
}
|
| 2967 |
|
3014 |
*/
|
| 2968 |
private List<ExpertReview> getExpertReviews(long catalogId) throws Exception {
|
3015 |
private List<ExpertReview> getExpertReviews(long catalogId) throws Exception {
|
| 2969 |
List<ExpertReview> expertReviews = CreationUtils.getExpertReviewByEntity(catalogId);
|
3016 |
List<ExpertReview> expertReviews = CreationUtils.getExpertReviewByEntity(catalogId);
|
| 2970 |
if(expertReviews != null) {
|
3017 |
if(expertReviews != null) {
|
| 2971 |
Iterator<ExpertReview> iter = expertReviews.iterator();
|
3018 |
Iterator<ExpertReview> iter = expertReviews.iterator();
|
| 2972 |
while (iter.hasNext()){
|
3019 |
while (iter.hasNext()){
|