| Line 1... |
Line 1... |
| 1 |
package in.shop2020.catalog.dashboard.client;
|
1 |
package in.shop2020.catalog.dashboard.client;
|
| 2 |
|
2 |
|
| - |
|
3 |
import in.shop2020.catalog.dashboard.shared.Utils;
|
| - |
|
4 |
|
| 3 |
import com.google.gwt.core.client.EntryPoint;
|
5 |
import com.google.gwt.core.client.EntryPoint;
|
| 4 |
import com.google.gwt.core.client.GWT;
|
6 |
import com.google.gwt.core.client.GWT;
|
| 5 |
import com.google.gwt.event.dom.client.ClickEvent;
|
7 |
import com.google.gwt.event.dom.client.ClickEvent;
|
| 6 |
import com.google.gwt.event.dom.client.ClickHandler;
|
8 |
import com.google.gwt.event.dom.client.ClickHandler;
|
| 7 |
import com.google.gwt.uibinder.client.UiBinder;
|
9 |
import com.google.gwt.uibinder.client.UiBinder;
|
| Line 37... |
Line 39... |
| 37 |
//initMainDB("Testing");
|
39 |
//initMainDB("Testing");
|
| 38 |
root.add(login);
|
40 |
root.add(login);
|
| 39 |
login.setLoginListener(new LoginScreen.LoginListener() {
|
41 |
login.setLoginListener(new LoginScreen.LoginListener() {
|
| 40 |
@Override
|
42 |
@Override
|
| 41 |
public void onLoginPressed(String username, String password) {
|
43 |
public void onLoginPressed(String username, String password) {
|
| 42 |
authenticateUser(username, password);
|
44 |
authenticateUser(username, password, Utils.ROLE_STAGING);
|
| 43 |
}
|
45 |
}
|
| 44 |
});
|
46 |
});
|
| 45 |
}
|
47 |
}
|
| 46 |
|
48 |
|
| 47 |
private void authenticateUser(String username, String password) {
|
49 |
private void authenticateUser(String username, String password, int role) {
|
| 48 |
final String uname = username;
|
50 |
final String uname = username;
|
| 49 |
loginService.authenticateUser(username, password, new AsyncCallback<String>() {
|
51 |
loginService.authenticateUser(username, password, role, new AsyncCallback<String>() {
|
| 50 |
@Override
|
52 |
@Override
|
| 51 |
public void onSuccess(String result) {
|
53 |
public void onSuccess(String result) {
|
| 52 |
if (result != null) {
|
54 |
if (result != null) {
|
| 53 |
GWT.log(result + " logged in catalog dashboard");
|
55 |
GWT.log(result + " logged in catalog dashboard");
|
| 54 |
root.clear();
|
56 |
root.clear();
|
| Line 91... |
Line 93... |
| 91 |
itemList.loadAllPhasedOutItems();
|
93 |
itemList.loadAllPhasedOutItems();
|
| 92 |
} else if(CatalogTree.ALL_PAUSED_ITEMS.equals(itemsType)) {
|
94 |
} else if(CatalogTree.ALL_PAUSED_ITEMS.equals(itemsType)) {
|
| 93 |
itemList.loadAllPausedItems();
|
95 |
itemList.loadAllPausedItems();
|
| 94 |
} else if(CatalogTree.ALL_ACTIVE_ITEMS.equals(itemsType)) {
|
96 |
} else if(CatalogTree.ALL_ACTIVE_ITEMS.equals(itemsType)) {
|
| 95 |
itemList.loadAllActiveItems();
|
97 |
itemList.loadAllActiveItems();
|
| - |
|
98 |
} else if(CatalogTree.IN_PROCESS_ITEMS.equals(itemsType)) {
|
| - |
|
99 |
itemList.loadAllInProcessItems();
|
| - |
|
100 |
} else if(CatalogTree.CONTENT_COMPLETE_ITEMS.equals(itemsType)) {
|
| - |
|
101 |
itemList.loadAllContentCompleteItems();
|
| - |
|
102 |
} else if(CatalogTree.RISKY_ITEMS.equals(itemsType)) {
|
| - |
|
103 |
itemList.loadAllRiskyItems();
|
| 96 |
} else if(CatalogTree.BEST_DEALS.equals(itemsType)) {
|
104 |
} else if(CatalogTree.BEST_DEALS.equals(itemsType)) {
|
| 97 |
itemList.loadBestDeals();
|
105 |
itemList.loadBestDeals();
|
| 98 |
} else if(CatalogTree.BEST_SELLERS.equals(itemsType)) {
|
106 |
} else if(CatalogTree.BEST_SELLERS.equals(itemsType)) {
|
| 99 |
itemList.loadBestSellers();
|
107 |
itemList.loadBestSellers();
|
| 100 |
} else if(CatalogTree.LATEST_ARRIVALS.equals(itemsType)) {
|
108 |
} else if(CatalogTree.LATEST_ARRIVALS.equals(itemsType)) {
|