Commit 15236d5c by onuma

javaScriptの新しいクラスに対応した

userInfo.js serverInfo.js roomInfo.js deviceInfo.js
parent 66352a60
......@@ -23,11 +23,13 @@ import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.constant.ABookCommConstants;
import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException;
import jp.agentec.abook.abv.bl.data.ABVDataCache;
import jp.agentec.abook.abv.bl.dto.ArchiveDto;
import jp.agentec.abook.abv.bl.dto.ChatMessageDto;
import jp.agentec.abook.abv.bl.dto.ChatRoomDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.CommunicationLogic;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.adf.util.CollectionUtil;
import jp.agentec.adf.util.StringUtil;
......@@ -54,6 +56,7 @@ public class ChatData {
private String chatServerUrl;
private String cmsServerUrl;
private int mCollaborationType;
private int mHostRequestFlg = 0;
private CommunicationLogic communicationLogic = AbstractLogic.getLogic(CommunicationLogic.class);
......@@ -323,7 +326,7 @@ public class ChatData {
}
public String getStrCollaborationType() {
return this.getStrCollaborationType();
return strCollaborationType;
}
public String getToMoveGroupId() {
......@@ -343,6 +346,10 @@ public class ChatData {
}
public String getServerInfo() {
chatServerUrl = ABVEnvironment.getInstance().websocketServerHttpUrl;
chatServerUrl= chatServerUrl.substring(0, chatServerUrl.length() - 3);
cmsServerUrl = ABVEnvironment.getInstance().acmsAddress+ ABVDataCache.getInstance().getUrlPath();
JSONObject jsonObj = new JSONObject();
jsonObj.put(ABookCommConstants.KEY.CHAT_URL, chatServerUrl);
jsonObj.put(ABookCommConstants.KEY.CMS_URL, cmsServerUrl);
......@@ -351,6 +358,7 @@ public class ChatData {
}
public String getMyUserInfo() {
languageCode = ActivityHandlingHelper.getInstance().getLocaleFileName();
JSONObject jsonObj = new JSONObject();
jsonObj.put(ABookCommConstants.KEY.SID, sid);
jsonObj.put(ABookCommConstants.KEY.LOGIN_ID, loginId);
......@@ -363,6 +371,7 @@ public class ChatData {
JSONObject jsonObj = new JSONObject();
jsonObj.put(ABookCommConstants.KEY.ROOM_ID_UPPERCASE_D, roomId);
jsonObj.put(ABookCommConstants.KEY.ROOM_NAME, roomName);
jsonObj.put(ABookCommConstants.KEY.ROOM_TYPE, roomType);
return jsonObj.toString();
}
......@@ -372,4 +381,92 @@ public class ChatData {
jsonObj.put(ABookCommConstants.KEY.PLATFORM, "android");
return jsonObj.toString();
}
public String getMessageList(String roomId) {
return communicationLogic.getMessages(Integer.parseInt(roomId));
}
public String getFavoriteUsers() {
return communicationLogic.getFavoriteUsers();
}
public String getMyInfo() {
return communicationLogic.getMyInfo();
}
public String getUsersInRoom(String roomId) {
return communicationLogic.getUsersInRoom(Integer.parseInt(roomId));
}
public String getMyGroupUsers() {
return communicationLogic.getMyGroupUsers();
}
public String getMyGroupShopMemberByName(String keyword) {
return communicationLogic.getMyGroupUserByName(keyword);
}
public String getAllGroupShopMemberByName(String shopMemberName) {
return communicationLogic.getAllGroupShopMemberByName(shopMemberName);
}
public String getGroupByName(String keyword) {
return communicationLogic.getGroupByName(keyword);
}
public String getFavoriteGroups() {
return communicationLogic.getFavoriteGroups();
}
public String getGroupInfo(String groupId) {
return communicationLogic.getGroupSearchData(Integer.parseInt(groupId));
}
public String getNameCardData(String shopMemberId) {
return communicationLogic.getNameCardInfo(Integer.parseInt(shopMemberId));
}
public String getFavoriteGroupsList() {
return communicationLogic.getFavoriteGroups();
}
public String getArchiveList() {
return communicationLogic.getAllArchive();
}
public String getArchiveListByName(String keyword) {
return communicationLogic.getArchiveListByName(keyword);
}
public String getUserInfo(String shopMemberId) {
return communicationLogic.getUserInfo(Integer.parseInt(shopMemberId));
}
public String getUserInfoList(String shopMemberIds) {
return communicationLogic.getUserList(shopMemberIds);
}
public String getArchiveDetail(String archiveId) {
return communicationLogic.getArchiveDetail(Integer.parseInt(archiveId));
}
public String getContentList() {
return communicationLogic.getContentList();
}
public String getUserListByLoginId(String loginIdList) {
return communicationLogic.getUserListByLoginId(loginIdList);
}
public String getRoomList(String roomType, String keyword) {
return communicationLogic.getChatRoomList(Integer.parseInt(roomType), keyword);
}
public int getJoinCollaborationType() {
return mCollaborationType;
}
public void setJoinCollaborationType(int collaborationType) {
mCollaborationType = collaborationType;
}
}
......@@ -122,7 +122,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
private BroadcastReceiver receiver;
private CommunicationLogic communicationLogic = AbstractLogic.getLogic(CommunicationLogic.class);
public int mCollaborationType;
public boolean needHostAlert = false;
......@@ -862,7 +861,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
mChatWebView.loadUrl("javascript:alert(getLocalizedString('not_support_version'));");
return;
}
mCollaborationType = collaborationType;
chatData.setJoinCollaborationType(collaborationType.intValue());
mChatWebView.loadChatViewUrl(ABookCommConstants.COLLABORATION_PAGE_URL);
}
......@@ -1295,14 +1294,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
finishPIPmode();
}
public int getJoinCollaborationType() {
return mCollaborationType;
}
public void setJoinCollaborationType(int collaborationType) {
mCollaborationType = collaborationType;
}
public void finishPip() {
finishPIPmode();
}
......
......@@ -13,8 +13,6 @@ import jp.agentec.abook.abv.bl.common.constant.ABookCommConstants;
import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.CommunicationLogic;
import jp.agentec.abook.abv.data.ChatData;
import jp.agentec.abook.abv.ui.home.activity.ChatWebViewActivity;
import jp.agentec.abook.abv.ui.home.activity.OperationRelatedContentActivity;
......@@ -22,7 +20,6 @@ import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
public class ChatWebView extends WebView {
private CommunicationLogic communicationLogic = AbstractLogic.getLogic(CommunicationLogic.class);
private ChatWebViewActivity chatActivity;
private ChatData chatData;
......@@ -139,7 +136,7 @@ public class ChatWebView extends WebView {
@JavascriptInterface
public String getRoomList(String roomType, String keyword) {
return communicationLogic.getChatRoomList(Integer.parseInt(roomType), keyword);
return chatData.getRoomList(roomType, keyword);
}
@JavascriptInterface
......@@ -210,7 +207,7 @@ public class ChatWebView extends WebView {
@JavascriptInterface
public String getMessageList(String roomId) {
return communicationLogic.getMessages(Integer.parseInt(roomId));
return chatData.getMessageList(roomId);
}
@JavascriptInterface
......@@ -220,7 +217,7 @@ public class ChatWebView extends WebView {
@JavascriptInterface
public String getFavoriteUsers() {
return communicationLogic.getFavoriteUsers();
return chatData.getFavoriteUsers();
}
@JavascriptInterface
......@@ -230,17 +227,17 @@ public class ChatWebView extends WebView {
@JavascriptInterface
public String getMyInfo() {
return communicationLogic.getMyInfo();
return chatData.getMyInfo();
}
@JavascriptInterface
public String getUsersInRoom(String roomId) {
return communicationLogic.getUsersInRoom(Integer.parseInt(roomId));
return chatData.getUsersInRoom(roomId);
}
@JavascriptInterface
public String getMyGroupUsers() {
return communicationLogic.getMyGroupUsers();
return chatData.getMyGroupUsers();
}
@JavascriptInterface
......@@ -250,7 +247,7 @@ public class ChatWebView extends WebView {
@JavascriptInterface
public String getMyGroupShopMemberByName(String keyword) {
return communicationLogic.getMyGroupUserByName(keyword);
return chatData.getMyGroupShopMemberByName(keyword);
}
@JavascriptInterface
......@@ -260,7 +257,7 @@ public class ChatWebView extends WebView {
@JavascriptInterface
public String getAllGroupShopMemberByName(String shopMemberName) {
return communicationLogic.getAllGroupShopMemberByName(shopMemberName);
return chatData.getAllGroupShopMemberByName(shopMemberName);
}
@JavascriptInterface
......@@ -270,13 +267,14 @@ public class ChatWebView extends WebView {
@JavascriptInterface
public String getGroupByName(String keyword) {
return communicationLogic.getGroupByName(keyword);
return chatData.getGroupByName(keyword);
}
@JavascriptInterface
public String getFavoriteGroups() {
return communicationLogic.getFavoriteGroups();
return chatData.getFavoriteGroups();
}
@JavascriptInterface
public void updateUserInfo(String shopMemberId) throws NetworkDisconnectedException, AcmsException {
chatActivity.updateUserInfo(shopMemberId);
......@@ -284,7 +282,7 @@ public class ChatWebView extends WebView {
@JavascriptInterface
public String getGroupInfo(String groupId) {
return communicationLogic.getGroupSearchData(Integer.parseInt(groupId));
return chatData.getGroupInfo(groupId);
}
@JavascriptInterface
......@@ -294,12 +292,12 @@ public class ChatWebView extends WebView {
@JavascriptInterface
public String getNameCardData(String shopMemberId) {
return communicationLogic.getNameCardInfo(Integer.parseInt(shopMemberId));
return chatData.getNameCardData(shopMemberId);
}
@JavascriptInterface
public String getFavoriteGroupsList() {
return communicationLogic.getFavoriteGroups();
return chatData.getFavoriteGroupsList();
}
@JavascriptInterface
......@@ -334,27 +332,27 @@ public class ChatWebView extends WebView {
@JavascriptInterface
public String getArchiveList() {
return communicationLogic.getAllArchive();
return chatData.getArchiveList();
}
@JavascriptInterface
public String getArchiveListByName(String keyword) {
return communicationLogic.getArchiveListByName(keyword);
return chatData.getArchiveListByName(keyword);
}
@JavascriptInterface
public String getUserInfo(String shopMemberId) {
return communicationLogic.getUserInfo(Integer.parseInt(shopMemberId));
return chatData.getUserInfo(shopMemberId);
}
@JavascriptInterface
public String getUserInfoList(String shopMemberIds) {
return communicationLogic.getUserList(shopMemberIds);
return chatData.getUserInfoList(shopMemberIds);
}
@JavascriptInterface
public String getArchiveDetail(String archiveId) {
return communicationLogic.getArchiveDetail(Integer.parseInt(archiveId));
return chatData.getArchiveDetail(archiveId);
}
@JavascriptInterface
......@@ -414,12 +412,12 @@ public class ChatWebView extends WebView {
@JavascriptInterface
public String getContentList() {
return communicationLogic.getContentList();
return chatData.getContentList();
}
@JavascriptInterface
public String getUserListByLoginId(String loginIdList) {
return communicationLogic.getUserListByLoginId(loginIdList);
return chatData.getUserListByLoginId(loginIdList);
}
......@@ -455,12 +453,12 @@ public class ChatWebView extends WebView {
@JavascriptInterface
public int getJoinCollaborationType() {
return chatActivity.getJoinCollaborationType();
return chatData.getJoinCollaborationType();
}
@JavascriptInterface
public void setJoinCollaborationType(int collaborationType) {
chatActivity.setJoinCollaborationType(collaborationType);
chatData.setJoinCollaborationType(collaborationType);
}
@JavascriptInterface
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment