public ServiceActivityVo checkForServiceActivityUsingChangedProcedure(ActivityRefVo activityRefVo) { DomainFactory factory = getDomainFactory(); if( activityRefVo == null ) throw new DomainRuntimeException("checkForServiceActivityUsingChangedProcedure : activityRefVo is Null."); //wdev3999 - ignore inactive records in this check java.util.List servactList = factory.find("from ServiceActivity servact join servact.taxonomyMap tax where servact.activity.id = :activityid and tax.taxonomyName = :taxname and servact.isActive = :isActive", new String[]{"activityid", "taxname", "isActive"}, new Object[]{activityRefVo.getID_Activity(), getDomLookup(TaxonomyType.EXCH), Boolean.TRUE}); ServiceActivityVoCollection coll = ServiceActivityVoAssembler.createServiceActivityVoCollectionFromServiceActivity(servactList).sort(); if(coll != null && coll.size() > 0) return coll.get(0); return null; }
private boolean activityPricingFor(ServiceActivityVo voSerAct) { String sMessage = ""; if (form.getLocalContext().getSelectedRecordLocationService() != null) { // select linked location service actions if (form.getLocalContext().getSelectedRecordLocationService().getActivitiesIsNotNull()) { for (int i = 0; i < form.getLocalContext().getSelectedRecordLocationService().getActivities().size(); i++) { if (form.getLocalContext().getSelectedRecordLocationService().getActivities().get(i).getServiceActivity().equals(voSerAct)) { sMessage = "The " + ConfigFlag.UI.DISPLAY_NAME_ACTIVITY.getValue(false) + "\r\n\r\n"; sMessage += voSerAct.getActivity().toString() + "\r\n"; engine.showMessage(sMessage + "\r\nhas pricing associated.\r\n\r\nThe " + ConfigFlag.UI.DISPLAY_NAME_ACTIVITY.getValue(false) + " cannot be made inactive."); return true; } } } } return false; }
protected String setToolTipTaxonomy(ServiceActivityVo voActiv, ActivityVo vo) { String out; out = ""; if (voActiv != null) { for (int j = 0; j < voActiv.getTaxonomyMap().size(); j++) { if (voActiv.getTaxonomyMap().get(j).getTaxonomyCodeIsNotNull() && voActiv.getTaxonomyMap().get(j).getTaxonomyNameIsNotNull()) { if (voActiv.getActivity().getID_Activity().equals(vo.getID_Activity())) { out += makeTextile("Taxonomy: ", "SlateBlue", "tahoma", "12"); out += makeTextile((voActiv.getTaxonomyMap().get(j).getTaxonomyNameIsNotNull() ? voActiv.getTaxonomyMap().get(j).getTaxonomyName().toString() : ""), "black", "tahoma", "12"); out += makeTextile(" Code: ", "SlateBlue", "tahoma", "12"); out += makeTextile((voActiv.getTaxonomyMap().get(j).getTaxonomyCodeIsNotNull() ? voActiv.getTaxonomyMap().get(j).getTaxonomyCode() : "") + "<br>", "black", "tahoma", "12"); } } } } return out; }
private boolean checkMultipleSpecProcEXCHCode(ServiceActivityVo voServiceAct) { if (voServiceAct.getTaxonomyMapIsNotNull()) { int nCount = 0; Boolean bFound = false; for (int j = 0; j < voServiceAct.getTaxonomyMap().size(); j++) { if (voServiceAct.getTaxonomyMap().get(j).getTaxonomyNameIsNotNull() && voServiceAct.getTaxonomyMap().get(j).getTaxonomyName().equals(TaxonomyType.EXCH)) { nCount++; bFound = true; } } if (nCount > 1) { engine.showMessage("There are more then one Procedure Exchequer codes configured. Please remove one."); return false; } return bFound; } return false; }
private void getActivityTaxonomy(ServiceActivityVo vo, boolean isReadOnly) { if ((vo != null) && (vo.getTaxonomyMapIsNotNull()) && vo.getTaxonomyMap().size() > 0) { form.lyr1().Edit().lyrActivityFunction().tabPageActivity().grdActivityTaxonomy().getRows().clear(); grdActivityTaxonomyRow rowActTaxonomy; for (int i = 0; i < vo.getTaxonomyMap().size(); i++) { rowActTaxonomy = form.lyr1().Edit().lyrActivityFunction().tabPageActivity().grdActivityTaxonomy().getRows().newRow(); rowActTaxonomy.setValue(vo.getTaxonomyMap().get(i)); rowActTaxonomy.setcolCode(vo.getTaxonomyMap().get(i).getTaxonomyCodeIsNotNull() ? vo.getTaxonomyMap().get(i).getTaxonomyCode() : null); rowActTaxonomy.setcolExtCodeType(vo.getTaxonomyMap().get(i).getTaxonomyNameIsNotNull() ? vo.getTaxonomyMap().get(i).getTaxonomyName() : null); rowActTaxonomy.setReadOnly(isReadOnly); } form.lyr1().Edit().lyrActivityFunction().tabPageActivity().grdActivityTaxonomy().setReadOnly(isReadOnly); } }
public void removeServiceActivity(ims.core.vo.ServiceActivityVo voServiceActivity) throws ims.domain.exceptions.StaleObjectException, ims.domain.exceptions.ForeignKeyViolationException, ims.domain.exceptions.UniqueKeyViolationException { DomainFactory factory = getDomainFactory(); ServiceActivity doServiceActivity = ServiceActivityVoAssembler.extractServiceActivity(factory, voServiceActivity); try { factory.delete(doServiceActivity); } catch (DomainRuntimeException e) // SN: catching // DomainRuntimeException here as // this is what Hib is returning // with e.getCause() = // ConstrainViolationException { throw new UniqueKeyViolationException(e.getMessage()); } }
public ServiceActivityVo getServiceActivity(ServiceRefVo serviceRefVo, ActivityRefVo activityRefVo) { DomainFactory factory = getDomainFactory(); if ((serviceRefVo == null) || (activityRefVo == null)) throw new DomainRuntimeException("getServiceActivity : Either serviceRefVo or activityRefVo are Null."); // java.util.List servactList = factory.find("from ServiceActivity servact where servact.service.id = :serviceid and servact.activity.id = :activityid", new String[]{"serviceid", "activityid"}, new Object[]{serviceRefVo.getID_Service(), activityRefVo.getID_Activity()}); //entpf473 wdev-6344 java.util.List servactList = factory.find("from ServiceActivity servact where servact.service.id = :serviceid and servact.activity.id = :activityid and servact.isActive = :isAct", new String[]{"serviceid", "activityid", "isAct"}, new Object[]{serviceRefVo.getID_Service(), activityRefVo.getID_Activity(), Boolean.TRUE}); ServiceActivityVoCollection coll = ServiceActivityVoAssembler.createServiceActivityVoCollectionFromServiceActivity(servactList).sort(); if (coll != null && coll.size() > 0) return coll.get(0); return null; }
private String formatServiceActivityTooltip(ServiceActivityVo voServiceActivity) { String out = formatServicevoTooltip(voServiceActivity.getService()); out += makeTextile("*" + ConfigFlag.UI.DISPLAY_NAME_ACTIVITY.getValue(true) + ": *", "DarkRed", "tahoma", "14"); out += makeTextile(voServiceActivity.getActivityIsNotNull() ? voServiceActivity.getActivity().getName() : "", (voServiceActivity.getIsActive().booleanValue() ? "black" : "red"), "tahoma", "12"); return new TextileString(out).toString(); }
private boolean checkMandatorySpecProcEXCHCode(ServiceActivityVo voServiceAct) { if (voServiceAct.getTaxonomyMapIsNotNull()) { for (int j = 0; j < voServiceAct.getTaxonomyMap().size(); j++) { if (voServiceAct.getTaxonomyMap().get(j).getTaxonomyNameIsNotNull() && voServiceAct.getTaxonomyMap().get(j).getTaxonomyName().equals(TaxonomyType.EXCH)) { return true; } } } return false; }
private ServiceActivityVo inActivityList(ActivityVo value, ServiceActivityVoCollection voVollActivity) { if (voVollActivity != null && voVollActivity.size() > 0) { for (int i = 0; i < voVollActivity.size(); i++) { if (voVollActivity.get(i).getActivityIsNotNull() && voVollActivity.get(i).getActivity().equals(value)) return voVollActivity.get(i); } } return null; }
private void setupdateActivityTaxonomy() { boolean bFound = false; if (form.lyr1().Edit().lyrActivityFunction().tabPageActivity().grdActivityTaxonomy().getRows() != null) { for (int i = 0; i < form.lyr1().Edit().lyrActivityFunction().tabPageActivity().grdActivityTaxonomy().getRows().size(); i++) { form.lyr1().Edit().lyrActivityFunction().tabPageActivity().grdActivityTaxonomy().getRows().get(i).setReadOnly(false); TaxonomyMap mp = form.lyr1().Edit().lyrActivityFunction().tabPageActivity().grdActivityTaxonomy().getRows().get(i).getValue(); if (mp != null && mp.getTaxonomyName() != null && mp.getTaxonomyName().equals(TaxonomyType.EXCH)) bFound = true; } } form.getContextMenus().Admin.getTaxonomyGridAddTaxonomyItem().setText("Add a new Taxonomy code"); grdActivityRow row; row = form.lyr1().Edit().lyrActivityFunction().tabPageActivity().grdActivity().getSelectedRow(); ServiceActivityVo vo = inActivityList(row.getValue(), form.getLocalContext().getserviceActivities()); form.getLocalContext().setSelectedRecordActivity(vo); if (!bFound) getActivityTaxonomy(vo, true); else getActivityTaxonomy(vo, false); }
protected void onGrdActivitySelectionChanged() throws PresentationLogicException { if (form.getLocalContext().getSelectedActivityIsNotNull() && ConfigFlag.DOM.ENABLE_EXCHEQUER_CODES_VALIDATION.getValue()) { if (didPreviousDisplayedActivityTaxonomyHaveEXCH(form.getLocalContext().getSelectedActivity())) { form.lyr1().Edit().lyrActivityFunction().tabPageActivity().grdActivity().setValue(form.getLocalContext().getSelectedActivity()); return; } } grdActivityRow row; row = form.lyr1().Edit().lyrActivityFunction().tabPageActivity().grdActivity().getSelectedRow(); form.getLocalContext().setSelectedActivity(row.getValue()); if (form.getLocalContext().getSelectedRecordIsNotNull()) saveServiceActivityTaxonomy(form.getLocalContext().getSelectedRecord()); else saveServiceActivityTaxonomy(populateDataFromScreen(new ServiceVo())); //WDEV-16672 updateDetailsTabContextMenusState(); form.getContextMenus().getGenericGridUpdateItem().setText("Edit " + ConfigFlag.UI.DISPLAY_NAME_ACTIVITY.getValue(false) + " Taxonomy"); form.lyr1().Edit().lyrActivityFunction().tabPageActivity().grdActivityTaxonomy().setEnabled(true); form.lyr1().Edit().lyrActivityFunction().tabPageActivity().grdActivityTaxonomy().setReadOnly(false); form.lyr1().Edit().lyrActivityFunction().tabPageActivity().grdActivityTaxonomy().getRows().clear(); ServiceActivityVo vo = inActivityList(row.getValue(), form.getLocalContext().getserviceActivities()); form.getLocalContext().setSelectedRecordActivity(vo); getActivityTaxonomy(vo, true); }
public String checkLSALinks(ServiceActivityVo voServiceActivity) throws DomainInterfaceException { if (voServiceActivity != null) { // check if an active Location Service Activity records LocationService impl = (LocationService) getDomainImpl(LocationServiceImpl.class); LocationServiceActivityVo voLocSerAct = new LocationServiceActivityVo(); voLocSerAct.setServiceActivity(voServiceActivity); voLocSerAct.setIsActive(new Boolean(true)); LocationServiceVo voLocSer = new LocationServiceVo(); ServiceVo voSer = new ServiceVo(); voSer.setID_Service(voServiceActivity.getService().getID_Service()); voSer.setIsActive(voServiceActivity.getService().getIsActive()); voLocSer.setService(voSer); voLocSerAct.setLocationService(voLocSer); LocationServiceActivityVoCollection voColl = impl.listLocationServiceActivity(voLocSerAct.getLocationService(), voLocSerAct.getServiceActivity().getActivity()); if (voColl != null && voColl.size() > 0) { String activeMessage = "The following " + ConfigFlag.UI.DISPLAY_NAME_LOCATION.getValue(false) + "," + ConfigFlag.UI.DISPLAY_NAME_SERVICE.getValue(false) + "," + ConfigFlag.UI.DISPLAY_NAME_ACTIVITY.getValue(false) + " links are still active.\r\n"; for (int j = 0; j < voColl.size(); j++) { activeMessage += "\r\n" + ConfigFlag.UI.DISPLAY_NAME_LOCATION.getValue(false) + " : " + (voColl.get(j).getLocationService().getLocation().getNameIsNotNull() ? voColl.get(j).getLocationService().getLocation().getName() : ""); activeMessage += " " + ConfigFlag.UI.DISPLAY_NAME_SERVICE.getValue(false) + " : " + (voColl.get(j).getLocationService().getService().getServiceNameIsNotNull() ? voColl.get(j).getLocationService().getService().getServiceName() : ""); for (int k = 0; k < voColl.get(j).getLocationService().getActivities().size(); k++) { if (voColl.get(j).getLocationService().getActivities().get(k).getServiceActivity().getActivityIsNotNull()) { activeMessage += "\r\n" + ConfigFlag.UI.DISPLAY_NAME_ACTIVITY.getValue(false) + " : " + (voColl.get(j).getLocationService().getActivities().get(k).getServiceActivity().getActivity().getNameIsNotNull() ? voColl.get(j).getLocationService().getActivities().get(k).getServiceActivity().getActivity().getName() : ""); } } } return activeMessage; } } return null; }