| Line 92... |
Line 92... |
| 92 |
if(!UserManager.getUserManager().canUploadContentSheet(this.getUsername())){
|
92 |
if(!UserManager.getUserManager().canUploadContentSheet(this.getUsername())){
|
| 93 |
addActionError("You dont have permission to access this resource");
|
93 |
addActionError("You dont have permission to access this resource");
|
| 94 |
return "deny";
|
94 |
return "deny";
|
| 95 |
}
|
95 |
}
|
| 96 |
|
96 |
|
| 97 |
File fileToCreate = new File("/tmp/", "entity.xls");
|
97 |
File fileToCreate = new File("/tmp/", "entity.xls"+String.valueOf(getTimeInMilliseconds()));
|
| 98 |
FileUtils.copyFile(this.upload, fileToCreate);
|
98 |
FileUtils.copyFile(this.upload, fileToCreate);
|
| 99 |
FileInputStream iFile = new FileInputStream(new File(upload.getAbsolutePath()));
|
99 |
FileInputStream iFile = new FileInputStream(new File(upload.getAbsolutePath()));
|
| 100 |
HSSFWorkbook workbook = new HSSFWorkbook(iFile);
|
100 |
HSSFWorkbook workbook = new HSSFWorkbook(iFile);
|
| 101 |
HSSFSheet sheet = workbook.getSheetAt(0);
|
101 |
HSSFSheet sheet = workbook.getSheetAt(0);
|
| 102 |
|
102 |
|
| Line 130... |
Line 130... |
| 130 |
result.setEntity_id(b.getNew_entity_id());
|
130 |
result.setEntity_id(b.getNew_entity_id());
|
| 131 |
result.setMessage("Category doesn't match");
|
131 |
result.setMessage("Category doesn't match");
|
| 132 |
resultList.add(result);
|
132 |
resultList.add(result);
|
| 133 |
continue;
|
133 |
continue;
|
| 134 |
}
|
134 |
}
|
| - |
|
135 |
|
| - |
|
136 |
if ((existingEntity.getCategoryID()==b.getNew_entity_id())){
|
| - |
|
137 |
BulkContentUploadResult result = new BulkContentUploadResult();
|
| - |
|
138 |
result.setEntity_id(b.getNew_entity_id());
|
| - |
|
139 |
result.setMessage("New and old entities are same - Ignoring.");
|
| - |
|
140 |
resultList.add(result);
|
| - |
|
141 |
continue;
|
| - |
|
142 |
}
|
| 135 |
|
143 |
|
| 136 |
i.setId(String.valueOf(b.getNew_entity_id()));
|
144 |
i.setId(String.valueOf(b.getNew_entity_id()));
|
| 137 |
Map<String, String[]> reqparams = new HashMap<String, String[]>();
|
145 |
Map<String, String[]> reqparams = new HashMap<String, String[]>();
|
| 138 |
reqparams.put("action", new String[]{"dup-entity"});
|
146 |
reqparams.put("action", new String[]{"dup-entity"});
|
| 139 |
reqparams.put("entity-old", new String[]{String.valueOf(b.getExisting_entity_id())});
|
147 |
reqparams.put("entity-old", new String[]{String.valueOf(b.getExisting_entity_id())});
|