private void populateSearchServiceGrid(ServiceVoLiteVoCollection serviceColl) { form.grdSearchService().getRows().clear(); if(serviceColl == null || serviceColl.size() < 1) return; for(int i = 0; i < serviceColl.size();i++) { ServiceVoLiteVo record = serviceColl.get(i); if (record == null) continue; grdSearchServiceRow newRow = form.grdSearchService().getRows().newRow(); newRow.setColumnServiceName(record.getServiceName()); newRow.setColumnSelect(Boolean.FALSE); newRow.setValue(record); } }
private void populateSelectedServiceGrid(ServiceVoLiteVoCollection serviceColl) { if(serviceColl == null || serviceColl.size() < 1) return; for(int i = 0; i < serviceColl.size();i++) { ServiceVoLiteVo record = serviceColl.get(i); if (record == null) continue; grdSelectedServicesRow newRow = form.grdSelectedServices().getRows().newRow(); newRow.setColumnServiceName(record.getServiceName()); newRow.setColumnSelect(Boolean.TRUE); newRow.setValue(record); } }
private void updateMenuContext() { if(form.getMode().equals(FormMode.VIEW)) { form.getContextMenus().RefMan.hideAllServiceLocationMenuMenuItems(); form.getContextMenus().RefMan.hideAllCCGContextMenuMenuItems(); //wdev-18409 } else { form.getContextMenus().RefMan.getServiceLocationMenuAddServiceItem().setVisible(true); form.getContextMenus().RefMan.getServiceLocationMenuAddLocationItem().setVisible(form.ctnDetails().lyrDetails().tabPage2().treSericeLocation().getSelectedNode() != null && (form.ctnDetails().lyrDetails().tabPage2().treSericeLocation().getSelectedNode().getValue() instanceof ServiceVoLiteVo || form.ctnDetails().lyrDetails().tabPage2().treSericeLocation().getSelectedNode() != null && form.ctnDetails().lyrDetails().tabPage2().treSericeLocation().getSelectedNode().getValue() instanceof ConfigLocationLiteVo)); form.getContextMenus().RefMan.getServiceLocationMenuRemoveServiceItem().setVisible(form.ctnDetails().lyrDetails().tabPage2().treSericeLocation().getSelectedNode() != null && form.ctnDetails().lyrDetails().tabPage2().treSericeLocation().getSelectedNode().getValue() instanceof ServiceVoLiteVo ); form.getContextMenus().RefMan.getServiceLocationMenuRemoveLocationItem().setVisible(form.ctnDetails().lyrDetails().tabPage2().treSericeLocation().getSelectedNode() != null && form.ctnDetails().lyrDetails().tabPage2().treSericeLocation().getSelectedNode().getValue() instanceof ConfigLocationLiteVo); //wdev-18409 form.getContextMenus().RefMan.hideAllCCGContextMenuMenuItems(); form.getContextMenus().RefMan.getCCGContextMenuADDItem().setVisible(true); form.getContextMenus().RefMan.getCCGContextMenuEDITItem().setVisible(form.ctnDetails().lyrDetails().tabPageCCG().grdCCG().getSelectedRow() != null); form.getContextMenus().RefMan.getCCGContextMenuREMOVEItem().setVisible(form.ctnDetails().lyrDetails().tabPageCCG().grdCCG().getSelectedRow() != null); //------------ } }
private boolean checkIfParentAlreadyExistsinTree(ServiceVoLiteVo parent) { if(parent == null ) return false; for (int i = 0; i < form.ctnDetails().lyrDetails().tabPage2().treSericeLocation().getNodes().size(); i++) { Object obj = form.ctnDetails().lyrDetails().tabPage2().treSericeLocation().getNodes().get(i).getValue(); if ((obj != null) && (obj instanceof ServiceVoLiteVo)) { ServiceVoLiteVo serviceVo = (ServiceVoLiteVo) obj; if ((serviceVo.getID_ServiceIsNotNull()) && (serviceVo.getID_Service().equals(parent.getID_Service()))) { return true; } } } return false; }
private boolean checkIfServiceIsInServiceSelectedGrid(ServiceVoLiteVo service) { if(service == null) return false; for(int i = 0;i < form.grdSelectedServices().getRows().size();i++) { ServiceVoLiteVo tempVo = form.grdSelectedServices().getRows().get(i).getValue(); if(service.getID_ServiceIsNotNull() && service.getID_Service().equals(tempVo.getID_Service())) return true; } return false; }
private boolean setLocInContractServiceLocWithLocNull(ConfigLocationLiteVo tempVo) { if(tempVo == null) throw new CodingRuntimeException(); ContractServiceLocationsConfigVoCollection tempColl = form.getLocalContext().getServiceAndLocation(); if(tempColl == null || tempColl.size()==0) return false; for(int i = 0;i<tempColl.size();i++) { ContractServiceLocationsConfigVo contVo = tempColl.get(i); if(form.ctnDetails().lyrDetails().tabPage2().treSericeLocation().getSelectedNode() != null && form.ctnDetails().lyrDetails().tabPage2().treSericeLocation().getSelectedNode().getValue()!= null ) { ims.framework.controls.TreeNode nodeTree = (ims.framework.controls.TreeNode) form.ctnDetails().lyrDetails().tabPage2().treSericeLocation().getSelectedNode(); while( nodeTree.getParent() != null) nodeTree = nodeTree.getParent(); //get the parent (service node) ServiceVoLiteVo service = (ServiceVoLiteVo) nodeTree.getValue(); if(service != null && contVo.getServiceIsNotNull() && service.getID_ServiceIsNotNull() && service.getID_Service().equals(contVo.getService().getID_Service())) { if(contVo.getLocation() == null) { tempColl.get(i).setLocation(tempVo); form.getLocalContext().setServiceAndLocation(tempColl); return true; } } } } return false; }
private boolean checkIfLocationIsConectedToService(ConfigLocationLiteVo tempVo) { if(tempVo == null) throw new CodingRuntimeException(); ContractServiceLocationsConfigVoCollection tempColl = form.getLocalContext().getServiceAndLocation(); if(tempColl == null || tempColl.size() == 0) return false; for(int i = 0;i<tempColl.size();i++) { ContractServiceLocationsConfigVo contVo = tempColl.get(i); if(contVo == null || contVo.getLocation() == null) continue; if(form.ctnDetails().lyrDetails().tabPage2().treSericeLocation().getSelectedNode() != null && form.ctnDetails().lyrDetails().tabPage2().treSericeLocation().getSelectedNode().getValue()!= null ) { ims.framework.controls.TreeNode nodeTree = (ims.framework.controls.TreeNode) form.ctnDetails().lyrDetails().tabPage2().treSericeLocation().getSelectedNode(); while( nodeTree.getParent() != null) nodeTree = nodeTree.getParent(); //get the parent (service node) ServiceVoLiteVo service = (ServiceVoLiteVo) nodeTree.getValue(); if(service != null && contVo.getServiceIsNotNull() && service.getID_ServiceIsNotNull() && service.getID_Service().equals(contVo.getService().getID_Service())) { if(tempVo.getID_LocationIsNotNull() && tempVo.getID_Location().equals(contVo.getLocation().getID_Location())) return true; } } } return false; }
void populateParentsTree(ServiceVoLiteVoCollection services) { if(services == null) return; for(int i = 0; i < services.size();i++ ) { if(checkIfParentAlreadyExistsinTree(services.get(i))) continue; ContractServiceLocationsConfigVo tempContractVo = new ContractServiceLocationsConfigVo(); ServiceVoLiteVo temVo = services.get(i); tempContractVo.setService(temVo); tempContractVo.setLocation(null); //tempContractVo.setIsActive(Boolean.TRUE); ContractServiceLocationsConfigVoCollection tempColl = form.getLocalContext().getServiceAndLocation(); if(tempColl == null) tempColl = new ContractServiceLocationsConfigVoCollection(); tempColl.add(tempContractVo); form.getLocalContext().setServiceAndLocation(tempColl); form.ctnDetails().lyrDetails().tabPage2().treSericeLocation().getNodes().add(temVo, temVo.getServiceName()); //form.ctnDetails().lyrDetails().tabPage2().treSericeLocation().setValue(temVo); form.ctnDetails().lyrDetails().tabPage2().treSericeLocation().setEnabled(true); } }
private void removeService() { if(form.ctnDetails().lyrDetails().tabPage2().treSericeLocation().getSelectedNode().getValue() instanceof ServiceVoLiteVo) { ServiceVoLiteVo serviceVo = (ServiceVoLiteVo) form.ctnDetails().lyrDetails().tabPage2().treSericeLocation().getSelectedNode().getValue(); ContractServiceLocationsConfigVoCollection tempVoColl = form.getLocalContext().getServiceAndLocation(); boolean deleted = true; while(deleted) { deleted = false; for(int i = 0; i < tempVoColl.size(); i++ ) { if (serviceVo.getID_Service().equals(tempVoColl.get(i).getService().getID_Service())) { tempVoColl.remove(i); deleted = true; break; } } }//end of while form.getLocalContext().setServiceAndLocation(tempVoColl); } }
private boolean checkSerices(ServiceVoLiteVo service, ServiceVoLiteVoCollection servicecol) { if (service == null) // WDEV-13720 - Check for null services return true; if(servicecol == null || servicecol.size() == 0 ) return false; for(int i = 0; i < servicecol.size();i++) { if(service.getID_Service().equals(servicecol.get(i).getID_Service())) return true; } return false; }
void populateChildsTree(ConfigLocationLiteVoCollection tempColl) { if(tempColl == null || tempColl.size() == 0) { return; } for(int i = 0;i < tempColl.size();i++) { ConfigLocationLiteVo tempVo = tempColl.get(i); if(tempVo == null) continue; if(checkIfLocationIsConectedToService(tempVo)) continue; if(setLocInContractServiceLocWithLocNull(tempVo)) continue; else { ContractServiceLocationsConfigVoCollection tempContractColl = form.getLocalContext().getServiceAndLocation(); if(tempContractColl == null) tempContractColl = new ContractServiceLocationsConfigVoCollection(); if(form.ctnDetails().lyrDetails().tabPage2().treSericeLocation().getSelectedNode() != null && form.ctnDetails().lyrDetails().tabPage2().treSericeLocation().getSelectedNode().getValue()!= null ) { ims.framework.controls.TreeNode nodeTree = (ims.framework.controls.TreeNode) form.ctnDetails().lyrDetails().tabPage2().treSericeLocation().getSelectedNode(); while( nodeTree.getParent() != null) nodeTree = nodeTree.getParent(); //get the parent (service node) ServiceVoLiteVo service = (ServiceVoLiteVo) nodeTree.getValue(); if(service != null) { ContractServiceLocationsConfigVo tempContractVo = new ContractServiceLocationsConfigVo(); tempContractVo.setService(service); tempContractVo.setLocation(tempVo); //tempContractVo.setIsActive(Boolean.TRUE); tempContractColl.add(tempContractVo); form.getLocalContext().setServiceAndLocation(tempContractColl); } } } } }