2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.policy.pap.xacml.rest.controller;
27 import java.io.FileOutputStream;
28 import java.io.FileReader;
29 import java.io.OutputStream;
30 import java.util.List;
32 import javax.servlet.http.HttpServletRequest;
33 import javax.servlet.http.HttpServletResponse;
35 import org.apache.commons.compress.utils.IOUtils;
36 import org.apache.commons.fileupload.FileItem;
37 import org.apache.commons.fileupload.disk.DiskFileItemFactory;
38 import org.apache.commons.fileupload.servlet.ServletFileUpload;
39 import org.openecomp.policy.rest.dao.ActionListDao;
40 import org.openecomp.policy.rest.dao.ActionPolicyDictDao;
41 import org.openecomp.policy.rest.dao.AddressGroupDao;
42 import org.openecomp.policy.rest.dao.AttributeDao;
43 import org.openecomp.policy.rest.dao.BRMSParamTemplateDao;
44 import org.openecomp.policy.rest.dao.DecisionPolicyDao;
45 import org.openecomp.policy.rest.dao.DescriptiveScopeDao;
46 import org.openecomp.policy.rest.dao.EcompNameDao;
47 import org.openecomp.policy.rest.dao.PEPOptionsDao;
48 import org.openecomp.policy.rest.dao.PortListDao;
49 import org.openecomp.policy.rest.dao.PrefixListDao;
50 import org.openecomp.policy.rest.dao.ProtocolListDao;
51 import org.openecomp.policy.rest.dao.SecurityZoneDao;
52 import org.openecomp.policy.rest.dao.ServiceDictionaryDao;
53 import org.openecomp.policy.rest.dao.ServiceGroupDao;
54 import org.openecomp.policy.rest.dao.ServiceListDao;
55 import org.openecomp.policy.rest.dao.SiteDictionaryDao;
56 import org.openecomp.policy.rest.dao.TermListDao;
57 import org.openecomp.policy.rest.dao.VNFTypeDao;
58 import org.openecomp.policy.rest.dao.VSCLActionDao;
59 import org.openecomp.policy.rest.dao.VarbindDictionaryDao;
60 import org.openecomp.policy.rest.dao.ZoneDao;
61 import org.openecomp.policy.rest.jpa.ActionList;
62 import org.openecomp.policy.rest.jpa.ActionPolicyDict;
63 import org.openecomp.policy.rest.jpa.AddressGroup;
64 import org.openecomp.policy.rest.jpa.Attribute;
65 import org.openecomp.policy.rest.jpa.BRMSParamTemplate;
66 import org.openecomp.policy.rest.jpa.Category;
67 import org.openecomp.policy.rest.jpa.Datatype;
68 import org.openecomp.policy.rest.jpa.DecisionSettings;
69 import org.openecomp.policy.rest.jpa.DescriptiveScope;
70 import org.openecomp.policy.rest.jpa.EcompName;
71 import org.openecomp.policy.rest.jpa.GroupServiceList;
72 import org.openecomp.policy.rest.jpa.PEPOptions;
73 import org.openecomp.policy.rest.jpa.PREFIXLIST;
74 import org.openecomp.policy.rest.jpa.ProtocolList;
75 import org.openecomp.policy.rest.jpa.SecurityZone;
76 import org.openecomp.policy.rest.jpa.ServiceList;
77 import org.openecomp.policy.rest.jpa.TermList;
78 import org.openecomp.policy.rest.jpa.UserInfo;
79 import org.openecomp.policy.rest.jpa.VNFType;
80 import org.openecomp.policy.rest.jpa.VSCLAction;
81 import org.openecomp.policy.rest.jpa.VarbindDictionary;
82 import org.openecomp.policy.rest.jpa.Zone;
83 import org.springframework.beans.factory.annotation.Autowired;
84 import org.springframework.stereotype.Controller;
85 import org.springframework.web.bind.annotation.RequestMapping;
87 import com.fasterxml.jackson.databind.DeserializationFeature;
88 import com.fasterxml.jackson.databind.ObjectMapper;
90 import au.com.bytecode.opencsv.CSVReader;
94 public class DictionaryImportController {
95 private String newFile;
98 AttributeDao attributeDao;
101 ActionPolicyDictDao actionPolicyDictDao;
104 EcompNameDao ecompNameDao;
107 VNFTypeDao vnfTypeDao;
110 VSCLActionDao vsclActionDao;
113 PEPOptionsDao pepOptionsDao;
116 VarbindDictionaryDao varbindDao;
119 ServiceDictionaryDao closedLoopServiceDao;
122 SiteDictionaryDao closedLoopSiteDao;
125 DescriptiveScopeDao descriptiveScopeDao;
128 PrefixListDao prefixListDao;
131 PortListDao portListDao;
134 ProtocolListDao protocolListDao;
137 AddressGroupDao addressGroupDao;
140 ActionListDao actionListDao;
143 SecurityZoneDao securityZoneDao;
146 ServiceGroupDao serviceGroupDao;
149 ServiceListDao serviceListDao;
152 TermListDao termListDao;
158 DecisionPolicyDao decisionSettingsDao;
161 BRMSParamTemplateDao brmsParamTemplateDao;
163 @RequestMapping(value={"/dictionary/import_dictionary.htm/*"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
164 public void ImportDictionaryData(HttpServletRequest request, HttpServletResponse response) throws Exception{
165 ObjectMapper mapper = new ObjectMapper();
166 mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
167 //JsonNode root = mapper.readTree(request.getReader());
168 String userId = request.getPathInfo().substring(request.getPathInfo().lastIndexOf("/")+1);
169 List<FileItem> items = new ServletFileUpload(new DiskFileItemFactory()).parseRequest(request);
170 for (FileItem item : items) {
171 File file = new File(item.getName());
172 OutputStream outputStream = new FileOutputStream(file);
173 IOUtils.copy(item.getInputStream(), outputStream);
174 outputStream.close();
175 this.newFile = file.toString();
176 CSVReader csvReader = new CSVReader(new FileReader(this.newFile));
177 List<String[]> dictSheet = csvReader.readAll();
178 if(item.getName().startsWith("Attribute")){
179 for(int i = 1; i< dictSheet.size(); i++){
180 Attribute attribute = new Attribute("", userId);
181 UserInfo userinfo = new UserInfo();
182 userinfo.setUserLoginId(userId);
183 attribute.setUserCreatedBy(userinfo);
184 attribute.setUserModifiedBy(userinfo);
185 String[] rows = dictSheet.get(i);
186 for (int j=0 ; j<rows.length; j++ ){
187 if(dictSheet.get(0)[j].equalsIgnoreCase("xacml_id") || dictSheet.get(0)[j].equalsIgnoreCase("Attribute ID")){
188 attribute.setXacmlId(rows[j]);
190 if(dictSheet.get(0)[j].equalsIgnoreCase("description")){
191 attribute.setDescription(rows[j]);
193 if(dictSheet.get(0)[j].equalsIgnoreCase("priority")){
194 attribute.setPriority(rows[j]);
196 if(dictSheet.get(0)[j].equalsIgnoreCase("datatype") || dictSheet.get(0)[j].equalsIgnoreCase("Data Type")){
197 Datatype dataType = new Datatype();
198 if(rows[j].equalsIgnoreCase("string")){
200 }else if(rows[j].equalsIgnoreCase("integer")){
202 }else if(rows[j].equalsIgnoreCase("double")){
204 }else if(rows[j].equalsIgnoreCase("boolean")){
206 }else if(rows[j].equalsIgnoreCase("user")){
209 attribute.setDatatypeBean(dataType);
210 Category category = new Category();
212 attribute.setCategoryBean(category);
214 if(dictSheet.get(0)[j].equalsIgnoreCase("attribute_value") || dictSheet.get(0)[j].equalsIgnoreCase("Attribute Value")){
215 attribute.setAttributeValue(rows[j]);
218 attributeDao.Save(attribute);
221 if(item.getName().startsWith("ActionPolicyDictionary")){
222 for(int i = 1; i< dictSheet.size(); i++){
223 ActionPolicyDict attribute = new ActionPolicyDict("", userId);
224 UserInfo userinfo = new UserInfo();
225 userinfo.setUserLoginId(userId);
226 attribute.setUserCreatedBy(userinfo);
227 attribute.setUserModifiedBy(userinfo);
228 String[] rows = dictSheet.get(i);
229 for (int j=0 ; j<rows.length; j++ ){
230 if(dictSheet.get(0)[j].equalsIgnoreCase("attribute_name") || dictSheet.get(0)[j].equalsIgnoreCase("Attribute Name")){
231 attribute.setAttributeName(rows[j]);
233 if(dictSheet.get(0)[j].equalsIgnoreCase("body")){
234 attribute.setBody(rows[j]);
236 if(dictSheet.get(0)[j].equalsIgnoreCase("description")){
237 attribute.setDescription(rows[j]);
239 if(dictSheet.get(0)[j].equalsIgnoreCase("headers")){
240 attribute.setHeader(rows[j]);
242 if(dictSheet.get(0)[j].equalsIgnoreCase("method")){
243 attribute.setMethod(rows[j]);
245 if(dictSheet.get(0)[j].equalsIgnoreCase("type")){
246 attribute.setMethod(rows[j]);
248 if(dictSheet.get(0)[j].equalsIgnoreCase("url")){
249 attribute.setMethod(rows[j]);
252 actionPolicyDictDao.Save(attribute);
255 if(item.getName().startsWith("EcompName")){
256 for(int i = 1; i< dictSheet.size(); i++){
257 EcompName attribute = new EcompName("", userId);
258 UserInfo userinfo = new UserInfo();
259 userinfo.setUserLoginId(userId);
260 attribute.setUserCreatedBy(userinfo);
261 attribute.setUserModifiedBy(userinfo);
262 String[] rows = dictSheet.get(i);
263 for (int j=0 ; j<rows.length; j++ ){
264 if(dictSheet.get(0)[j].equalsIgnoreCase("ecomp_name") || dictSheet.get(0)[j].equalsIgnoreCase("Ecomp Name")){
265 attribute.setEcompName(rows[j]);
267 if(dictSheet.get(0)[j].equalsIgnoreCase("description")){
268 attribute.setDescription(rows[j]);
271 ecompNameDao.Save(attribute);
274 if(item.getName().startsWith("VNFType")){
275 for(int i = 1; i< dictSheet.size(); i++){
276 VNFType attribute = new VNFType("", userId);
277 UserInfo userinfo = new UserInfo();
278 userinfo.setUserLoginId(userId);
279 attribute.setUserCreatedBy(userinfo);
280 attribute.setUserModifiedBy(userinfo);
281 String[] rows = dictSheet.get(i);
282 for (int j=0 ; j<rows.length; j++ ){
283 if(dictSheet.get(0)[j].equalsIgnoreCase("vnf_type") || dictSheet.get(0)[j].equalsIgnoreCase("VNF Type")){
284 attribute.setVnftype(rows[j]);
286 if(dictSheet.get(0)[j].equalsIgnoreCase("description")){
287 attribute.setDescription(rows[j]);
290 vnfTypeDao.Save(attribute);
293 if(item.getName().startsWith("VSCLAction")){
294 for(int i = 1; i< dictSheet.size(); i++){
295 VSCLAction attribute = new VSCLAction("", userId);
296 UserInfo userinfo = new UserInfo();
297 userinfo.setUserLoginId(userId);
298 attribute.setUserCreatedBy(userinfo);
299 attribute.setUserModifiedBy(userinfo);
300 String[] rows = dictSheet.get(i);
301 for (int j=0 ; j<rows.length; j++ ){
302 if(dictSheet.get(0)[j].equalsIgnoreCase("vscl_action") || dictSheet.get(0)[j].equalsIgnoreCase("VSCL Action")){
303 attribute.setVsclaction(rows[j]);
305 if(dictSheet.get(0)[j].equalsIgnoreCase("description")){
306 attribute.setDescription(rows[j]);
309 vsclActionDao.Save(attribute);
312 if(item.getName().startsWith("PEPOptions")){
313 for(int i = 1; i< dictSheet.size(); i++){
314 PEPOptions attribute = new PEPOptions("", userId);
315 UserInfo userinfo = new UserInfo();
316 userinfo.setUserLoginId(userId);
317 attribute.setUserCreatedBy(userinfo);
318 attribute.setUserModifiedBy(userinfo);
319 String[] rows = dictSheet.get(i);
320 for (int j=0 ; j<rows.length; j++ ){
321 if(dictSheet.get(0)[j].equalsIgnoreCase("PEP_NAME") || dictSheet.get(0)[j].equalsIgnoreCase("PEP Name")){
322 attribute.setPepName(rows[j]);
324 if(dictSheet.get(0)[j].equalsIgnoreCase("description")){
325 attribute.setDescription(rows[j]);
327 if(dictSheet.get(0)[j].equalsIgnoreCase("Actions")){
328 attribute.setActions(rows[j]);
331 pepOptionsDao.Save(attribute);
334 if(item.getName().startsWith("VarbindDictionary")){
335 for(int i = 1; i< dictSheet.size(); i++){
336 VarbindDictionary attribute = new VarbindDictionary("", userId);
337 UserInfo userinfo = new UserInfo();
338 userinfo.setUserLoginId(userId);
339 attribute.setUserCreatedBy(userinfo);
340 attribute.setUserModifiedBy(userinfo);
341 String[] rows = dictSheet.get(i);
342 for (int j=0 ; j<rows.length; j++ ){
343 if(dictSheet.get(0)[j].equalsIgnoreCase("varbind_Name") || dictSheet.get(0)[j].equalsIgnoreCase("Varbind Name")){
344 attribute.setVarbindName(rows[j]);
346 if(dictSheet.get(0)[j].equalsIgnoreCase("varbind_Description") || dictSheet.get(0)[j].equalsIgnoreCase("Varbind Description")){
347 attribute.setVarbindDescription(rows[j]);
349 if(dictSheet.get(0)[j].equalsIgnoreCase("varbind_oid") || dictSheet.get(0)[j].equalsIgnoreCase("Varbind OID")){
350 attribute.setVarbindOID(rows[j]);
353 varbindDao.Save(attribute);
356 if(item.getName().startsWith("BRMSParamDictionary")){
357 for(int i = 1; i< dictSheet.size(); i++){
358 BRMSParamTemplate attribute = new BRMSParamTemplate();
359 UserInfo userinfo = new UserInfo();
360 userinfo.setUserLoginId(userId);
361 attribute.setUserCreatedBy(userinfo);
362 String[] rows = dictSheet.get(i);
363 for (int j=0 ; j<rows.length; j++ ){
364 if(dictSheet.get(0)[j].equalsIgnoreCase("param_template_name") || dictSheet.get(0)[j].equalsIgnoreCase("Rule Name")){
365 attribute.setRuleName(rows[j]);
367 if(dictSheet.get(0)[j].equalsIgnoreCase("DESCRIPTION") || dictSheet.get(0)[j].equalsIgnoreCase("Description")){
368 attribute.setDescription(rows[j]);
370 if(dictSheet.get(0)[j].equalsIgnoreCase("rule")){
371 attribute.setRule(rows[j]);
374 brmsParamTemplateDao.Save(attribute);
377 if(item.getName().startsWith("Settings")){
378 for(int i = 1; i< dictSheet.size(); i++){
379 DecisionSettings attribute = new DecisionSettings("", userId);
380 UserInfo userinfo = new UserInfo();
381 userinfo.setUserLoginId(userId);
382 attribute.setUserCreatedBy(userinfo);
383 attribute.setUserModifiedBy(userinfo);
384 String[] rows = dictSheet.get(i);
385 for (int j=0 ; j<rows.length; j++ ){
386 if(dictSheet.get(0)[j].equalsIgnoreCase("xacml_id") || dictSheet.get(0)[j].equalsIgnoreCase("Settings ID")){
387 attribute.setXacmlId(rows[j]);
389 if(dictSheet.get(0)[j].equalsIgnoreCase("description")){
390 attribute.setDescription(rows[j]);
392 if(dictSheet.get(0)[j].equalsIgnoreCase("priority")){
393 attribute.setPriority(rows[j]);
395 if(dictSheet.get(0)[j].equalsIgnoreCase("datatype") || dictSheet.get(0)[j].equalsIgnoreCase("Data Type")){
396 Datatype dataType = new Datatype();
397 if(rows[j].equalsIgnoreCase("string")){
399 }else if(rows[j].equalsIgnoreCase("integer")){
401 }else if(rows[j].equalsIgnoreCase("double")){
403 }else if(rows[j].equalsIgnoreCase("boolean")){
405 }else if(rows[j].equalsIgnoreCase("user")){
408 attribute.setDatatypeBean(dataType);
411 decisionSettingsDao.Save(attribute);
414 if(item.getName().startsWith("PrefixList")){
415 for(int i = 1; i< dictSheet.size(); i++){
416 PREFIXLIST attribute = new PREFIXLIST("", userId);
417 String[] rows = dictSheet.get(i);
418 for (int j=0 ; j<rows.length; j++ ){
419 if(dictSheet.get(0)[j].equalsIgnoreCase("prefixListName") || dictSheet.get(0)[j].equalsIgnoreCase("PrefixList Name")){
420 attribute.setPrefixListName(rows[j]);
422 if(dictSheet.get(0)[j].equalsIgnoreCase("description")){
423 attribute.setPrefixListValue(rows[j]);
425 if(dictSheet.get(0)[j].equalsIgnoreCase("prefixListValue") || dictSheet.get(0)[j].equalsIgnoreCase("PrefixList Value")){
426 attribute.setDescription(rows[j]);
429 prefixListDao.Save(attribute);
432 if(item.getName().startsWith("SecurityZone")){
433 for(int i = 1; i< dictSheet.size(); i++){
434 SecurityZone attribute = new SecurityZone("", userId);
435 String[] rows = dictSheet.get(i);
436 for (int j=0 ; j<rows.length; j++ ){
437 if(dictSheet.get(0)[j].equalsIgnoreCase("zoneName") || dictSheet.get(0)[j].equalsIgnoreCase("Zone Name")){
438 attribute.setZoneName(rows[j]);
440 if(dictSheet.get(0)[j].equalsIgnoreCase("zoneValue") || dictSheet.get(0)[j].equalsIgnoreCase("Zone Value")){
441 attribute.setZoneValue(rows[j]);
444 securityZoneDao.Save(attribute);
447 if(item.getName().startsWith("Zone")){
448 for(int i = 1; i< dictSheet.size(); i++){
449 Zone attribute = new Zone("", userId);
450 String[] rows = dictSheet.get(i);
451 for (int j=0 ; j<rows.length; j++ ){
452 if(dictSheet.get(0)[j].equalsIgnoreCase("zoneName") || dictSheet.get(0)[j].equalsIgnoreCase("Zone Name")){
453 attribute.setZoneName(rows[j]);
455 if(dictSheet.get(0)[j].equalsIgnoreCase("zoneValue") || dictSheet.get(0)[j].equalsIgnoreCase("Zone Value")){
456 attribute.setZoneValue(rows[j]);
459 zoneDao.Save(attribute);
462 if(item.getName().startsWith("ServiceList")){
463 for(int i = 1; i< dictSheet.size(); i++){
464 ServiceList attribute = new ServiceList("", userId);
465 String[] rows = dictSheet.get(i);
466 for (int j=0 ; j<rows.length; j++ ){
467 if(dictSheet.get(0)[j].equalsIgnoreCase("serviceName") || dictSheet.get(0)[j].equalsIgnoreCase("Service Name")){
468 attribute.setServiceName(rows[j]);
470 if(dictSheet.get(0)[j].equalsIgnoreCase("serviceDesc") || dictSheet.get(0)[j].equalsIgnoreCase("Description")){
471 attribute.setServiceDescription(rows[j]);
473 if(dictSheet.get(0)[j].equalsIgnoreCase("serviceType") || dictSheet.get(0)[j].equalsIgnoreCase("Service Type")){
474 attribute.setServiceType(rows[j]);
476 if(dictSheet.get(0)[j].equalsIgnoreCase("serviceTrasProtocol") || dictSheet.get(0)[j].equalsIgnoreCase("Transport Protocol")){
477 attribute.setServiceTransProtocol(rows[j]);
479 if(dictSheet.get(0)[j].equalsIgnoreCase("serviceAppProtocol") || dictSheet.get(0)[j].equalsIgnoreCase("APP Protocol")){
480 attribute.setServiceAppProtocol(rows[j]);
482 if(dictSheet.get(0)[j].equalsIgnoreCase("servicePorts") || dictSheet.get(0)[j].equalsIgnoreCase("Ports")){
483 attribute.setServicePorts(rows[j]);
486 serviceListDao.Save(attribute);
489 if(item.getName().startsWith("ServiceGroup")){
490 for(int i = 1; i< dictSheet.size(); i++){
491 GroupServiceList attribute = new GroupServiceList("", userId);
492 String[] rows = dictSheet.get(i);
493 for (int j=0 ; j<rows.length; j++ ){
494 if(dictSheet.get(0)[j].equalsIgnoreCase("name") || dictSheet.get(0)[j].equalsIgnoreCase("Group Name")){
495 attribute.setGroupName(rows[j]);
497 if(dictSheet.get(0)[j].equalsIgnoreCase("serviceList") || dictSheet.get(0)[j].equalsIgnoreCase("Service List")){
498 attribute.setServiceList(rows[j]);
501 serviceGroupDao.Save(attribute);
504 if(item.getName().startsWith("AddressGroup")){
505 for(int i = 1; i< dictSheet.size(); i++){
506 AddressGroup attribute = new AddressGroup("", userId);
507 String[] rows = dictSheet.get(i);
508 for (int j=0 ; j<rows.length; j++ ){
509 if(dictSheet.get(0)[j].equalsIgnoreCase("name") || dictSheet.get(0)[j].equalsIgnoreCase("Group Name")){
510 attribute.setGroupName(rows[j]);
512 if(dictSheet.get(0)[j].equalsIgnoreCase("serviceList") || dictSheet.get(0)[j].equalsIgnoreCase("Prefix List")){
513 attribute.setServiceList(rows[j]);
515 if(dictSheet.get(0)[j].equalsIgnoreCase("description")){
516 attribute.setDescription(rows[j]);
519 addressGroupDao.Save(attribute);
522 if(item.getName().startsWith("ProtocolList")){
523 for(int i = 1; i< dictSheet.size(); i++){
524 ProtocolList attribute = new ProtocolList("", userId);
525 String[] rows = dictSheet.get(i);
526 for (int j=0 ; j<rows.length; j++ ){
527 if(dictSheet.get(0)[j].equalsIgnoreCase("protocolName") || dictSheet.get(0)[j].equalsIgnoreCase("Protocol Name")){
528 attribute.setProtocolName(rows[j]);
530 if(dictSheet.get(0)[j].equalsIgnoreCase("description")){
531 attribute.setDescription(rows[j]);
534 protocolListDao.Save(attribute);
537 if(item.getName().startsWith("ActionList")){
538 for(int i = 1; i< dictSheet.size(); i++){
539 ActionList attribute = new ActionList("", userId);
540 String[] rows = dictSheet.get(i);
541 for (int j=0 ; j<rows.length; j++ ){
542 if(dictSheet.get(0)[j].equalsIgnoreCase("actionName") || dictSheet.get(0)[j].equalsIgnoreCase("Action Name")){
543 attribute.setActionName(rows[j]);
545 if(dictSheet.get(0)[j].equalsIgnoreCase("description")){
546 attribute.setDescription(rows[j]);
549 actionListDao.Save(attribute);
552 if(item.getName().startsWith("TermList")){
553 for(int i = 1; i< dictSheet.size(); i++){
554 TermList attribute = new TermList("", userId);
555 UserInfo userinfo = new UserInfo();
556 userinfo.setUserLoginId(userId);
557 attribute.setUserCreatedBy(userinfo);
558 attribute.setUserModifiedBy(userinfo);
559 String[] rows = dictSheet.get(i);
560 for (int j=0 ; j<rows.length; j++ ){
561 if(dictSheet.get(0)[j].equalsIgnoreCase("termName") || dictSheet.get(0)[j].equalsIgnoreCase("Term-Name")){
562 attribute.setTermName(rows[j]);
564 if(dictSheet.get(0)[j].equalsIgnoreCase("Term-Description") || dictSheet.get(0)[j].equalsIgnoreCase("termDescription")){
565 attribute.setDescription(rows[j]);
567 if(dictSheet.get(0)[j].equalsIgnoreCase("fromZone") || dictSheet.get(0)[j].equalsIgnoreCase("From Zone")){
568 attribute.setFromZones(rows[j]);
570 if(dictSheet.get(0)[j].equalsIgnoreCase("toZone") || dictSheet.get(0)[j].equalsIgnoreCase("To Zone")){
571 attribute.setToZones(rows[j]);
573 if(dictSheet.get(0)[j].equalsIgnoreCase("srcIPList") || dictSheet.get(0)[j].equalsIgnoreCase("Source-IP-List")){
574 attribute.setSrcIPList(rows[j]);
576 if(dictSheet.get(0)[j].equalsIgnoreCase("destIPList") || dictSheet.get(0)[j].equalsIgnoreCase("Destination-IP-List")){
577 attribute.setDestIPList(rows[j]);
579 if(dictSheet.get(0)[j].equalsIgnoreCase("srcPortList") || dictSheet.get(0)[j].equalsIgnoreCase("Source-Port-List")){
580 attribute.setSrcPortList(rows[j]);
582 if(dictSheet.get(0)[j].equalsIgnoreCase("destPortList") || dictSheet.get(0)[j].equalsIgnoreCase("Destination-Port-List")){
583 attribute.setDestPortList(rows[j]);
585 if(dictSheet.get(0)[j].equalsIgnoreCase("action") || dictSheet.get(0)[j].equalsIgnoreCase("Action List")){
586 attribute.setAction(rows[j]);
589 termListDao.Save(attribute);
592 if(item.getName().startsWith("SearchCriteria")){
593 for(int i = 1; i< dictSheet.size(); i++){
594 DescriptiveScope attribute = new DescriptiveScope("", userId);
595 UserInfo userinfo = new UserInfo();
596 userinfo.setUserLoginId(userId);
597 attribute.setUserCreatedBy(userinfo);
598 attribute.setUserModifiedBy(userinfo);
599 String[] rows = dictSheet.get(i);
600 for (int j=0 ; j<rows.length; j++ ){
601 if(dictSheet.get(0)[j].equalsIgnoreCase("descriptiveScopeName") || dictSheet.get(0)[j].equalsIgnoreCase("Descriptive ScopeName")){
602 attribute.setScopeName(rows[j]);
604 if(dictSheet.get(0)[j].equalsIgnoreCase("description")){
605 attribute.setDescription(rows[j]);
607 if(dictSheet.get(0)[j].equalsIgnoreCase("search") || dictSheet.get(0)[j].equalsIgnoreCase("Search Criteria")){
608 attribute.setSearch(rows[j]);
611 descriptiveScopeDao.Save(attribute);