Impl JAVA
Impl JAVA
*
*/
package com.amdocs.oms.cust.activities;
import java.util.Date;
import javax.swing.ToolTipManager;
import amdocs.epi.util.params.StringHolder;
import com.amdocs.oms.activities.UpdateOrderActionAttributes;
import com.amdocs.oms.cust.common.CommonUtilities;
import com.amdocs.oms.cust.common.GUIConstants;
import com.amdocs.oms.cust.order.OrderingFrameworkImpl;
import com.amdocs.oms.phd.activities.UpdateOrderActionAttributesPHD;
import com.amdocs.uif.action.UifAction;
import com.amdocs.uif.action.UifCancellableActionEvent;
import com.amdocs.uif.action.UifSubmitAction;
import com.amdocs.uif.action.UifSubscribingAction;
import com.amdocs.uif.data.UifDataModel;
import com.amdocs.uif.data.UifTabularDataModel;
import com.amdocs.uif.event.UifEvent;
import com.amdocs.uif.widgets.UifCheckBox;
import com.amdocs.uif.widgets.UifComboBox;
import com.amdocs.uif.widgets.UifDateTime;
import com.amdocs.uif.widgets.UifLabel;
import com.amdocs.uif.widgets.UifTextField;
import com.amdocs.uif.workspace.UifForm;
import com.amdocs.uif.workspace.UifFormEvent;
/**
* @author kirilo
*
*/
/** Author: Daria Dudkin
* Supervisor: Yakir Fadida
* Change Date: 2/17/2014
* Change Number: Tef#1
* Change Description: disable return device when it owned and block the province
and locality in Cease or suspend or provide OA
* Task TS - OMS - CR000 - IL - Refactoring UOAA screen GUI side
*
-----------------------------------------------------------------------------------
----
* Author: Iyar Madmon
* Supervisor: Aviv Garama
* Change Date: 6/11/2014
* Change Number: Tef#2
* Change Description: Validate Similarity in acquisition types.
* Task TS - OMS - CR103 - IL - Triangulated - NPC validations
*
-----------------------------------------------------------------------------------
----
* Author: Iyar Madmon
* Supervisor: Aviv Garama
* Change Date: 6/12/2014
* Change Number: Tef#3
* Change Description: remove the isEnableReturnDevice method and moving the logic
to the uiff, by adding
* a binding to enable of the return device check
box
* TS - OMS - PR11 - IL - fix return device check box enabling
*
-----------------------------------------------------------------------------------
----
* Author: Shefali Shetty
* Supervisor: Shruti Chavan
* Change Date: 11/28/2014
* Change Number: Phase3#001
* Change Description: make Locality,Province invisible for Provide Wireline flow
and removed checkIfNextAllowed since its same as checkIfSaveAllowed
*
-----------------------------------------------------------------------------------
----
* Author: Emerson Ferreira
* Supervisor: Cesar Abe
* Change Date: 01 Sep 2015
* Change Number: TEF_GLX_P1 TA593
* Task Name: ReturnDevice checkbox
* -------------------------------------------------------------------------------
* Author: Matheus Colussi
* Supervisor: Cesar Abe
* Change Date: 08 Oct 2015
* Change Number: TEF_GLX#01
* Task Name: Fix for defect 8587
* -------------------------------------------------------------------------------
*/
//GLX #1 - Start
protected UifDateTime dtFutureResumeDate;
protected UifCheckBox cbFutureResumeDate;
protected UifDateTime dtStartDate;
public static final String suspendOrderActionType = "SU";
public UifDataModel actionType;
//GLX #1 - End
/**
* Description: this method will be called every time the selected value in
* the Province drop down is changed. and by that refreshing the localities
* list of valid values.
*
* @param UifEvent
* event
*/
public void cmbProvince_PostValueChange(UifEvent event) {
if (((UifComboBox) event.getSource()).getSelectedIndex() != -1) {
cmbLocality.setEnabled(true);
cmbLocality.setEditable(true);
} else {
cmbLocality.setEnabled(false);
cmbLocality.setEditable(false);
}
UpdateOrderActionAttributesSdoVDM.setStringValue("LocationX9", null);
}
// start Tef#1
public void cmbProvince_EnableProv() {
if ((Boolean) this.UpdateOrderActionAttributesSdoVDM
.getValue("IsToBlockProvAndLocaGroupX9")) {
cmbProvince.setEnabled(true);
cmbProvince.setEditable(true);
} else {
cmbProvince.setEnabled(false);
cmbProvince.setEditable(false);
cmbLocality.setEnabled(false);
cmbLocality.setEditable(false);
}
/**
* Description: this method is in charge of setting the action's input.
*
* @param UifCancellableActionEvent
* event
*/
public void retrieveLocationDetails_ActionStart(
UifCancellableActionEvent event) {
retrivalModeEnumDM.setValue("Value", "KeysOnly");
retrieveLocationDetailsInputDM.setValue("RetrivalModeX9",
retrivalModeEnumDM);
}
/**
* method to include ToolTip when needed.
*
* @version TEF_GLX_P1 TA593
*
* @author Emerson Ferreira
* @since 02/09/2015
*
* @param event
*/
public void form_PostOpen(UifFormEvent event) {
super.form_postOpen(event);
cmbProvince_EnableProv();
setDatesForFutureOrder();
}
/**
* The method iterates over each active SDO and checks whether mandatory
* fields were populated for saving
*
* @param N
* /A
*
* @return boolean
*/
protected boolean checkIfSaveAllowed(StringHolder errorMessageHolder) {
UifTabularDataModel sdos = (UifTabularDataModel) getContainingForm()
.getDataset().getDataModelByName("stepInstancesTDM");
String actionType =
this.UpdateOrderActionAttributesSdoVDM.getValue("OrderAction:OrderActionDetails:Act
ionType:ValueAsString").toString();
return true;
}
/**
* Method returns action for saving and validating activity
**/
public UifAction getSaveAndValidateActivityAction() {
return saveAndValidateActivityData;
}
/**
* Method returns action for saving activity
**/
public UifAction getSaveActivityAction() {
return saveActivityData;
}
/**
* The method is called once "Save" button is clicked Checks if all
* mandatory parameters were populated for "Save" action
*
* @param UifCancellableActionEvent
* event
*
* @return N/A
*/
public void saveActivityData_ActionStart(UifCancellableActionEvent event) {
onHoldNavigation.setEnabled(false);
saveActivityData.setEnabled(true);
onHoldNavigation.setEnabled(true);
}
/**
* The method is called once "Next" button is clicked Checks if all
* mandatory parameters were populated for "Next" action
*
* @param UifCancellableActionEvent
* event
*
* @return N/A
*/
public void saveAndValidateActivityData_ActionStart(
UifCancellableActionEvent event) {
onHoldNavigation.setEnabled(false);
saveActivityData.setEnabled(true);
onHoldNavigation.setEnabled(true);
}
// start Tef#2
/**
* The method validates that there aren't both "purchased" and
* "triangulated" acquisition types in one order. Relevant only for cease
* and change and in a return device situation. The method is called both
* from "saveActivityData_ActionStart" and
* "saveAndValidateActivityData_ActionStart".
*/
private boolean validateSimilarityOfAcquisitionType(
StringHolder errorMessageHolder) {
String designatedAcquisitionType = null;
UifDataModel curStepInstDM;
String curAcquisitionType;
Boolean isReturnDevice;
Boolean isPurchasedOrTriangulated;
curAcquisitionType = curStepInstDM
.getStringValue("StepDataObject:AcquisitionTypeX9");
isReturnDevice = (Boolean) curStepInstDM
.getValue("StepDataObject:ReturnDeviceX9");
isPurchasedOrTriangulated =
GUIConstants.ACQUISITION_TYPE_PURCHASED
.equals(curAcquisitionType)
|| GUIConstants.ACQUISITION_TYPE_TRIANGULATED
.equals(curAcquisitionType);
if (designatedAcquisitionType == null) {
designatedAcquisitionType = curAcquisitionType;
} else if (!designatedAcquisitionType.equals(curAcquisitionType))
{
errorMessageHolder
.setValue(getString(NON_SIMILIAR_ACQUISITION_TY
PES_CN));
return false;
}
}
return true;
}
/**
* @param event
* The event object.
*/
// Phase3#001-start
public void form_PreLoad(UifFormEvent event) {
// TODO Auto-generated method stub
super.form_PreLoad(event);
//(getWorkspace().findForms(null, null,
"com.amdocs.crm.common.contextmanager.ContextManagerUtilityForm", null)[0]);
if (((com.amdocs.uif.data.UifDataModel) this.getTopLevelForm()
.getDataset().getDataModelByName("InstallationAddressDM"))
.getStringValue("AddressIDX9") != null) {
lblLocality.setVisible(false);
lblProvince.setVisible(false);
cmbProvince.setVisible(false);
cmbLocality.setVisible(false);
} else {
lblLocality.setVisible(true);
lblProvince.setVisible(true);
cmbProvince.setVisible(true);
cmbLocality.setVisible(true);
cmbProvince.setRequired(true);
cmbLocality.setRequired(true);
}
}// Phase3#001-end
/**
* @param event
* The event object.
*/
public void form_PostDataModelsCreate(UifFormEvent event) {
// TODO Auto-generated method stub
super.form_PostDataModelsCreate(event);
}
// end Tef#2
// Start TEF_GLX#01
@Override
public void cmbReason_PostValueChange(UifEvent event) {
if (null != reasonId) {
if (null == fieldValue) {
this.cmbReason.setSelectedValue(reasonId);
this.txtaReasonText.setEditable(true);
this.txtaReasonText.setEnabled(true);
if ((null != reasonText) && (!reasonText.equals(""))) {
this.UpdateOrderActionAttributesSdoVDM.setValue(
"ReasonFreeText", reasonText.toString());
}
}
}
if (null == fieldValue) {
if ((this.txtaReasonText.getText() != null) && (null !=
reasonText)
&& (reasonText.equals(""))) {
this.UpdateOrderActionAttributesSdoVDM.setValue(
"ReasonFreeText", null);
}
this.cmbReason.setSelectedValue(null);
this.txtaReasonText.setEditable(false);
this.txtaReasonText.setEnabled(false);
} else {
this.txtaReasonText.setEditable(true);
this.txtaReasonText.setEnabled(true);
}
}
// End TEF_GLX#01
//GLX #1 - Start
/**
*
*/
/*private void setDatesForFutureOrder() {
calculatedDM.setValue("minSRDDate", minSRDDate);
calculatedDM.setValue("maxSRDDate", maxSRDDate);
dtServiceRequiredDate.setDate(minSRDDate);
dtDueDate.setDate(minSRDDate);
}
}*/
/**
* @param event The event object.
*/
public void dtServiceRequiredDate_PostValueChange(UifEvent event)
{
super.dtServiceRequiredDate_PostValueChange(event);
onHoldNavigation.setEnabled(true);
}
//GLX #1 - End