Commit 569c140c by Kim Jinsung

Merge branch 'communication/develop_44478' into 'communication/develop'

Bug #44478【ABook Communication Android】プッシュメッセージ一覧からルーム接続及び協業接続できない。

See merge request !231
parents 06aa9cf7 1c36fc61
...@@ -1012,4 +1012,57 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -1012,4 +1012,57 @@ public class CommunicationLogic extends AbstractLogic {
public void updateUnreadCount(List<ChatMessageDto> messageList, String roomId) { public void updateUnreadCount(List<ChatMessageDto> messageList, String roomId) {
chatMessageDao.updatUnreadCount(messageList, roomId); chatMessageDao.updatUnreadCount(messageList, roomId);
} }
/**
* 協業招待メッセージからCollaborationTypeを取得 (招待文字列比較)
* @param message プッシュメッセージ
* @return 協業タイプ
*/
public String getCollaborationType(String message) {
try {
if (message.contains(ABookCommConstants.COLLABORATION.INVITE_COLLABORATION.EN) ||
message.contains(ABookCommConstants.COLLABORATION.INVITE_COLLABORATION.JP) ||
message.contains(ABookCommConstants.COLLABORATION.INVITE_COLLABORATION.KR)) {
return collaborationTypeToNum(message);
}
return null;
} catch (Exception e) {
return null;
}
}
/**
* 協業招待メッセージからCollaborationTypeを取得(各協業文字列比較)
* @param message プッシュメッセージ
* @return 協業タイプ
*/
public String collaborationTypeToNum(String message) {
if (message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_AUDIO.EN) ||
message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_AUDIO.JP) ||
message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_AUDIO.KR)
) {
return String.valueOf(ABookCommConstants.FLAG.COLLABORATION_TYPE.AUDIO);
}else if (message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_CAMERA.EN) ||
message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_CAMERA.JP) ||
message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_CAMERA.KR)
) {
return String.valueOf(ABookCommConstants.FLAG.COLLABORATION_TYPE.CAMERA);
}else if (message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_VIDEO.EN) ||
message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_VIDEO.JP) ||
message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_VIDEO.KR)
) {
return String.valueOf(ABookCommConstants.FLAG.COLLABORATION_TYPE.VIDEO);
}else if (message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_DOCUMENT.EN) ||
message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_DOCUMENT.JP) ||
message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_DOCUMENT.KR)
) {
return String.valueOf(ABookCommConstants.FLAG.COLLABORATION_TYPE.DOCUMENT);
}else if (message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_BOARD.EN) ||
message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_BOARD.JP) ||
message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_BOARD.KR)
) {
return String.valueOf(ABookCommConstants.FLAG.COLLABORATION_TYPE.BOARD);
}
return null;
}
} }
...@@ -133,7 +133,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -133,7 +133,7 @@ public class OperationLogic extends AbstractLogic {
//サーバーからチャットプシュデータを取得 //サーバーからチャットプシュデータを取得
if (ABVDataCache.getInstance().serviceOption.isChat()) { if (ABVDataCache.getInstance().serviceOption.isChat()) {
ChatPushDataJSON chatPushJson = AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).getChatPushList(param); ChatPushDataJSON chatPushJson = AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).getChatPushList(param);
for ( PushMessageDto dto : chatPushJson.pushMessageList) { for (PushMessageDto dto : chatPushJson.pushMessageList) {
PushMessageDto dtoTemp = mPushMessageDao.selectChat(dto.pushMessageId, dto.operationId, dto.pushSendDate); PushMessageDto dtoTemp = mPushMessageDao.selectChat(dto.pushMessageId, dto.operationId, dto.pushSendDate);
if (dtoTemp == null) { if (dtoTemp == null) {
mPushMessageDao.insert(dto); mPushMessageDao.insert(dto);
...@@ -292,6 +292,16 @@ public class OperationLogic extends AbstractLogic { ...@@ -292,6 +292,16 @@ public class OperationLogic extends AbstractLogic {
OperationListJSON json = AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).getOperationList(param); OperationListJSON json = AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).getOperationList(param);
List<OperationDto> serverOperations = json.operationList; List<OperationDto> serverOperations = json.operationList;
//サーバーからチャットプシュデータを取得
if (ABVDataCache.getInstance().serviceOption.isChat()) {
ChatPushDataJSON chatPushJson = AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).getChatPushList(param);
for (PushMessageDto dto : chatPushJson.pushMessageList) {
PushMessageDto dtoTemp = mPushMessageDao.selectChat(dto.pushMessageId, dto.operationId, dto.pushSendDate);
if (dtoTemp == null) {
mPushMessageDao.insert(dto);
}
}
}
for (OperationDto serverOperationDto : serverOperations) { for (OperationDto serverOperationDto : serverOperations) {
// 登録フラグ // 登録フラグ
boolean insertFlg = true; boolean insertFlg = true;
......
...@@ -1501,4 +1501,6 @@ ...@@ -1501,4 +1501,6 @@
<string name="msg_eroor_network_offline">接続しているネットワークがありません。</string> <string name="msg_eroor_network_offline">接続しているネットワークがありません。</string>
<string name="msg_error_connection_error_meeting_room">会議室サーバに接続できませんでした。</string> <string name="msg_error_connection_error_meeting_room">会議室サーバに接続できませんでした。</string>
<string name="msg_fail_collaboration_not_action_allow">文書協業中には利用できない機能です。</string> <string name="msg_fail_collaboration_not_action_allow">文書協業中には利用できない機能です。</string>
<string name="msg_fail_collaboration_join_error">協業に参加することができませんでした。</string>
</resources> </resources>
...@@ -1506,4 +1506,5 @@ ...@@ -1506,4 +1506,5 @@
<string name="msg_eroor_network_offline">연결된 네트워크가 없습니다.</string> <string name="msg_eroor_network_offline">연결된 네트워크가 없습니다.</string>
<string name="msg_error_connection_error_meeting_room">회의실 서버에 연결할 수 없습니다.</string> <string name="msg_error_connection_error_meeting_room">회의실 서버에 연결할 수 없습니다.</string>
<string name="msg_fail_collaboration_not_action_allow">문서협업 중에는 이용할 수 없는 기능입니다.</string> <string name="msg_fail_collaboration_not_action_allow">문서협업 중에는 이용할 수 없는 기능입니다.</string>
<string name="msg_fail_collaboration_join_error">협업에 참여하실수 없습니다.</string>
</resources> </resources>
\ No newline at end of file
...@@ -1502,4 +1502,5 @@ ...@@ -1502,4 +1502,5 @@
<string name="msg_eroor_network_offline">There is no network connected.</string> <string name="msg_eroor_network_offline">There is no network connected.</string>
<string name="msg_error_connection_error_meeting_room">Could not connect to the meeting room server.</string> <string name="msg_error_connection_error_meeting_room">Could not connect to the meeting room server.</string>
<string name="msg_fail_collaboration_not_action_allow">This function cannot be used during document collaboration.</string> <string name="msg_fail_collaboration_not_action_allow">This function cannot be used during document collaboration.</string>
<string name="msg_fail_collaboration_join_error">Could not connect to the collaboration.</string>
</resources> </resources>
...@@ -65,6 +65,7 @@ import jp.agentec.abook.abv.bl.dto.OperationDto; ...@@ -65,6 +65,7 @@ import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.bl.dto.PushMessageDto; import jp.agentec.abook.abv.bl.dto.PushMessageDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic; import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.BookmarkLogic; import jp.agentec.abook.abv.bl.logic.BookmarkLogic;
import jp.agentec.abook.abv.bl.logic.CommunicationLogic;
import jp.agentec.abook.abv.bl.logic.ContractLogic; import jp.agentec.abook.abv.bl.logic.ContractLogic;
import jp.agentec.abook.abv.bl.logic.MemoLogic; import jp.agentec.abook.abv.bl.logic.MemoLogic;
import jp.agentec.abook.abv.bl.logic.PushMessageLogic; import jp.agentec.abook.abv.bl.logic.PushMessageLogic;
...@@ -120,6 +121,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -120,6 +121,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
protected BookmarkLogic bookmarkLogic = AbstractLogic.getLogic(BookmarkLogic.class); protected BookmarkLogic bookmarkLogic = AbstractLogic.getLogic(BookmarkLogic.class);
protected ContentDownloader contentDownloader = ContentDownloader.getInstance(); protected ContentDownloader contentDownloader = ContentDownloader.getInstance();
protected ContentRefresher contentRefresher = ContentRefresher.getInstance(); protected ContentRefresher contentRefresher = ContentRefresher.getInstance();
private final CommunicationLogic communicationLogic = AbstractLogic.getLogic(CommunicationLogic.class);
private ExecutorService initilizeExecutor = Executors.newFixedThreadPool(2); // DL後の初期化専用 private ExecutorService initilizeExecutor = Executors.newFixedThreadPool(2); // DL後の初期化専用
...@@ -968,10 +970,10 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -968,10 +970,10 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
@Override @Override
public void onDetailView(final PushMessageDto dto) { public void onDetailView(final PushMessageDto dto) {
if(dto.roomName != null && dto.roomId != 0) if(dto.roomName != null && dto.roomId != 0) {
{
pushMessageLogic.updateReadingFlg(dto.pushMessageId); pushMessageLogic.updateReadingFlg(dto.pushMessageId);
ActivityHandlingHelper.getInstance().startChatWebViewActivityWithPushMessage(dto); String collaborationType = communicationLogic.getCollaborationType(dto.pushMessage);
ActivityHandlingHelper.getInstance().startChatWebViewActivityWithPushMessage(dto, collaborationType);
mPushMessageListDialog.dismiss(); mPushMessageListDialog.dismiss();
} else { } else {
showPushMessageDetailView(dto); showPushMessageDetailView(dto);
......
...@@ -162,6 +162,12 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -162,6 +162,12 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
chatData.setSid(intent.getStringExtra(ABookCommConstants.KEY.SID)); chatData.setSid(intent.getStringExtra(ABookCommConstants.KEY.SID));
chatData.setRoomID(intent.getLongExtra(ABookCommConstants.KEY.ROOM_ID, 0)); chatData.setRoomID(intent.getLongExtra(ABookCommConstants.KEY.ROOM_ID, 0));
chatData.roomName = intent.getStringExtra(ABookCommConstants.KEY.ROOM_NAME); chatData.roomName = intent.getStringExtra(ABookCommConstants.KEY.ROOM_NAME);
//ルーム名をDBから取得
Integer integerRoomId = Integer.parseInt(chatData.roomId.toString());
ChatRoomDto dto = communicationLogic.getChatRoom(integerRoomId);
if (dto != null) {
chatData.roomName = dto.chatRoomName;
}
chatData.roomType = intent.getStringExtra(ABookCommConstants.KEY.ROOM_TYPE); chatData.roomType = intent.getStringExtra(ABookCommConstants.KEY.ROOM_TYPE);
chatData.loginId = intent.getStringExtra(ABookCommConstants.KEY.LOGIN_ID); chatData.loginId = intent.getStringExtra(ABookCommConstants.KEY.LOGIN_ID);
chatData.shopName = intent.getStringExtra(ABookCommConstants.KEY.SHOP_NAME); chatData.shopName = intent.getStringExtra(ABookCommConstants.KEY.SHOP_NAME);
...@@ -256,7 +262,10 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -256,7 +262,10 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
} }
Integer integerRoomId = Integer.parseInt(chatData.roomId.toString()); Integer integerRoomId = Integer.parseInt(chatData.roomId.toString());
if (StringUtil.isNullOrEmpty(chatData.roomType)) { if (StringUtil.isNullOrEmpty(chatData.roomType)) {
chatData.roomType = communicationLogic.getChatRoom(integerRoomId).type.toString(); ChatRoomDto dto = communicationLogic.getChatRoom(integerRoomId);
if (dto != null) {
chatData.roomType = dto.type.toString();
}
} }
if (StringUtil.isNullOrEmpty(chatData.getStrCollaborationType())) { if (StringUtil.isNullOrEmpty(chatData.getStrCollaborationType())) {
String parameterData = "sid=" + chatData.sid String parameterData = "sid=" + chatData.sid
...@@ -817,6 +826,8 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -817,6 +826,8 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
*/ */
public void finishPIPMode() { public void finishPIPMode() {
if (startPIP) { if (startPIP) {
//既存WebViewのページリセットする。
mChatWebView.loadBlank();
Intent intent = new Intent(); Intent intent = new Intent();
intent.setClass(this, ChatWebViewActivity.class); intent.setClass(this, ChatWebViewActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
...@@ -1266,7 +1277,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1266,7 +1277,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
public int createContentView() { public int createContentView() {
finishBeforeContentListActivity(); finishBeforeContentListActivity();
startPIPMode();
Integer meetingId = null; Integer meetingId = null;
meetingManager.close(); meetingManager.close();
try { try {
...@@ -1283,13 +1293,13 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1283,13 +1293,13 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
} catch (Exception e) { } catch (Exception e) {
mChatWebView.showAlert(getString(R.string.msg_error_connection_error_meeting_room)); mChatWebView.showAlert(getString(R.string.msg_error_connection_error_meeting_room));
} }
startPIPMode();
startContentListActivity(true); startContentListActivity(true);
return meetingId; return meetingId;
} }
public void startContentView() { public void startContentView() {
finishBeforeContentListActivity(); finishBeforeContentListActivity();
startPIPMode();
meetingManager.close(); meetingManager.close();
try { try {
connectMeetingServer(); connectMeetingServer();
...@@ -1299,6 +1309,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1299,6 +1309,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
} catch (Exception e) { } catch (Exception e) {
mChatWebView.showAlert(getString(R.string.msg_error_connection_error_meeting_room)); mChatWebView.showAlert(getString(R.string.msg_error_connection_error_meeting_room));
} }
startPIPMode();
startContentListActivity(false); startContentListActivity(false);
} }
...@@ -1338,8 +1349,11 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements ...@@ -1338,8 +1349,11 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
public void exitMeetingRoom() { public void exitMeetingRoom() {
exitAndDeleteMeetingRoom(); exitAndDeleteMeetingRoom();
finishPIPMode(); finishPIPMode();
//関連資料画面閉じる //関連資料画面閉じる
ActivityHandlingHelper.getInstance().finishCollaborationOperationRelatedContentActivity(); ActivityHandlingHelper.getInstance().finishCollaborationOperationRelatedContentActivity();
//コンテンツ閲覧画面閉じる
ActivityHandlingHelper.getInstance().finishAllContentViewActivity();
} }
public void finishPIP() { public void finishPIP() {
......
...@@ -895,8 +895,10 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve ...@@ -895,8 +895,10 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
if (meetingManager != null) { if (meetingManager != null) {
isCollaboration = meetingManager.isCollaboration(); isCollaboration = meetingManager.isCollaboration();
} }
if (cmd.equals(MeetingManager.CMD_MEETINGINFO) && !isCollaboration) { // 入室結果 if (cmd.equals(MeetingManager.CMD_MEETINGINFO)) { // 入室結果
if (!isCollaboration) { //文書協業中にはトースト表示させない。
showToast(mContext.getString(meetingManager.isOwner() ? R.string.msg_enter_as_publisher : R.string.msg_enter_as_subscriber)); showToast(mContext.getString(meetingManager.isOwner() ? R.string.msg_enter_as_publisher : R.string.msg_enter_as_subscriber));
}
return; return;
} }
...@@ -1002,8 +1004,21 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve ...@@ -1002,8 +1004,21 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
if (data.startsWith("onClose:1000")) { if (data.startsWith("onClose:1000")) {
saveMeetingInfo(null, null, null, false); saveMeetingInfo(null, null, null, false);
} else if (contentViewActivity == null && data.endsWith(";" + MeetingManager.STATUS_PEND)) { // 初期接続の失敗では再接続アラートダイアログは出さない } else if (contentViewActivity == null && data.endsWith(";" + MeetingManager.STATUS_PEND)) { // 初期接続の失敗では再接続アラートダイアログは出さない
ChatWebViewActivity chatWebViewActivity = getChatWebViewActivity();
if (chatWebViewActivity == null) {
showEnterFailedAlert(); showEnterFailedAlert();
} else { } else {
chatWebViewActivity.finishPIPMode();
handler.postDelayed(new Runnable() {
@Override
public void run() {
ABookAlertDialog alertDialog = AlertDialogUtil.createAlertDialog(getCurrentActivity(), mContext.getString(R.string.error), mContext.getString(R.string.msg_fail_collaboration_join_error));
alertDialog.setPositiveButton(R.string.ok, null);
alertDialog.show();
}
}, 1000);
}
} else {
reflectContentView = false; reflectContentView = false;
lastDisconnect = System.currentTimeMillis(); lastDisconnect = System.currentTimeMillis();
if ((contentViewActivity != null) && ABVActivity.isVisible()) { // Wifi以外の理由で接続が突然切れた場合 if ((contentViewActivity != null) && ABVActivity.isVisible()) { // Wifi以外の理由で接続が突然切れた場合
...@@ -1644,24 +1659,12 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve ...@@ -1644,24 +1659,12 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
} }
//プシュメッセージ一覧からチャットに入る //プシュメッセージ一覧からチャットに入る
public void startChatWebViewActivityWithPushMessage(PushMessageDto dto) { public void startChatWebViewActivityWithPushMessage(PushMessageDto dto, String collaborationType) {
String className = ChatWebViewActivity.class.getName(); if (collaborationType == null) {
Intent intent = new Intent(); startChatWebViewActivity(dto.roomId, dto.roomName, ChatWebViewActivity.class.getName(), null);
} else {
intent.putExtra("chatWebviewUrl",ABVEnvironment.getInstance().acmsAddress + ABVDataCache.getInstance().getUrlPath() + "/chatapi/chat/"); startChatWebViewActivityWithCollaboration(dto.roomId, dto.roomName, collaborationType, null, ChatWebViewActivity.class.getName(), null);
String sid = ABVDataCache.getInstance().getMemberInfo().sid;
intent.putExtra("sid", sid);
String loginId = ABVDataCache.getInstance().getMemberInfo().loginId;
String shopName = ABVDataCache.getInstance().getUrlPath();
intent.putExtra(AppDefType.ChatPushMessageKey.loginId, loginId);
intent.putExtra(AppDefType.ChatPushMessageKey.shopName, shopName);
if (dto != null) {
intent.putExtra(AppDefType.ChatPushMessageKey.loginId, dto.roomId);
intent.putExtra(AppDefType.ChatPushMessageKey.roomName, dto.roomName);
} }
intent.setClassName(mContext.getPackageName(), className);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
getCurrentActivity().startActivity(intent);
} }
//チャットに入る //チャットに入る
......
...@@ -549,6 +549,13 @@ public class ChatWebView extends WebView { ...@@ -549,6 +549,13 @@ public class ChatWebView extends WebView {
delegate.chatWebViewNeedsDismissProgressBar(); delegate.chatWebViewNeedsDismissProgressBar();
} }
} }
public void loadBlank() {
post(new Runnable() {
@Override
public void run() {
loadUrl("about:blank");
}
});
public void loadChatViewUrl(final String urlString) { public void loadChatViewUrl(final String urlString) {
post(new Runnable() { post(new Runnable() {
......
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