Issue #1826 Remove delivery/notify options for subscriptions

Change-Id: Ife37bb70a5b54c3602d5f73de337cb83f37a9509

Former-commit-id: ba51d9a911 [formerly f3526508f3] [formerly 11fd2d676b] [formerly 6bc69df127 [formerly 11fd2d676b [formerly 0bf00ff025ea916aeb0ee4cb093163cbd9cfe931]]]
Former-commit-id: 6bc69df127
Former-commit-id: 481cf7d3351795f1186b2ad2e6947bdd0e75d0ee [formerly b78f56f1ca]
Former-commit-id: 0578916ec1
This commit is contained in:
Dustin Johnson 2013-04-08 11:33:39 -05:00
parent 73a8bb7a02
commit a93be0ad07
25 changed files with 226 additions and 480 deletions

View file

@ -1,135 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.datadelivery.common.ui;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import com.raytheon.viz.ui.presenter.components.ComboBoxConf;
/**
* This is the subscription delivery options composite. This class is intended
* to be extended so common classes can be created and shared.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 27, 2012 702 jpiatt Initial creation.
* Aug 29, 2012 223 mpduff Refactor change.
*
* </pre>
*
* @author jpiatt
* @version 1.0
*/
public class DeliveryOptionsComp extends Composite {
/** Deliver combo box. */
private Combo deliverCombo;
/**
* Constructor.
*
* @param parent
* Parent composite.
*/
public DeliveryOptionsComp(Composite parent) {
super(parent, SWT.NONE);
init();
}
/**
* Initialize method.
*/
private void init() {
/*
* Setup the layout for the composite
*/
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
GridLayout gl = new GridLayout(1, true);
gl.verticalSpacing = 2;
gl.marginHeight = 2;
gl.marginWidth = 2;
this.setLayout(gl);
this.setLayoutData(gd);
createDeliveryOptionsGroup();
}
/**
* Create the Delivery Options Group
*/
private void createDeliveryOptionsGroup() {
GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
GridLayout gl = new GridLayout(2, false);
Group deliveryOptionsGrp = new Group(this, SWT.NONE);
deliveryOptionsGrp.setLayout(gl);
deliveryOptionsGrp.setLayoutData(gd);
deliveryOptionsGrp.setText(" Subscription Delivery Options ");
Label groupName = new Label(deliveryOptionsGrp, SWT.NONE);
groupName.setText(" Deliver: ");
gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
deliverCombo = new Combo(deliveryOptionsGrp, SWT.READ_ONLY);
deliverCombo.setLayoutData(gd);
}
/**
* Get deliver setting.
*
* @return index
*/
public int getDeliverSetting() {
return deliverCombo.getSelectionIndex();
}
/**
* Set deliver setting.
*
* @param index
*/
public void setDeliverSetting(int index) {
deliverCombo.select(index);
}
public void setDeliveryOptions(String[] deliveryOptions) {
if (deliveryOptions != null && deliveryOptions.length > 0) {
this.deliverCombo.setItems(deliveryOptions);
deliverCombo.select(0);
}
}
public void setDeliveryConfig(ComboBoxConf deliveryCombo) {
deliverCombo.setToolTipText(deliveryCombo.getToolTipText());
}
}

View file

@ -44,7 +44,6 @@ import com.raytheon.uf.common.datadelivery.registry.GriddedCoverage;
import com.raytheon.uf.common.datadelivery.registry.GroupDefinition;
import com.raytheon.uf.common.datadelivery.registry.Subscription;
import com.raytheon.uf.common.datadelivery.registry.handlers.DataDeliveryHandlers;
import com.raytheon.uf.common.datadelivery.registry.handlers.IPendingSubscriptionHandler;
import com.raytheon.uf.common.datadelivery.registry.handlers.ISubscriptionHandler;
import com.raytheon.uf.common.datadelivery.request.DataDeliveryPermission;
import com.raytheon.uf.common.datadelivery.retrieval.util.DataSizeUtils;
@ -58,7 +57,6 @@ import com.raytheon.uf.viz.core.localization.LocalizationManager;
import com.raytheon.uf.viz.datadelivery.filter.MetaDataManager;
import com.raytheon.uf.viz.datadelivery.services.DataDeliveryServices;
import com.raytheon.uf.viz.datadelivery.subscription.GroupDefinitionManager;
import com.raytheon.uf.viz.datadelivery.subscription.ISubscriptionService;
import com.raytheon.uf.viz.datadelivery.subscription.ISubscriptionService.ISubscriptionServiceResult;
import com.raytheon.uf.viz.datadelivery.subscription.SubscriptionService.ForceApplyPromptResponse;
import com.raytheon.uf.viz.datadelivery.subscription.SubscriptionService.IForceApplyPromptDisplayText;
@ -93,6 +91,7 @@ import com.raytheon.viz.ui.widgets.duallist.IUpdate;
* Nov 20, 2012 1286 djohnson Fix formatting, implement IDisplay to display yes/no prompt.
* Dec 10, 2012 1259 bsteffen Switch Data Delivery from LatLon to referenced envelopes.
* Jan 02, 2013 1441 djohnson Access GroupDefinitionManager in a static fashion.
* Apr 08, 2013 1826 djohnson Remove unused code, delivery options.
* </pre>
*
* @author jpiatt
@ -105,9 +104,6 @@ public class UserSelectComp extends Composite implements IUpdate, IDisplay,
private final IUFStatusHandler statusHandler = UFStatus
.getHandler(UserSelectComp.class);
private final String ALREADY_PENDING_SUBSCRIPTION = "There is already an edited version of this subscription.\n\nPlease "
+ "reconcile the pending subscription before making further edits.";
/** User information composite. */
private Composite userComp;
@ -138,21 +134,12 @@ public class UserSelectComp extends Composite implements IUpdate, IDisplay,
private final Set<String> initiallySelectedSubscriptions = new HashSet<String>();
/**
* Registry handler for pending subscriptions.
*/
private final IPendingSubscriptionHandler pendingSubHandler = DataDeliveryHandlers
.getPendingSubscriptionHandler();
/**
* Registry handler for subscriptions.
*/
private final ISubscriptionHandler subHandler = DataDeliveryHandlers
.getSubscriptionHandler();
private final ISubscriptionService subscriptionService = DataDeliveryServices
.getSubscriptionService();
/**
* Constructor.
*
@ -377,8 +364,6 @@ public class UserSelectComp extends Composite implements IUpdate, IDisplay,
for (Subscription subscription : groupSubscriptions) {
// Apply group properties to subscription definition
subscription.setNotify(groupDefinition.getOption() == 1);
subscription.setGroupName(groupName);
// Set duration

View file

@ -42,7 +42,6 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.core.localization.LocalizationManager;
import com.raytheon.uf.viz.datadelivery.common.ui.ActivePeriodComp;
import com.raytheon.uf.viz.datadelivery.common.ui.AreaControlComp;
import com.raytheon.uf.viz.datadelivery.common.ui.DeliveryOptionsComp;
import com.raytheon.uf.viz.datadelivery.common.ui.DurationComp;
import com.raytheon.uf.viz.datadelivery.common.ui.IGroupAction;
import com.raytheon.uf.viz.datadelivery.common.ui.UserSelectComp;
@ -71,6 +70,7 @@ import com.raytheon.viz.ui.presenter.components.WidgetConf;
* Dec 10, 2012 1259 bsteffen Switch Data Delivery from LatLon to referenced envelopes.
* Jan 02, 2013 1441 djohnson Access GroupDefinitionManager in a static fashion.
* Jan 08, 2013 1453 djohnson Split creation and edit dialogs.
* Apr 08, 2013 1826 djohnson Remove delivery options.
*
* </pre>
*
@ -95,9 +95,6 @@ public abstract class BaseGroupDefinitionDlg extends CaveSWTDialog implements
/** The Main Composite */
protected Composite mainComp;
/** The Subscription Delivery Options Composite */
private DeliveryOptionsComp deliverComp;
/** The Subscription Duration Composite */
private DurationComp durComp;
@ -148,7 +145,6 @@ public abstract class BaseGroupDefinitionDlg extends CaveSWTDialog implements
createGroupInfo();
deliverComp = new DeliveryOptionsComp(mainComp);
durComp = new DurationComp(mainComp);
activePeriodComp = new ActivePeriodComp(mainComp);
areaControlComp = new AreaControlComp(mainComp);
@ -157,17 +153,6 @@ public abstract class BaseGroupDefinitionDlg extends CaveSWTDialog implements
createButtons();
}
/*
* (non-Javadoc)
*
* @see com.raytheon.viz.ui.dialogs.CaveSWTDialog#preOpened()
*/
@Override
protected void preOpened() {
deliverComp.setDeliveryOptions(DELIVERY_OPTIONS);
deliverComp.setDeliveryConfig(DELIVERY_COMBO_CONF);
}
/*
* (non-Javadoc)
*
@ -259,7 +244,6 @@ public abstract class BaseGroupDefinitionDlg extends CaveSWTDialog implements
groupDefinition.setOwner(LocalizationManager.getInstance()
.getCurrentUser());
groupDefinition.setGroupName(groupName);
groupDefinition.setOption(deliverComp.getDeliverSetting());
// Set Duration
if (!durComp.isIndefiniteChk()) {
@ -345,10 +329,6 @@ public abstract class BaseGroupDefinitionDlg extends CaveSWTDialog implements
GroupDefinition groupDefinition = GroupDefinitionManager
.getGroup(groupName);
// Set deliverCombo
int delOption = groupDefinition.getOption();
deliverComp.setDeliverSetting(delOption);
// Set duration info
Date sDate = groupDefinition.getSubscriptionStart();
Date eDate = groupDefinition.getSubscriptionEnd();

View file

@ -42,7 +42,6 @@ import com.raytheon.uf.common.datadelivery.registry.Subscription;
import com.raytheon.uf.common.datadelivery.registry.Subscription.SubscriptionPriority;
import com.raytheon.uf.common.datadelivery.registry.ebxml.DataSetQuery;
import com.raytheon.uf.viz.datadelivery.common.ui.ActivePeriodComp;
import com.raytheon.uf.viz.datadelivery.common.ui.DeliveryOptionsComp;
import com.raytheon.uf.viz.datadelivery.common.ui.DurationComp;
import com.raytheon.uf.viz.datadelivery.common.ui.GroupSelectComp;
import com.raytheon.uf.viz.datadelivery.common.ui.PriorityComp;
@ -52,7 +51,6 @@ import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils;
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
import com.raytheon.viz.ui.presenter.components.ButtonConf;
import com.raytheon.viz.ui.presenter.components.CheckBoxConf;
import com.raytheon.viz.ui.presenter.components.ComboBoxConf;
/**
* The Data Delivery Create Subscription Dialog.
@ -81,6 +79,7 @@ import com.raytheon.viz.ui.presenter.components.ComboBoxConf;
* Jan 02, 2013 1441 djohnson Add isGroupSelected().
* Jan 04, 2013 1420 mpduff Add latency.
* Jan 25, 2013 1528 djohnson Use priority enum instead of raw integers.
* Apr 08, 2013 1826 djohnson Remove delivery options.
*
* </pre>
*
@ -96,9 +95,6 @@ public class CreateSubscriptionDlg extends CaveSWTDialog implements
/** The Subscription Group Information Composite */
private GroupSelectComp groupSelectComp;
/** The Subscription Delivery Options Composite */
private DeliveryOptionsComp deliverComp;
/** The Subscription Duration Composite */
private DurationComp durComp;
@ -189,7 +185,6 @@ public class CreateSubscriptionDlg extends CaveSWTDialog implements
createSubscriptionInfoGroup();
groupSelectComp = new GroupSelectComp(mainComp, true);
deliverComp = new DeliveryOptionsComp(mainComp);
durComp = new DurationComp(mainComp);
activePeriodComp = new ActivePeriodComp(mainComp);
@ -354,14 +349,6 @@ public class CreateSubscriptionDlg extends CaveSWTDialog implements
this.open();
}
/**
* {@inheritDoc}
*/
@Override
public int getDeliverySelection() {
return this.deliverComp.getDeliverSetting();
}
/**
* {@inheritDoc}
*/
@ -412,14 +399,6 @@ public class CreateSubscriptionDlg extends CaveSWTDialog implements
return this.groupSelectComp.getGroupName();
}
/**
* {@inheritDoc}
*/
@Override
public void setDeliverySelection(int idx) {
deliverComp.setDeliverSetting(idx);
}
/**
* {@inheritDoc}
*/
@ -588,22 +567,6 @@ public class CreateSubscriptionDlg extends CaveSWTDialog implements
this.activePeriodComp.setStartBtnEnabled(enabled);
}
/**
* {@inheritDoc}
*/
@Override
public void setDeliveryOptionsComboConf(ComboBoxConf deliveryCombo) {
this.deliverComp.setDeliveryConfig(deliveryCombo);
}
/**
* {@inheritDoc}
*/
@Override
public void setDeliveryOptions(String[] deliveryOptions) {
this.deliverComp.setDeliveryOptions(deliveryOptions);
}
/**
* {@inheritDoc}
*/

View file

@ -64,6 +64,7 @@ import com.raytheon.viz.ui.presenter.components.WidgetConf;
* Nov 28, 2012 1286 djohnson Use the subscription service.
* Jan 02, 2013 1441 djohnson Access GroupDefinitionManager in a static fashion.
* Mar 29, 2013 1841 djohnson Subscription is now UserSubscription.
* Apr 08, 2013 1826 djohnson Remove delivery options.
*
* </pre>
*
@ -226,7 +227,6 @@ public class GroupAddDlg extends CaveSWTDialog {
//Apply group properties to subscription definition
if (groupDefinition != null) {
subscription.setNotify(groupDefinition.getOption() == 1);
subscription.setGroupName(groupName);
//Set duration

View file

@ -26,7 +26,6 @@ import com.raytheon.uf.viz.datadelivery.common.ui.ISortTable;
import com.raytheon.uf.viz.datadelivery.common.ui.ITableData;
import com.raytheon.uf.viz.datadelivery.common.ui.SortImages.SortDirection;
import com.raytheon.uf.viz.datadelivery.subscription.SubscriptionManagerDlg.FullDataset;
import com.raytheon.uf.viz.datadelivery.subscription.SubscriptionManagerDlg.SubscriptionNotification;
import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils;
import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils.TABLE_TYPE;
@ -47,6 +46,7 @@ import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils.TABLE_TYPE;
* Aug 21, 2012 712 mpduff Make priorities display as 1, 2, 3.
* Oct 2, 2012 1103 jpiatt Remove unused methods, update enum, code clean up.
* Jan 25, 2012 1528 djohnson Priorities no longer need incrementing for display.
* Apr 08, 2013 1826 djohnson Remove delivery options.
* </pre>
*
* @author mpduff
@ -85,9 +85,6 @@ public class SubscriptionManagerRowData implements ITableData<SubscriptionManage
/** Subscription active period end date. */
private Date activeEnd = null;
/** Subscription Notification enum ref. */
private SubscriptionNotification deliveryNotify = null;
/** Subscription column titles. */
private final String[] columns = DataDeliveryUtils.getColumnTitles(TABLE_TYPE.SUBSCRIPTION);
@ -298,25 +295,6 @@ public class SubscriptionManagerRowData implements ITableData<SubscriptionManage
this.activeEnd = activeEnd;
}
/**
* Get the delivery action.
*
* @return the deliveryNotify
*/
public SubscriptionNotification getDeliveryNotify() {
return deliveryNotify;
}
/**
* Set the delivery action.
*
* @param deliveryNotify
* the deliveryNotify to set
*/
public void setDeliveryNotify(SubscriptionNotification deliveryNotify) {
this.deliveryNotify = deliveryNotify;
}
/**
* Get the subscription details.
*
@ -478,13 +456,6 @@ public class SubscriptionManagerRowData implements ITableData<SubscriptionManage
this.setDataSetSize(subscription.getDataSetSize());
this.setGroupName(subscription.getGroupName());
if (subscription.isNotify()) {
this.setDeliveryNotify(SubscriptionNotification.NOTIFY);
}
else {
this.setDeliveryNotify(SubscriptionNotification.DELIVERY);
}
if (subscription.isFullDataSet()) {
this.setFullDataSet(FullDataset.FULL);
}
@ -510,14 +481,6 @@ public class SubscriptionManagerRowData implements ITableData<SubscriptionManage
* @return sort value
*/
public String getSortValue(String columnName) {
// NAME("Name"), OWNER("Owner"), STATUS("Status"), PRIORITY("Priority"),
// DESCRIPTION(
// "Description"), SUBSCRIPTION_START("Subscription Start"),
// SUBSCRIPTION_EXPIRATION(
// "Subscription Expiration"), ACTIVE_START("Active Period Start"),
// ACTIVE_END(
// "Active Period End"), DELIVERY("Delivery/Notify");
int cIndex = -1;
if (columnName.equals(columns[++cIndex])) {
return this.name;
@ -537,8 +500,6 @@ public class SubscriptionManagerRowData implements ITableData<SubscriptionManage
return columnName;
} else if (columnName.equals(columns[++cIndex])) {
return columnName;
} else if (columnName.equals(columns[++cIndex])) {
return deliveryNotify.toString();
} else if (columnName.equals(columns[++cIndex])) {
return officeId;
} else if (columnName.equals(columns[++cIndex])) {

View file

@ -19,12 +19,9 @@
**/
package com.raytheon.uf.viz.datadelivery.subscription;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.TimeZone;
import java.util.Map;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@ -101,6 +98,7 @@ import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils.TABLE_TYPE;
* Dec 12, 2012 1391 bgonzale Added a job for subscription retrieves.
* Jan 07, 2013 1437 bgonzale Added sort column direction updates.
* Jan 28, 2013 1529 djohnson Disable menu items if no subscriptions are selected.
* Apr 08, 2013 1826 djohnson Remove delivery options, move column value parsing to the columns themselves.
*
* </pre>
*
@ -513,62 +511,8 @@ public class SubscriptionTableComp extends TableComp implements IGroupAction {
* @return The text for the table cell
*/
private String getCellText(String name, SubscriptionManagerRowData rd) {
String returnValue = null;
if (name.equals(SubColumnNames.NAME.toString())) {
returnValue = rd.getName();
} else if (name.equals(SubColumnNames.OWNER.toString())) {
returnValue = rd.getOwner();
} else if (name.equals(SubColumnNames.STATUS.toString())) {
returnValue = rd.getStatus();
} else if (name.equals(SubColumnNames.PRIORITY.toString())) {
returnValue = String.valueOf(rd.getPriority());
} else if (name.equals(SubColumnNames.DESCRIPTION.toString())) {
returnValue = rd.getDescription();
} else if (name.equals(SubColumnNames.SUBSCRIPTION_START.toString())) {
Date date = rd.getSubscriptionStart();
if (date != null) {
SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy HH");
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
returnValue = sdf.format(date) + "Z";
}
} else if (name.equals(SubColumnNames.SUBSCRIPTION_EXPIRATION
.toString())) {
Date date = rd.getSubscriptionEnd();
if (date == null) {
returnValue = "No Expiration";
} else {
SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy HH");
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
returnValue = sdf.format(date) + "Z";
}
} else if (name.equals(SubColumnNames.ACTIVE_START.toString())) {
Date date = rd.getActiveStart();
if (date != null) {
SimpleDateFormat sdf2 = new SimpleDateFormat("MM/dd HH");
sdf2.setTimeZone(TimeZone.getTimeZone("GMT"));
returnValue = sdf2.format(date) + "Z";
}
} else if (name.equals(SubColumnNames.ACTIVE_END.toString())) {
Date date = rd.getActiveEnd();
if (date != null) {
SimpleDateFormat sdf2 = new SimpleDateFormat("MM/dd HH");
sdf2.setTimeZone(TimeZone.getTimeZone("GMT"));
returnValue = sdf2.format(date) + "Z";
}
} else if (name.equals(SubColumnNames.DELIVERY.toString())) {
returnValue = rd.getDeliveryNotify().toString();
} else if (name.equals(SubColumnNames.OFFICE_ID.toString())) {
returnValue = rd.getOfficeId();
} else if (name.equals(SubColumnNames.FULL_DATA_SET.toString())) {
returnValue = rd.getFullDataSet().toString();
} else if (name.equals(SubColumnNames.DATA_SIZE.toString())) {
returnValue = String.valueOf(rd.getDataSetSize());
} else if (name.equals(SubColumnNames.GROUP_NAME.toString())) {
returnValue = rd.getGroupName();
}
return returnValue;
SubColumnNames subColumn = SubColumnNames.fromDisplayString(name);
return subColumn.getRowData(rd);
}
/**
@ -656,9 +600,9 @@ public class SubscriptionTableComp extends TableComp implements IGroupAction {
*/
@Override
public void createColumns() {
SubscriptionConfigurationManager configMan;
configMan = SubscriptionConfigurationManager.getInstance();
HashMap<String, Integer> alignmentMap = configMan.getAlignmentMap();
SubscriptionConfigurationManager configMan = SubscriptionConfigurationManager
.getInstance();
Map<String, Integer> alignmentMap = configMan.getAlignmentMap();
// Get list of columns from config
SubscriptionManagerConfigXML xml = configMan.getXml();

View file

@ -54,6 +54,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* Dec 10, 2012 1259 bsteffen Switch Data Delivery from LatLon to referenced envelopes.
* Jan 25, 2013 1528 djohnson Compare priorities as primitive ints.
* Jan 30, 2013 1543 djohnson Use List instead of ArrayList.
* Apr 08, 2013 1826 djohnson Remove delivery options.
*
* </pre>
*
@ -121,10 +122,6 @@ public class SubscriptionDiff {
diffMap.put("priority", true);
}
if (sub.isNotify() != pendingSub.isNotify()) {
diffMap.put("notify", true);
}
if (sub.isFullDataSet() != pendingSub.isFullDataSet()) {
diffMap.put("fullDataSet", true);
}
@ -483,15 +480,6 @@ public class SubscriptionDiff {
}
}
if (diffMap.get("notify")) {
if (pendingSub.isNotify()) {
buffer.append("Subscription now set to notify when data are available");
} else {
buffer.append("Subscription now set to deliver data when available");
}
buffer.append(nl).append(nl);
}
if (diffMap.get("fullDataSet")) {
if (pendingSub.isFullDataSet()) {
buffer.append("Subscription is now for the Full Data Set");

View file

@ -73,7 +73,6 @@ import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils;
import com.raytheon.viz.ui.presenter.components.ButtonConf;
import com.raytheon.viz.ui.presenter.components.CheckBoxConf;
import com.raytheon.viz.ui.presenter.components.ComboBoxConf;
import com.raytheon.viz.ui.presenter.components.WidgetConf;
/**
* Create Subscription Dialog Presenter Object.
@ -107,6 +106,7 @@ import com.raytheon.viz.ui.presenter.components.WidgetConf;
* Jan 25, 2013 1528 djohnson Use priority enum instead of raw integers, default to existing priority on edit.
* Mar 29, 2013 1841 djohnson Subscription is now UserSubscription.
* Apr 05, 2013 1841 djohnson Add support for shared subscriptions.
* Apr 08, 2013 1826 djohnson Remove delivery options.
* </pre>
*
* @author mpduff
@ -133,14 +133,6 @@ public class CreateSubscriptionDlgPresenter {
/** OK Button config object */
protected final ButtonConf OK_CONF;
/** Delivery combo config object */
protected final ComboBoxConf DELIVERY_COMBO_CONF = new ComboBoxConf(true,
"Select delivery method", WidgetConf.DO_NOTHING);
/** Delivery options strings */
protected final String[] DELIVERY_OPTIONS = new String[] {
"Deliver data when available", "Notify when data are available" };
/** Group combo config object */
protected final ComboBoxConf GROUP_COMBO_CONF;
@ -284,9 +276,6 @@ public class CreateSubscriptionDlgPresenter {
* Initialize the view
*/
public void init() {
view.setDeliveryOptionsComboConf(DELIVERY_COMBO_CONF);
view.setDeliveryOptions(DELIVERY_OPTIONS);
view.setDeliverySelection(0);
view.setOkConf(OK_CONF);
final boolean hasCycleTimes = !cycleTimes.isEmpty();
@ -331,8 +320,6 @@ public class CreateSubscriptionDlgPresenter {
view.setGroupName(subscription.getGroupName());
}
view.setDeliverySelection(subscription.isNotify() ? 0 : 1);
if (subscription.getSubscriptionEnd() != null) {
view.setStartDate(subscription.getSubscriptionStart());
view.setExpirationDate(subscription.getSubscriptionEnd());
@ -445,13 +432,6 @@ public class CreateSubscriptionDlgPresenter {
}
// Data are valid, now add info to the subscription object and store
// to the registry
if (view.getDeliverySelection() == 1) {
subscription.setNotify(true);
} else {
subscription.setNotify(false);
}
subscription.setProvider(dataSet.getProviderName());
if (groupValid && view.isGroupSelected()) {
@ -762,7 +742,6 @@ public class CreateSubscriptionDlgPresenter {
boolean valid = false;
boolean datesValid = false;
boolean activeDatesValid = false;
boolean groupDeliverValid = false;
boolean groupDurValid = false;
boolean groupActiveValid = false;
boolean latencyValid = false;
@ -828,13 +807,6 @@ public class CreateSubscriptionDlgPresenter {
groupDefinition = GroupDefinitionManager.getGroup(view
.getGroupName());
int deliverOption = groupDefinition.getOption();
int formDeliver = view.getDeliverySelection();
if (deliverOption == formDeliver) {
groupDeliverValid = true;
}
// Compare the durations from the form to the group definition
Date durStart = groupDefinition.getSubscriptionStart();
Date durEnd = groupDefinition.getSubscriptionEnd();
@ -889,12 +861,11 @@ public class CreateSubscriptionDlgPresenter {
}
} else {
groupDeliverValid = true;
groupDurValid = true;
groupActiveValid = true;
}
if (!groupDeliverValid || !groupDurValid || !groupActiveValid) {
if (!groupDurValid || !groupActiveValid) {
view.displayErrorPopup(
"Invalid Group Values",
"Values do not match selected group values.\n\n"
@ -926,10 +897,6 @@ public class CreateSubscriptionDlgPresenter {
return;
}
// Set deliverCombo
int delOption = groupDefinition.getOption();
view.setDeliverySelection(delOption);
// Set duration info
Date durStart = groupDefinition.getSubscriptionStart();
Date durEnd = groupDefinition.getSubscriptionEnd();

View file

@ -135,6 +135,7 @@ import com.raytheon.viz.ui.presenter.IDisplay;
* Jan 30, 2013 1543 djohnson Use List instead of ArrayList.
* Mar 21, 2013 1794 djohnson Add option to create a shared subscription, if phase3 code is available.
* Mar 29, 2013 1841 djohnson Subscription is now UserSubscription.
* Apr 08, 2013 1826 djohnson Remove delivery options.
* </pre>
*
* @author mpduff
@ -717,8 +718,6 @@ public abstract class SubsetManagerDlg<DATASET extends DataSet, PRESENTER extend
sub.setDataSetName(dataSet.getDataSetName());
sub.setSubscriptionId("AdHocID");
if (this.subscription != null) {
sub.setNotify(this.subscription.isNotify());
if (this.subscription.getDescription() != null) {
sub.setDescription(subscription.getDescription());
}

View file

@ -30,7 +30,6 @@ import com.raytheon.uf.common.datadelivery.registry.Subscription.SubscriptionPri
import com.raytheon.viz.ui.presenter.IPresenterView;
import com.raytheon.viz.ui.presenter.components.ButtonConf;
import com.raytheon.viz.ui.presenter.components.CheckBoxConf;
import com.raytheon.viz.ui.presenter.components.ComboBoxConf;
/**
* Create Subscription Dialog View Interface.
@ -45,7 +44,8 @@ import com.raytheon.viz.ui.presenter.components.ComboBoxConf;
* Dec 13, 2012 1391 bgonzale Added status methods.
* Jan 02, 2013 1441 djohnson Add isGroupSelected.
* Jan 04, 2013 1420 mpduff Added getters for latency and priority.
* Jan 25, 2013 1528 djohnson Subscription priority is now an enum.
* Jan 25, 2013 1528 djohnson Subscription priority is now an enum.
* Apr 08, 2013 1826 djohnson Remove delivery options.
*
* </pre>
*
@ -96,20 +96,6 @@ public interface ICreateSubscriptionDlgView extends IPresenterView {
*/
void setGroupName(String groupName);
/**
* Get the delivery selection
*
* @return
*/
int getDeliverySelection();
/**
* Set the delivery selection.
*
* @param idx
*/
void setDeliverySelection(int idx);
/**
* Is the no expiration date checkbox checked?
*
@ -280,20 +266,6 @@ public interface ICreateSubscriptionDlgView extends IPresenterView {
*/
void setActiveStartDateBtnEnabled(boolean b);
/**
* Set the delivery options combo config object
*
* @param deliveryComboConf
*/
void setDeliveryOptionsComboConf(ComboBoxConf deliveryComboConf);
/**
* Set the delivery options Strings
*
* @param deliveryOptions
*/
void setDeliveryOptions(String[] deliveryOptions);
/**
* Set the OK button config object.
*

View file

@ -20,11 +20,14 @@
package com.raytheon.uf.viz.datadelivery.utils;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TimeZone;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.MessageBox;
@ -41,6 +44,7 @@ import com.raytheon.uf.common.time.util.TimeUtil;
import com.raytheon.uf.common.util.CollectionUtil;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.requests.ThriftClient;
import com.raytheon.uf.viz.datadelivery.subscription.SubscriptionManagerRowData;
import com.vividsolutions.jts.geom.Coordinate;
/**
@ -64,6 +68,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* Jan 14, 2013 1286 djohnson Fix IndexOutOfBounds exception from getMaxLatency.
* Jan 22, 2013 1519 djohnson Correct getMaxLatency() calculations.
* Jan 30, 2013 1543 djohnson Use List instead of ArrayList.
* Apr 08, 2013 1826 djohnson Add getRowData() method to subscription columns.
* </pre>
*
* @author mpduff
@ -160,34 +165,114 @@ public class DataDeliveryUtils {
/** Enumeration to use for subscription table columns */
public static enum SubColumnNames {
/** Column Name */
NAME("Name", null),
NAME("Name", null) {
@Override
public String getRowData(SubscriptionManagerRowData rd) {
return rd.getName();
}
},
/** Column Owner */
OWNER("Owner", null),
OWNER("Owner", null) {
@Override
public String getRowData(SubscriptionManagerRowData rd) {
return rd.getOwner();
}
},
/** Column Status */
STATUS("Status", null),
STATUS("Status", null) {
@Override
public String getRowData(SubscriptionManagerRowData rd) {
return rd.getStatus();
}
},
/** Column Priority */
PRIORITY("Priority", null),
PRIORITY("Priority", null) {
@Override
public String getRowData(SubscriptionManagerRowData rd) {
return String.valueOf(rd.getPriority());
}
},
/** Column Description */
DESCRIPTION("Description", null),
DESCRIPTION("Description", null) {
@Override
public String getRowData(SubscriptionManagerRowData rd) {
return rd.getDescription();
}
},
/** Column Subscription Start */
SUBSCRIPTION_START("Subscription Start", "Date subscription will begin"),
SUBSCRIPTION_START("Subscription Start", "Date subscription will begin") {
@Override
public String getRowData(SubscriptionManagerRowData rd) {
Date date = rd.getSubscriptionStart();
if (date != null) {
return formatMMddyyyyHH(date);
}
return null;
}
},
/** Column Subscription Expiration */
SUBSCRIPTION_EXPIRATION("Subscription Expiration",
"Date subscription will expire"),
"Date subscription will expire") {
@Override
public String getRowData(SubscriptionManagerRowData rd) {
Date date = rd.getSubscriptionEnd();
if (date == null) {
return "No Expiration";
} else {
return formatMMddyyyyHH(date);
}
}
},
/** Column Active Period Start */
ACTIVE_START("Active Period Start", null),
ACTIVE_START("Active Period Start", null) {
@Override
public String getRowData(SubscriptionManagerRowData rd) {
Date date = rd.getActiveStart();
if (date != null) {
return formatMMddHH(date);
}
return null;
}
},
/** Column Active Period Start */
ACTIVE_END("Active Period End", null),
/** Column Delivery */
DELIVERY("Delivery/Notify", "Delivery or Notify indicator"),
ACTIVE_END("Active Period End", null) {
@Override
public String getRowData(SubscriptionManagerRowData rd) {
Date date = rd.getActiveEnd();
if (date != null) {
return formatMMddHH(date);
}
return null;
}
},
/** Column Office Id */
OFFICE_ID("Office ID", null),
OFFICE_ID("Office ID", null) {
@Override
public String getRowData(SubscriptionManagerRowData rd) {
return rd.getOfficeId();
}
},
/** Column Full Dataset */
FULL_DATA_SET("Full Dataset", null),
FULL_DATA_SET("Full Dataset", null) {
@Override
public String getRowData(SubscriptionManagerRowData rd) {
return rd.getFullDataSet().toString();
}
},
/** Column Data Size */
DATA_SIZE("Data Size", null),
DATA_SIZE("Data Size", null) {
@Override
public String getRowData(SubscriptionManagerRowData rd) {
return String.valueOf(rd.getDataSetSize());
}
},
/** Column Group Name */
GROUP_NAME("Group Name", null);
GROUP_NAME("Group Name", null) {
@Override
public String getRowData(SubscriptionManagerRowData rd) {
return rd.getGroupName();
}
};
/** Column name */
private final String columnName;
@ -222,6 +307,37 @@ public class DataDeliveryUtils {
public String toString() {
return columnName;
}
public abstract String getRowData(SubscriptionManagerRowData rd);
/**
* @param name
* @return
*/
public static SubColumnNames fromDisplayString(String name) {
for (SubColumnNames subColumnName : values()) {
if (subColumnName.toString().equals(name)) {
return subColumnName;
}
}
throw new IllegalArgumentException(
"Unable to find enumeration with display string [" + name
+ "]");
}
private static String formatMMddyyyyHH(Date date) {
return formatDate(date, "MM/dd/yyyy HH");
}
private static String formatMMddHH(Date date) {
return formatDate(date, "MM/dd HH");
}
private static String formatDate(Date date, String format) {
SimpleDateFormat sdf2 = new SimpleDateFormat(format);
sdf2.setTimeZone(TimeZone.getTimeZone("GMT"));
return sdf2.format(date) + "Z";
}
}
/**

View file

@ -0,0 +1,41 @@
#!/bin/bash
SQL_SCRIPT="removeDeliveryOptions.sql"
# ensure that the sql script is present
if [ ! -f ${SQL_SCRIPT} ]; then
echo "ERROR: the required sql script - ${SQL_SCRIPT} was not found."
echo "FATAL: the update has failed!"
exit 1
fi
echo "INFO: update started - removing delivery options from Subscription Manager"
# Update subscription manager configuration files
for DIRECTORY in `find /awips2/edex/data/utility/cave_static/ -type d -name subscriptionManagerConfig`
do
for FILE in `find $DIRECTORY -type f -name *.xml`
do
# Comments out the Delivery/Notify column entry, in case it needs to be restored (rollback scenario)
sed -i 's/\(.*\)<column\(.*Delivery.*\)\/>/\1<!-- column\2\/-->/' $FILE
# Make sure each sed command succeeds
if [ $? -ne 0 ]; then
echo "FATAL: the update has failed!"
exit 1
fi
# Delete the md5 file
rm $FILE.md5
done
done
# Update the database
/awips2/psql/bin/psql -U awips -d metadata -f ${SQL_SCRIPT}
if [ $? -ne 0 ]; then
echo "FATAL: the update has failed!"
exit 1
fi
echo "INFO: the update has completed successfully!"
exit 0

View file

@ -0,0 +1,30 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
\set ON_ERROR_STOP 1
\connect metadata;
-- Start a transaction
BEGIN;
-- Update UserSubscription value entries to not have the notify attribute
update ebxml.value set stringvalue = regexp_replace(stringvalue, 'notify=".*?" ', '', 'g');
-- Commit the transaction
END;

View file

@ -34,6 +34,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* Nov 19, 2012 1166 djohnson Clean up JAXB representation of registry objects.
* Dec 10, 2012 1259 bsteffen Switch Data Delivery from LatLon to referenced envelopes.
* Jan 02, 2013 1441 djohnson Add constants.
* Apr 08, 2013 1826 djohnson Remove delivery options.
*
* </pre>
*
@ -216,24 +217,6 @@ public class GroupDefinition {
this.envelope = envelope;
}
/**
* Get the group delivery option
*
* @return option
*/
public Integer getOption() {
return option;
}
/**
* Set the group delivery option.
*
* @param option
*/
public void setOption(Integer option) {
this.option = option;
}
/**
* Check if this group has areal data associated with it.
*

View file

@ -53,6 +53,7 @@ import com.raytheon.uf.common.time.util.TimeUtil;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 25, 2013 1841 djohnson Extracted from Subscription.
* Apr 08, 2013 1826 djohnson Remove delivery options.
*
* </pre>
*
@ -95,7 +96,6 @@ public abstract class RecurringSubscription implements ISerializableObject,
this.setGroupName(sub.getGroupName());
this.setId(sub.getId());
this.setName(name);
this.setNotify(sub.isNotify());
this.setOfficeID(sub.getOfficeID());
this.setParameter(sub.getParameter());
this.setPriority(sub.getPriority());
@ -168,10 +168,6 @@ public abstract class RecurringSubscription implements ISerializableObject,
@DynamicSerializeElement
private Date activePeriodEnd;
@XmlAttribute
@DynamicSerializeElement
private boolean notify;
@XmlAttribute
@DynamicSerializeElement
@SlotAttribute
@ -437,27 +433,6 @@ public abstract class RecurringSubscription implements ISerializableObject,
this.activePeriodEnd = activePeriodEnd;
}
/**
* isNotify flag for subscription.
*
* @return boolean true if notify subscriber false if deliver to subscriber
*/
@Override
public boolean isNotify() {
return notify;
}
/**
* Set isNotify flag.
*
* @param notify
* date for subscription end
*/
@Override
public void setNotify(boolean notify) {
this.notify = notify;
}
/**
* isNotify flag for subscription.
*

View file

@ -35,6 +35,7 @@ import javax.xml.bind.annotation.XmlEnumValue;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 25, 2013 1841 djohnson Extracted from UserSubscription.
* Apr 08, 2013 1826 djohnson Remove delivery options.
*
* </pre>
*
@ -268,21 +269,6 @@ public interface Subscription {
*/
void setActivePeriodEnd(Date activePeriodEnd);
/**
* isNotify flag for subscription.
*
* @return boolean true if notify subscriber false if deliver to subscriber
*/
boolean isNotify();
/**
* Set isNotify flag.
*
* @param notify
* date for subscription end
*/
void setNotify(boolean notify);
/**
* isNotify flag for subscription.
*

View file

@ -40,6 +40,7 @@ import com.raytheon.uf.common.util.AbstractFixture;
* Oct 16, 2012 0726 djohnson Use other fixtures to get appropriate values.
* Jan 30, 2013 1543 djohnson Add coverage/parameter data.
* Mar 28, 2013 1841 djohnson Subscription is now UserSubscription.
* Apr 08, 2013 1826 djohnson Remove delivery options.
*
* </pre>
*
@ -73,7 +74,6 @@ public abstract class BaseSubscriptionFixture<T extends Subscription> extends
subscription.setFullDataSet(random.nextBoolean());
subscription.setGroupName("group" + random.nextInt());
subscription.setName("name" + seedValue);
subscription.setNotify(random.nextBoolean());
subscription.setOfficeID("officeID" + random.nextInt());
subscription.addParameter(ParameterFixture.INSTANCE.get());
// Same priority for all, individual tests needing to test specific

View file

@ -37,6 +37,7 @@ import com.raytheon.uf.common.time.util.TimeUtil;
* Jan 07, 2013 1453 djohnson Initial creation
* Jan 30, 2013 1543 djohnson Add ability to specify route.
* Mar 28, 2013 1841 djohnson Subscription is now UserSubscription.
* Apr 08, 2013 1826 djohnson Remove delivery options.
*
* </pre>
*
@ -109,7 +110,6 @@ public class SubscriptionBuilder {
subscription.setGroupName(groupName);
subscription.setLatencyInMinutes(latencyInMinutes);
subscription.setName(name);
subscription.setNotify(notify);
subscription.setOfficeID(officeId);
subscription.setOwner(owner);
subscription.setPriority(priority);

View file

@ -73,6 +73,7 @@ import com.raytheon.uf.viz.datadelivery.subscription.view.ICreateSubscriptionDlg
* Jan 04, 2013 1453 djohnson Add tests for setting the active period.
* Jan 11, 2013 1453 djohnson Add test from failed test scenario.
* Mar 28, 2013 1841 djohnson Subscription is now UserSubscription.
* Apr 08, 2013 1826 djohnson Remove delivery options.
*
* </pre>
*
@ -114,16 +115,6 @@ public class CreateSubscriptionPresenterTest {
verify(view).openDlg();
}
@Test
public void testInitDeliverComboIsSet() {
verify(view).setDeliveryOptionsComboConf(presenter.DELIVERY_COMBO_CONF);
}
@Test
public void verifyDeliveryComboBoxConfiguration() {
verify(view).setDeliveryOptions(presenter.DELIVERY_OPTIONS);
}
@Test
public void testInitOkBtnIsSet() {
verify(view).setOkConf(presenter.OK_CONF);