Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto E. Escobar2014-08-02 00:30:35 +0000
committerRoberto E. Escobar2014-09-29 22:55:03 +0000
commit1e6dc21b6ce89e72448d52ba35b47a08d2f67660 (patch)
treeea9d70bfb917f23263d526c2eb3239b4e1d7a143
parentad47a2aa52b0ef52d11a325dd1a859ca515b8c29 (diff)
downloadorg.eclipse.osee-1e6dc21b6ce89e72448d52ba35b47a08d2f67660.tar.gz
org.eclipse.osee-1e6dc21b6ce89e72448d52ba35b47a08d2f67660.tar.xz
org.eclipse.osee-1e6dc21b6ce89e72448d52ba35b47a08d2f67660.zip
feature: Convert Unsubscribe to use JAX-RS MVC
-rw-r--r--plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/UnsubscribeResourceTest.java40
-rw-r--r--plugins/org.eclipse.osee.account.rest/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.account.rest/OSEE-INF/templates/unsubscribe.html (renamed from plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/html/unsubscribe.html)0
-rw-r--r--plugins/org.eclipse.osee.account.rest/OSEE-INF/templates/unsubscribe_no_subscription.html (renamed from plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/html/unsubscribe_no_subscription.html)0
-rw-r--r--plugins/org.eclipse.osee.account.rest/OSEE-INF/templates/unsubscribe_success.html (renamed from plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/html/unsubscribe_success.html)0
-rw-r--r--plugins/org.eclipse.osee.account.rest/build.properties3
-rw-r--r--plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/AccountApplication.java3
-rw-r--r--plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/PageWriter.java71
-rw-r--r--plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/UnsubscribeResource.java101
9 files changed, 64 insertions, 155 deletions
diff --git a/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/UnsubscribeResourceTest.java b/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/UnsubscribeResourceTest.java
index 1f6f931e02e..c2a111bf335 100644
--- a/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/UnsubscribeResourceTest.java
+++ b/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/UnsubscribeResourceTest.java
@@ -10,6 +10,12 @@
*******************************************************************************/
package org.eclipse.osee.account.rest.internal;
+import static org.eclipse.osee.account.rest.internal.UnsubscribeResource.ACCOUNT_DISPLAY_NAME_TAG;
+import static org.eclipse.osee.account.rest.internal.UnsubscribeResource.SUBSCRIPTION_NAME_TAG;
+import static org.eclipse.osee.account.rest.internal.UnsubscribeResource.UNSUBSCRIBE_NO_SUBSCRIPTION_TEMPLATE;
+import static org.eclipse.osee.account.rest.internal.UnsubscribeResource.UNSUBSCRIBE_TEMPLATE;
+import static org.eclipse.osee.account.rest.internal.UnsubscribeResource.UNSUBSCRIBE_URL;
+import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -18,7 +24,7 @@ import java.net.URI;
import javax.ws.rs.core.UriBuilder;
import org.eclipse.osee.account.admin.Subscription;
import org.eclipse.osee.account.admin.SubscriptionAdmin;
-import org.eclipse.osee.account.rest.internal.UnsubscribeResource.UnsubscribePageWriter;
+import org.eclipse.osee.framework.jdk.core.type.ViewModel;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
@@ -41,7 +47,6 @@ public class UnsubscribeResourceTest {
//@formatter:off
@Mock private SubscriptionAdmin manager;
@Mock private Subscription subscription;
- @Mock private UnsubscribePageWriter writer;
//@formatter:on
private UnsubscribeResource resource;
@@ -50,7 +55,7 @@ public class UnsubscribeResourceTest {
public void setUp() {
initMocks(this);
- resource = new UnsubscribeResource(manager, writer);
+ resource = new UnsubscribeResource(manager);
when(subscription.getGuid()).thenReturn(GROUP_UUID);
when(subscription.getGroupId()).thenReturn(GROUP_ID);
@@ -67,12 +72,16 @@ public class UnsubscribeResourceTest {
URI expected = UriBuilder.fromPath(SUBSCRIPTION_UUID).path("confirm").build();
- resource.getUnsubscribePage(SUBSCRIPTION_UUID);
+ ViewModel actual = resource.getUnsubscribePage(SUBSCRIPTION_UUID);
verify(manager).getSubscription(SUBSCRIPTION_UUID);
verify(subscription).isActive();
verify(subscription).getGuid();
- verify(writer).newUnsubscribePage(expected, GROUP_NAME, ACCOUNT_NAME);
+
+ assertEquals(UNSUBSCRIBE_TEMPLATE, actual.getViewId());
+ assertEquals(GROUP_NAME, actual.asMap().get(SUBSCRIPTION_NAME_TAG));
+ assertEquals(ACCOUNT_NAME, actual.asMap().get(ACCOUNT_DISPLAY_NAME_TAG));
+ assertEquals(expected, actual.asMap().get(UNSUBSCRIBE_URL));
}
@Test
@@ -80,12 +89,15 @@ public class UnsubscribeResourceTest {
when(manager.getSubscription(SUBSCRIPTION_UUID)).thenReturn(subscription);
when(subscription.isActive()).thenReturn(false);
- resource.getUnsubscribePage(SUBSCRIPTION_UUID);
+ ViewModel actual = resource.getUnsubscribePage(SUBSCRIPTION_UUID);
verify(manager).getSubscription(SUBSCRIPTION_UUID);
verify(subscription).isActive();
verify(subscription, times(0)).getGuid();
- verify(writer).newUnsubscribeNoSubscriptionFoundPage(GROUP_NAME, ACCOUNT_NAME);
+
+ assertEquals(UNSUBSCRIBE_NO_SUBSCRIPTION_TEMPLATE, actual.getViewId());
+ assertEquals(GROUP_NAME, actual.asMap().get(SUBSCRIPTION_NAME_TAG));
+ assertEquals(ACCOUNT_NAME, actual.asMap().get(ACCOUNT_DISPLAY_NAME_TAG));
}
@Test
@@ -93,11 +105,14 @@ public class UnsubscribeResourceTest {
when(manager.getSubscription(SUBSCRIPTION_UUID)).thenReturn(subscription);
when(manager.setSubscriptionActive(subscription, false)).thenReturn(true);
- resource.processUnsubscribePage(SUBSCRIPTION_UUID);
+ ViewModel actual = resource.processUnsubscribePage(SUBSCRIPTION_UUID);
verify(manager).getSubscription(SUBSCRIPTION_UUID);
verify(manager).setSubscriptionActive(subscription, false);
- verify(writer).newUnsubscribeSuccessPage(GROUP_NAME, ACCOUNT_NAME);
+
+ assertEquals(UnsubscribeResource.UNSUBSCRIBE_SUCCESS_TEMPLATE, actual.getViewId());
+ assertEquals(GROUP_NAME, actual.asMap().get(SUBSCRIPTION_NAME_TAG));
+ assertEquals(ACCOUNT_NAME, actual.asMap().get(ACCOUNT_DISPLAY_NAME_TAG));
}
@Test
@@ -105,11 +120,14 @@ public class UnsubscribeResourceTest {
when(manager.getSubscription(SUBSCRIPTION_UUID)).thenReturn(subscription);
when(manager.setSubscriptionActive(subscription, false)).thenReturn(false);
- resource.processUnsubscribePage(SUBSCRIPTION_UUID);
+ ViewModel actual = resource.processUnsubscribePage(SUBSCRIPTION_UUID);
verify(manager).getSubscription(SUBSCRIPTION_UUID);
verify(manager).setSubscriptionActive(subscription, false);
- verify(writer).newUnsubscribeNoSubscriptionFoundPage(GROUP_NAME, ACCOUNT_NAME);
+
+ assertEquals(UNSUBSCRIBE_NO_SUBSCRIPTION_TEMPLATE, actual.getViewId());
+ assertEquals(GROUP_NAME, actual.asMap().get(SUBSCRIPTION_NAME_TAG));
+ assertEquals(ACCOUNT_NAME, actual.asMap().get(ACCOUNT_DISPLAY_NAME_TAG));
}
}
diff --git a/plugins/org.eclipse.osee.account.rest/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.account.rest/META-INF/MANIFEST.MF
index 604c168f0c2..bbbc24fdc09 100644
--- a/plugins/org.eclipse.osee.account.rest/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.account.rest/META-INF/MANIFEST.MF
@@ -6,6 +6,7 @@ Bundle-Version: 0.19.0.qualifier
Bundle-Vendor: Eclipse Open System Engineering Environment
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Service-Component: OSGI-INF/*.xml
+Osee-Template: OSEE-INF/templates/*.html
Import-Package: javax.annotation.security,
javax.servlet,
javax.servlet.http,
diff --git a/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/html/unsubscribe.html b/plugins/org.eclipse.osee.account.rest/OSEE-INF/templates/unsubscribe.html
index 7fa06483225..7fa06483225 100644
--- a/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/html/unsubscribe.html
+++ b/plugins/org.eclipse.osee.account.rest/OSEE-INF/templates/unsubscribe.html
diff --git a/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/html/unsubscribe_no_subscription.html b/plugins/org.eclipse.osee.account.rest/OSEE-INF/templates/unsubscribe_no_subscription.html
index 7bc6dae6331..7bc6dae6331 100644
--- a/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/html/unsubscribe_no_subscription.html
+++ b/plugins/org.eclipse.osee.account.rest/OSEE-INF/templates/unsubscribe_no_subscription.html
diff --git a/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/html/unsubscribe_success.html b/plugins/org.eclipse.osee.account.rest/OSEE-INF/templates/unsubscribe_success.html
index 309700dcfba..309700dcfba 100644
--- a/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/html/unsubscribe_success.html
+++ b/plugins/org.eclipse.osee.account.rest/OSEE-INF/templates/unsubscribe_success.html
diff --git a/plugins/org.eclipse.osee.account.rest/build.properties b/plugins/org.eclipse.osee.account.rest/build.properties
index e7543d13f58..1caac513bd0 100644
--- a/plugins/org.eclipse.osee.account.rest/build.properties
+++ b/plugins/org.eclipse.osee.account.rest/build.properties
@@ -2,5 +2,6 @@ output.. = bin/
bin.includes = META-INF/,\
.,\
OSGI-INF/,\
- REST-INF/
+ REST-INF/,\
+ OSEE-INF/
source.. = src/
diff --git a/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/AccountApplication.java b/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/AccountApplication.java
index a03d23bec93..03131978346 100644
--- a/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/AccountApplication.java
+++ b/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/AccountApplication.java
@@ -36,12 +36,11 @@ public class AccountApplication extends Application {
}
public void start() {
- PageWriter writer = new PageWriter();
AccountOps ops = new AccountOps(accountAdmin);
singletons.add(new AccountsResource(ops));
singletons.add(new SubscriptionsResource(subscriptionAdmin));
- singletons.add(new UnsubscribeResource(subscriptionAdmin, writer));
+ singletons.add(new UnsubscribeResource(subscriptionAdmin));
}
public void stop() {
diff --git a/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/PageWriter.java b/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/PageWriter.java
deleted file mode 100644
index 38c808d6e48..00000000000
--- a/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/PageWriter.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2014 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.account.rest.internal;
-
-import java.net.URI;
-import org.eclipse.osee.account.rest.internal.UnsubscribeResource.UnsubscribePageWriter;
-import org.eclipse.osee.framework.jdk.core.type.ClassBasedResourceToken;
-import org.eclipse.osee.framework.jdk.core.type.IResourceRegistry;
-import org.eclipse.osee.framework.jdk.core.type.ResourceRegistry;
-import org.eclipse.osee.framework.jdk.core.type.ResourceToken;
-import org.eclipse.osee.template.engine.PageFactory;
-
-/**
- * @author Roberto E. Escobar
- */
-public class PageWriter implements UnsubscribePageWriter {
- private static final ResourceToken UNSUBSCRIBE_TEMPLATE = createToken("unsubscribe.html");
- private static final ResourceToken UNSUBSCRIBE_SUCCESS_TEMPLATE = createToken("unsubscribe_success.html");
- private static final ResourceToken UNSUBSCRIBE_NO_SUBSCRIPTION_TEMPLATE =
- createToken("unsubscribe_no_subscription.html");
-
- private static final String ACCOUNT_DISPLAY_NAME_TAG = "accountDisplayName";
- private static final String SUBSCRIPTION_NAME_TAG = "subscriptionName";
- private static final String UNSUBSCRIBE_URL = "unsubscribeUrl";
-
- private IResourceRegistry registry;
-
- private IResourceRegistry getRegistry() {
- if (registry == null) {
- registry = new ResourceRegistry();
- registry.registerResource(-1L, UNSUBSCRIBE_TEMPLATE);
- registry.registerResource(-2L, UNSUBSCRIBE_SUCCESS_TEMPLATE);
- registry.registerResource(-3L, UNSUBSCRIBE_NO_SUBSCRIPTION_TEMPLATE);
- }
- return registry;
- }
-
- @Override
- public String newUnsubscribePage(URI unsubscribeUri, String subscriptionName, String accountName) {
- return PageFactory.realizePage(getRegistry(), UNSUBSCRIBE_TEMPLATE, //
- UNSUBSCRIBE_URL, unsubscribeUri.toASCIIString(), //
- ACCOUNT_DISPLAY_NAME_TAG, accountName, //
- SUBSCRIPTION_NAME_TAG, subscriptionName);
- }
-
- @Override
- public String newUnsubscribeNoSubscriptionFoundPage(String subscriptionName, String accountName) {
- return PageFactory.realizePage(getRegistry(), UNSUBSCRIBE_NO_SUBSCRIPTION_TEMPLATE, //
- ACCOUNT_DISPLAY_NAME_TAG, accountName, //
- SUBSCRIPTION_NAME_TAG, subscriptionName);
- }
-
- @Override
- public String newUnsubscribeSuccessPage(String subscriptionName, String accountName) {
- return PageFactory.realizePage(getRegistry(), UNSUBSCRIBE_SUCCESS_TEMPLATE,//
- ACCOUNT_DISPLAY_NAME_TAG, accountName, //
- SUBSCRIPTION_NAME_TAG, subscriptionName);
- }
-
- private static ResourceToken createToken(String fileName) {
- return new ClassBasedResourceToken(fileName, UnsubscribeResource.class);
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/UnsubscribeResource.java b/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/UnsubscribeResource.java
index 50846d2380f..4fa07a669b8 100644
--- a/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/UnsubscribeResource.java
+++ b/plugins/org.eclipse.osee.account.rest/src/org/eclipse/osee/account/rest/internal/UnsubscribeResource.java
@@ -23,11 +23,7 @@ import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.UriBuilder;
import org.eclipse.osee.account.admin.Subscription;
import org.eclipse.osee.account.admin.SubscriptionAdmin;
-import org.eclipse.osee.framework.jdk.core.type.ClassBasedResourceToken;
-import org.eclipse.osee.framework.jdk.core.type.IResourceRegistry;
-import org.eclipse.osee.framework.jdk.core.type.ResourceRegistry;
-import org.eclipse.osee.framework.jdk.core.type.ResourceToken;
-import org.eclipse.osee.template.engine.PageFactory;
+import org.eclipse.osee.framework.jdk.core.type.ViewModel;
/**
* @author Roberto E. Escobar
@@ -36,22 +32,10 @@ import org.eclipse.osee.template.engine.PageFactory;
@Path("/unsubscribe")
public class UnsubscribeResource {
- public static interface UnsubscribePageWriter {
-
- String newUnsubscribePage(URI unsubscribeUri, String subscriptionName, String accountName);
-
- String newUnsubscribeNoSubscriptionFoundPage(String subscriptionName, String accountName);
-
- String newUnsubscribeSuccessPage(String subscriptionName, String accountName);
-
- }
-
private final SubscriptionAdmin manager;
- private final UnsubscribePageWriter writer;
- public UnsubscribeResource(SubscriptionAdmin manager, UnsubscribePageWriter writer) {
+ public UnsubscribeResource(SubscriptionAdmin manager) {
this.manager = manager;
- this.writer = writer;
}
/**
@@ -62,15 +46,15 @@ public class UnsubscribeResource {
@Path("/ui/{subscription-uuid}")
@GET
@Produces(MediaType.TEXT_HTML)
- public String getUnsubscribePage(@PathParam("subscription-uuid") String subscriptionUuid) {
+ public ViewModel getUnsubscribePage(@PathParam("subscription-uuid") String subscriptionUuid) {
Subscription subscription = manager.getSubscription(subscriptionUuid);
- String page;
+ ViewModel page;
if (subscription.isActive()) {
String uuid = subscription.getGuid();
URI unsubscribeUri = UriBuilder.fromPath("{subscription-uuid}").path("confirm").build(uuid);
- page = writer.newUnsubscribePage(unsubscribeUri, subscription.getName(), subscription.getAccountName());
+ page = newUnsubscribePage(unsubscribeUri, subscription.getName(), subscription.getAccountName());
} else {
- page = writer.newUnsubscribeNoSubscriptionFoundPage(subscription.getName(), subscription.getAccountName());
+ page = newUnsubscribeNoSubscriptionFoundPage(subscription.getName(), subscription.getAccountName());
}
return page;
}
@@ -84,65 +68,42 @@ public class UnsubscribeResource {
@POST
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Produces(MediaType.TEXT_HTML)
- public String processUnsubscribePage(@Encoded @PathParam("subscription-uuid") String subscriptionUuid) {
+ public ViewModel processUnsubscribePage(@Encoded @PathParam("subscription-uuid") String subscriptionUuid) {
Subscription subscription = manager.getSubscription(subscriptionUuid);
boolean modified = manager.setSubscriptionActive(subscription, false);
- String page;
+ ViewModel page;
if (modified) {
- page = writer.newUnsubscribeSuccessPage(subscription.getName(), subscription.getAccountName());
+ page = newUnsubscribeSuccessPage(subscription.getName(), subscription.getAccountName());
} else {
- page = writer.newUnsubscribeNoSubscriptionFoundPage(subscription.getName(), subscription.getAccountName());
+ page = newUnsubscribeNoSubscriptionFoundPage(subscription.getName(), subscription.getAccountName());
}
return page;
}
- public static class UnsubscribePageWriterImpl implements UnsubscribePageWriter {
- private static final ResourceToken UNSUBSCRIBE_TEMPLATE = createToken("unsubscribe.html");
- private static final ResourceToken UNSUBSCRIBE_SUCCESS_TEMPLATE = createToken("unsubscribe_success.html");
- private static final ResourceToken UNSUBSCRIBE_NO_SUBSCRIPTION_TEMPLATE =
- createToken("unsubscribe_no_subscription.html");
-
- private static final String ACCOUNT_DISPLAY_NAME_TAG = "accountDisplayName";
- private static final String SUBSCRIPTION_NAME_TAG = "subscriptionName";
- private static final String UNSUBSCRIBE_URL = "unsubscribeUrl";
+ protected static final String UNSUBSCRIBE_TEMPLATE = "unsubscribe.html";
+ protected static final String UNSUBSCRIBE_SUCCESS_TEMPLATE = "unsubscribe_success.html";
+ protected static final String UNSUBSCRIBE_NO_SUBSCRIPTION_TEMPLATE = "unsubscribe_no_subscription.html";
- private IResourceRegistry registry;
-
- private IResourceRegistry getRegistry() {
- if (registry == null) {
- registry = new ResourceRegistry();
- registry.registerResource(-1L, UNSUBSCRIBE_TEMPLATE);
- registry.registerResource(-2L, UNSUBSCRIBE_SUCCESS_TEMPLATE);
- registry.registerResource(-3L, UNSUBSCRIBE_NO_SUBSCRIPTION_TEMPLATE);
- }
- return registry;
- }
+ protected static final String ACCOUNT_DISPLAY_NAME_TAG = "accountDisplayName";
+ protected static final String SUBSCRIPTION_NAME_TAG = "subscriptionName";
+ protected static final String UNSUBSCRIBE_URL = "unsubscribeUrl";
- @Override
- public String newUnsubscribePage(URI unsubscribeUri, String subscriptionName, String accountName) {
- return PageFactory.realizePage(getRegistry(), UNSUBSCRIBE_TEMPLATE, //
- UNSUBSCRIBE_URL, unsubscribeUri.toASCIIString(), //
- ACCOUNT_DISPLAY_NAME_TAG, accountName, //
- SUBSCRIPTION_NAME_TAG, subscriptionName);
- }
-
- @Override
- public String newUnsubscribeNoSubscriptionFoundPage(String subscriptionName, String accountName) {
- return PageFactory.realizePage(getRegistry(), UNSUBSCRIBE_NO_SUBSCRIPTION_TEMPLATE, //
- ACCOUNT_DISPLAY_NAME_TAG, accountName, //
- SUBSCRIPTION_NAME_TAG, subscriptionName);
- }
-
- @Override
- public String newUnsubscribeSuccessPage(String subscriptionName, String accountName) {
- return PageFactory.realizePage(getRegistry(), UNSUBSCRIBE_SUCCESS_TEMPLATE,//
- ACCOUNT_DISPLAY_NAME_TAG, accountName, //
- SUBSCRIPTION_NAME_TAG, subscriptionName);
- }
+ private ViewModel newUnsubscribePage(URI unsubscribeUri, String subscriptionName, String accountName) {
+ return new ViewModel(UNSUBSCRIBE_TEMPLATE) //
+ .param(UNSUBSCRIBE_URL, unsubscribeUri) //
+ .param(ACCOUNT_DISPLAY_NAME_TAG, accountName) //
+ .param(SUBSCRIPTION_NAME_TAG, subscriptionName);
+ }
- private static ResourceToken createToken(String fileName) {
- return new ClassBasedResourceToken(fileName, UnsubscribeResource.class);
- }
+ private ViewModel newUnsubscribeNoSubscriptionFoundPage(String subscriptionName, String accountName) {
+ return new ViewModel(UNSUBSCRIBE_NO_SUBSCRIPTION_TEMPLATE) //
+ .param(ACCOUNT_DISPLAY_NAME_TAG, accountName) //
+ .param(SUBSCRIPTION_NAME_TAG, subscriptionName);
}
+ private ViewModel newUnsubscribeSuccessPage(String subscriptionName, String accountName) {
+ return new ViewModel(UNSUBSCRIBE_SUCCESS_TEMPLATE) //
+ .param(ACCOUNT_DISPLAY_NAME_TAG, accountName) //
+ .param(SUBSCRIPTION_NAME_TAG, subscriptionName);
+ }
} \ No newline at end of file

Back to the top