Commit e673a50a by Kim Peace

Rearranged communication code

parent 76b07967
...@@ -102,6 +102,7 @@ public interface ABookCommConstants { ...@@ -102,6 +102,7 @@ public interface ABookCommConstants {
String IS_ONLINE = "isOnline"; String IS_ONLINE = "isOnline";
String IS_MOBILE = "isMobile"; String IS_MOBILE = "isMobile";
String PLATFORM = "platform"; String PLATFORM = "platform";
String COLLABORATION_TYPE = "collaborationType";
} }
interface FLAG { interface FLAG {
......
...@@ -10,11 +10,8 @@ import java.util.HashMap; ...@@ -10,11 +10,8 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors;
import jp.agentec.abook.abv.bl.common.constant.ABookCommConstants; import jp.agentec.abook.abv.bl.common.constant.ABookCommConstants;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.common.util.JsonUtil;
import jp.agentec.abook.abv.bl.data.dao.AbstractCommunicationDao; import jp.agentec.abook.abv.bl.data.dao.AbstractCommunicationDao;
import jp.agentec.abook.abv.bl.data.dao.AbstractDao; import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
import jp.agentec.abook.abv.bl.data.dao.ArchiveDao; import jp.agentec.abook.abv.bl.data.dao.ArchiveDao;
...@@ -24,13 +21,11 @@ import jp.agentec.abook.abv.bl.data.dao.ChatRoomDao; ...@@ -24,13 +21,11 @@ import jp.agentec.abook.abv.bl.data.dao.ChatRoomDao;
import jp.agentec.abook.abv.bl.data.dao.ContentDao; import jp.agentec.abook.abv.bl.data.dao.ContentDao;
import jp.agentec.abook.abv.bl.data.dao.ShopMemberDao; import jp.agentec.abook.abv.bl.data.dao.ShopMemberDao;
import jp.agentec.abook.abv.bl.dto.ArchiveDto; import jp.agentec.abook.abv.bl.dto.ArchiveDto;
import jp.agentec.abook.abv.bl.dto.ChatGroupDto;
import jp.agentec.abook.abv.bl.dto.ChatMessageDto; import jp.agentec.abook.abv.bl.dto.ChatMessageDto;
import jp.agentec.abook.abv.bl.dto.ChatRoomDto; import jp.agentec.abook.abv.bl.dto.ChatRoomDto;
import jp.agentec.abook.abv.bl.dto.ChatGroupDto;
import jp.agentec.abook.abv.bl.dto.ContentDto; import jp.agentec.abook.abv.bl.dto.ContentDto;
import jp.agentec.abook.abv.bl.dto.ShopMemberDto; import jp.agentec.abook.abv.bl.dto.ShopMemberDto;
import jp.agentec.adf.util.ArrayUtil;
import jp.agentec.adf.util.CollectionUtil;
import jp.agentec.adf.util.DateTimeUtil; import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.StringUtil; import jp.agentec.adf.util.StringUtil;
...@@ -40,14 +35,14 @@ import jp.agentec.adf.util.StringUtil; ...@@ -40,14 +35,14 @@ import jp.agentec.adf.util.StringUtil;
public class CommunicationLogic extends AbstractLogic { public class CommunicationLogic extends AbstractLogic {
private static final String TAG = "CommunicationLogic"; private static final String TAG = "CommunicationLogic";
private ChatRoomDao chatRoomDao = AbstractCommunicationDao.getDao(ChatRoomDao.class); private final ChatRoomDao chatRoomDao = AbstractCommunicationDao.getDao(ChatRoomDao.class);
private ChatMessageDao chatMessageDao = AbstractCommunicationDao.getDao(ChatMessageDao.class); private final ChatMessageDao chatMessageDao = AbstractCommunicationDao.getDao(ChatMessageDao.class);
private ShopMemberDao shopMemberDao = AbstractCommunicationDao.getDao(ShopMemberDao.class); private final ShopMemberDao shopMemberDao = AbstractCommunicationDao.getDao(ShopMemberDao.class);
private ChatGroupDao chatGroupDao = AbstractCommunicationDao.getDao(ChatGroupDao.class); private final ChatGroupDao chatGroupDao = AbstractCommunicationDao.getDao(ChatGroupDao.class);
private ContentDao contentDao = AbstractDao.getDao(ContentDao.class); private final ContentDao contentDao = AbstractDao.getDao(ContentDao.class);
private String localFilePath; private String localFilePath;
private ArchiveDao archiveDao = AbstractCommunicationDao.getDao(ArchiveDao.class); private final ArchiveDao archiveDao = AbstractCommunicationDao.getDao(ArchiveDao.class);
/** /**
* {@link CommunicationLogic} クラスのインスタンスを初期化します。 * {@link CommunicationLogic} クラスのインスタンスを初期化します。
...@@ -100,8 +95,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -100,8 +95,7 @@ public class CommunicationLogic extends AbstractLogic {
JSONObject jsonObject = new JSONObject(chatRoomMap); JSONObject jsonObject = new JSONObject(chatRoomMap);
resultJsonArray.put(jsonObject); resultJsonArray.put(jsonObject);
} }
String roomListToStr = resultJsonArray.toString(); return resultJsonArray.toString();
return roomListToStr;
} }
public String getUsersInRoom(Integer roomId) { public String getUsersInRoom(Integer roomId) {
...@@ -115,8 +109,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -115,8 +109,7 @@ public class CommunicationLogic extends AbstractLogic {
JSONObject jsonObject = new JSONObject(userMap); JSONObject jsonObject = new JSONObject(userMap);
attendUsers.put(jsonObject); attendUsers.put(jsonObject);
} }
String attendUsersStr = attendUsers.toString(); return attendUsers.toString();
return attendUsersStr;
} }
public String getMessages(Integer roomId) { public String getMessages(Integer roomId) {
...@@ -142,8 +135,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -142,8 +135,7 @@ public class CommunicationLogic extends AbstractLogic {
JSONObject jsonObject = new JSONObject(chatMessageMap); JSONObject jsonObject = new JSONObject(chatMessageMap);
resultJsonArray.put(jsonObject); resultJsonArray.put(jsonObject);
} }
String messageListStr = resultJsonArray.toString(); return resultJsonArray.toString();
return messageListStr;
} }
public String getMessagesFromMessageId(Integer roomId, String messageId) { public String getMessagesFromMessageId(Integer roomId, String messageId) {
...@@ -170,8 +162,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -170,8 +162,7 @@ public class CommunicationLogic extends AbstractLogic {
JSONObject jsonObject = new JSONObject(chatMessageMap); JSONObject jsonObject = new JSONObject(chatMessageMap);
resultJsonArray.put(jsonObject); resultJsonArray.put(jsonObject);
} }
String messageListStr = resultJsonArray.toString(); return resultJsonArray.toString();
return messageListStr;
} }
public String searMessages(Integer roomId, String keyword, String userList) { public String searMessages(Integer roomId, String keyword, String userList) {
...@@ -197,8 +188,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -197,8 +188,7 @@ public class CommunicationLogic extends AbstractLogic {
JSONObject jsonObject = new JSONObject(chatMessageMap); JSONObject jsonObject = new JSONObject(chatMessageMap);
resultJsonArray.put(jsonObject); resultJsonArray.put(jsonObject);
} }
String messageListStr = resultJsonArray.toString(); return resultJsonArray.toString();
return messageListStr;
} }
public String getNameCardInfo(Integer shopMemberId) { public String getNameCardInfo(Integer shopMemberId) {
...@@ -223,7 +213,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -223,7 +213,7 @@ public class CommunicationLogic extends AbstractLogic {
resultJson.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, shopMemberDto.shopMemberName); resultJson.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, shopMemberDto.shopMemberName);
resultJson.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(shopMemberDto.profileUrl)); resultJson.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(shopMemberDto.profileUrl));
resultJson.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupPathJsonArray); resultJson.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupPathJsonArray);
boolean hasRegisteredDate = StringUtil.isNullOrEmpty(shopMemberDto.favoriteRegisterDate) == false; boolean hasRegisteredDate = !StringUtil.isNullOrEmpty(shopMemberDto.favoriteRegisterDate);
resultJson.put(ABookCommConstants.KEY.IS_FAVORITE, hasRegisteredDate); resultJson.put(ABookCommConstants.KEY.IS_FAVORITE, hasRegisteredDate);
return resultJson.toString(); return resultJson.toString();
...@@ -237,8 +227,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -237,8 +227,7 @@ public class CommunicationLogic extends AbstractLogic {
myInfoJson.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, myInfo.shopMemberName); myInfoJson.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, myInfo.shopMemberName);
myInfoJson.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(myInfo.profileUrl)); myInfoJson.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(myInfo.profileUrl));
myInfoJson.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupPathList); myInfoJson.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupPathList);
String myInfoStr = myInfoJson.toString(); return myInfoJson.toString();
return myInfoStr;
} }
public String getUserListByLoginId(String loginIdList) { public String getUserListByLoginId(String loginIdList) {
...@@ -259,8 +248,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -259,8 +248,7 @@ public class CommunicationLogic extends AbstractLogic {
joinedMemberArray.put(myInfoJson); joinedMemberArray.put(myInfoJson);
} }
String myInfoStr = joinedMemberArray.toString(); return joinedMemberArray.toString();
return myInfoStr;
} }
public String getMyGroupUsers() { public String getMyGroupUsers() {
...@@ -279,19 +267,14 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -279,19 +267,14 @@ public class CommunicationLogic extends AbstractLogic {
myGroupUserMap.put(ABookCommConstants.KEY.CHECKED, ""); myGroupUserMap.put(ABookCommConstants.KEY.CHECKED, "");
myGroupUserMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(groupUser.profileUrl)); myGroupUserMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(groupUser.profileUrl));
myGroupUserMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupUser); myGroupUserMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupUser);
if (StringUtil.isNullOrEmpty(groupUser.favoriteRegisterDate)) { myGroupUserMap.put(ABookCommConstants.KEY.IS_FAVORITE, !StringUtil.isNullOrEmpty(groupUser.favoriteRegisterDate));
myGroupUserMap.put(ABookCommConstants.KEY.IS_FAVORITE, false);
} else {
myGroupUserMap.put(ABookCommConstants.KEY.IS_FAVORITE, true);
}
JSONObject jsonObject = new JSONObject(myGroupUserMap); JSONObject jsonObject = new JSONObject(myGroupUserMap);
groupUserArray.put(jsonObject); groupUserArray.put(jsonObject);
} }
groupUserJson.put(ABookCommConstants.KEY.GROUP_USER_LIST, groupUserArray); groupUserJson.put(ABookCommConstants.KEY.GROUP_USER_LIST, groupUserArray);
myGroupUsersJson.put(groupUserJson); myGroupUsersJson.put(groupUserJson);
} }
String myInfoStr = myGroupUsersJson.toString(); return myGroupUsersJson.toString();
return myInfoStr;
} }
public String getMyGroupUsersNotInRoom(Integer roomId) { public String getMyGroupUsersNotInRoom(Integer roomId) {
...@@ -310,19 +293,14 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -310,19 +293,14 @@ public class CommunicationLogic extends AbstractLogic {
myGroupUserMap.put(ABookCommConstants.KEY.CHECKED, ""); myGroupUserMap.put(ABookCommConstants.KEY.CHECKED, "");
myGroupUserMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(groupUser.profileUrl)); myGroupUserMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(groupUser.profileUrl));
myGroupUserMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupUser); myGroupUserMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupUser);
if (StringUtil.isNullOrEmpty(groupUser.favoriteRegisterDate)) { myGroupUserMap.put(ABookCommConstants.KEY.IS_FAVORITE, !StringUtil.isNullOrEmpty(groupUser.favoriteRegisterDate));
myGroupUserMap.put(ABookCommConstants.KEY.IS_FAVORITE, false);
} else {
myGroupUserMap.put(ABookCommConstants.KEY.IS_FAVORITE, true);
}
JSONObject jsonObject = new JSONObject(myGroupUserMap); JSONObject jsonObject = new JSONObject(myGroupUserMap);
groupUserArray.put(jsonObject); groupUserArray.put(jsonObject);
} }
groupUserJson.put(ABookCommConstants.KEY.GROUP_USER_LIST, groupUserArray); groupUserJson.put(ABookCommConstants.KEY.GROUP_USER_LIST, groupUserArray);
myGroupUsersJson.put(groupUserJson); myGroupUsersJson.put(groupUserJson);
} }
String myInfoStr = myGroupUsersJson.toString(); return myGroupUsersJson.toString();
return myInfoStr;
} }
public String getMyGroupUserByName(String keyword) { public String getMyGroupUserByName(String keyword) {
...@@ -346,17 +324,12 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -346,17 +324,12 @@ public class CommunicationLogic extends AbstractLogic {
userMap.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, shopMember.shopMemberName); userMap.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, shopMember.shopMemberName);
userMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(shopMember.profileUrl)); userMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(shopMember.profileUrl));
userMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupPathArray); userMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupPathArray);
if (StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate)) { userMap.put(ABookCommConstants.KEY.IS_FAVORITE, !StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate));
userMap.put(ABookCommConstants.KEY.IS_FAVORITE, false);
} else {
userMap.put(ABookCommConstants.KEY.IS_FAVORITE, true);
}
JSONObject jsonObject = new JSONObject(userMap); JSONObject jsonObject = new JSONObject(userMap);
resultJsonArray.put(jsonObject); resultJsonArray.put(jsonObject);
} }
String searchUserStr = resultJsonArray.toString(); return resultJsonArray.toString();
return searchUserStr;
} }
public String getMyGroupUserNotInRoomByName(String keywords, Integer roomId) { public String getMyGroupUserNotInRoomByName(String keywords, Integer roomId) {
...@@ -380,17 +353,12 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -380,17 +353,12 @@ public class CommunicationLogic extends AbstractLogic {
userMap.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, shopMember.shopMemberName); userMap.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, shopMember.shopMemberName);
userMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(shopMember.profileUrl)); userMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(shopMember.profileUrl));
userMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupPathArray); userMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupPathArray);
if (StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate)) { userMap.put(ABookCommConstants.KEY.IS_FAVORITE, !StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate));
userMap.put(ABookCommConstants.KEY.IS_FAVORITE, false);
} else {
userMap.put(ABookCommConstants.KEY.IS_FAVORITE, true);
}
JSONObject jsonObject = new JSONObject(userMap); JSONObject jsonObject = new JSONObject(userMap);
resultJsonArray.put(jsonObject); resultJsonArray.put(jsonObject);
} }
String searchUserStr = resultJsonArray.toString(); return resultJsonArray.toString();
return searchUserStr;
} }
public String getAllGroupShopMemberByName(String keyword) { public String getAllGroupShopMemberByName(String keyword) {
...@@ -413,17 +381,12 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -413,17 +381,12 @@ public class CommunicationLogic extends AbstractLogic {
userMap.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, shopMember.shopMemberName); userMap.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, shopMember.shopMemberName);
userMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(shopMember.profileUrl)); userMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(shopMember.profileUrl));
userMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupPathArray); userMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupPathArray);
if (StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate)) { userMap.put(ABookCommConstants.KEY.IS_FAVORITE, !StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate));
userMap.put(ABookCommConstants.KEY.IS_FAVORITE, false);
} else {
userMap.put(ABookCommConstants.KEY.IS_FAVORITE, true);
}
JSONObject jsonObject = new JSONObject(userMap); JSONObject jsonObject = new JSONObject(userMap);
resultJsonArray.put(jsonObject); resultJsonArray.put(jsonObject);
} }
String searchUserStr = resultJsonArray.toString(); return resultJsonArray.toString();
return searchUserStr;
} }
public String getAllGroupShopMemberNotInRoomByName(String keywords, Integer roomId) { public String getAllGroupShopMemberNotInRoomByName(String keywords, Integer roomId) {
...@@ -448,17 +411,12 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -448,17 +411,12 @@ public class CommunicationLogic extends AbstractLogic {
userMap.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, shopMember.shopMemberName); userMap.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, shopMember.shopMemberName);
userMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(shopMember.profileUrl)); userMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(shopMember.profileUrl));
userMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupPathArray); userMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupPathArray);
if (StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate)) { userMap.put(ABookCommConstants.KEY.IS_FAVORITE, !StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate));
userMap.put(ABookCommConstants.KEY.IS_FAVORITE, false);
} else {
userMap.put(ABookCommConstants.KEY.IS_FAVORITE, true);
}
JSONObject jsonObject = new JSONObject(userMap); JSONObject jsonObject = new JSONObject(userMap);
resultJsonArray.put(jsonObject); resultJsonArray.put(jsonObject);
} }
String searchUserStr = resultJsonArray.toString(); return resultJsonArray.toString();
return searchUserStr;
} }
public String getGroupByName(String keyword) { public String getGroupByName(String keyword) {
...@@ -470,29 +428,24 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -470,29 +428,24 @@ public class CommunicationLogic extends AbstractLogic {
Map<String, Object> groupMap = new HashMap<String, Object>(); Map<String, Object> groupMap = new HashMap<String, Object>();
groupMap.put(ABookCommConstants.KEY.GROUP_NAME, group.groupName); groupMap.put(ABookCommConstants.KEY.GROUP_NAME, group.groupName);
groupMap.put(ABookCommConstants.KEY.GROUP_ID, group.groupId); groupMap.put(ABookCommConstants.KEY.GROUP_ID, group.groupId);
if (StringUtil.isNullOrEmpty(group.favoriteRegisterDate)) { groupMap.put(ABookCommConstants.KEY.IS_FAVORITE, !StringUtil.isNullOrEmpty(group.favoriteRegisterDate));
groupMap.put(ABookCommConstants.KEY.IS_FAVORITE, false);
} else {
groupMap.put(ABookCommConstants.KEY.IS_FAVORITE, true);
}
JSONObject jsonObject = new JSONObject(groupMap); JSONObject jsonObject = new JSONObject(groupMap);
resultJsonArray.put(jsonObject); resultJsonArray.put(jsonObject);
} }
String groupsStr = resultJsonArray.toString(); return resultJsonArray.toString();
return groupsStr;
} }
public String getMyGroupIds() { public String getMyGroupIds() {
List<ChatGroupDto> myGroupList = chatGroupDao.getMyGroups(); List<ChatGroupDto> myGroupList = chatGroupDao.getMyGroups();
String groupIds = ""; StringBuilder groupIds = new StringBuilder();
for (ChatGroupDto myGroup : myGroupList) { for (ChatGroupDto myGroup : myGroupList) {
if (!groupIds.equals("")) { if (!groupIds.toString().equals("")) {
groupIds = groupIds + ","; groupIds.append(",");
} }
groupIds = groupIds + myGroup.groupId; groupIds.append(myGroup.groupId);
} }
return groupIds; return groupIds.toString();
} }
public List<ChatGroupDto> getAllGroup() { public List<ChatGroupDto> getAllGroup() {
...@@ -528,8 +481,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -528,8 +481,7 @@ public class CommunicationLogic extends AbstractLogic {
resultJsonArray.put(jsonObject); resultJsonArray.put(jsonObject);
} }
String favoriteUsersStr = resultJsonArray.toString(); return resultJsonArray.toString();
return favoriteUsersStr;
} }
public String getFavoriteUsersNotInRoom(Integer roomId) { public String getFavoriteUsersNotInRoom(Integer roomId) {
...@@ -558,8 +510,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -558,8 +510,7 @@ public class CommunicationLogic extends AbstractLogic {
resultJsonArray.put(jsonObject); resultJsonArray.put(jsonObject);
} }
String favoriteUsersStr = resultJsonArray.toString(); return resultJsonArray.toString();
return favoriteUsersStr;
} }
public String getFavoriteGroups() { public String getFavoriteGroups() {
...@@ -576,8 +527,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -576,8 +527,7 @@ public class CommunicationLogic extends AbstractLogic {
resultJsonArray.put(jsonObject); resultJsonArray.put(jsonObject);
} }
String favoriteGroupsStr = resultJsonArray.toString(); return resultJsonArray.toString();
return favoriteGroupsStr;
} }
public Integer getFavoriteCount() { public Integer getFavoriteCount() {
...@@ -628,11 +578,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -628,11 +578,7 @@ public class CommunicationLogic extends AbstractLogic {
Map<String, Object> groupTreeMap = new HashMap<String, Object>(); Map<String, Object> groupTreeMap = new HashMap<String, Object>();
groupTreeMap.put(ABookCommConstants.KEY.GROUP_NAME, group.groupName); groupTreeMap.put(ABookCommConstants.KEY.GROUP_NAME, group.groupName);
groupTreeMap.put(ABookCommConstants.KEY.GROUP_ID, group.groupId); groupTreeMap.put(ABookCommConstants.KEY.GROUP_ID, group.groupId);
if (StringUtil.isNullOrEmpty(group.favoriteRegisterDate)) { groupTreeMap.put(ABookCommConstants.KEY.IS_FAVORITE, !StringUtil.isNullOrEmpty(group.favoriteRegisterDate));
groupTreeMap.put(ABookCommConstants.KEY.IS_FAVORITE, false);
} else {
groupTreeMap.put(ABookCommConstants.KEY.IS_FAVORITE, true);
}
JSONObject jsonObject = new JSONObject(groupTreeMap); JSONObject jsonObject = new JSONObject(groupTreeMap);
childGroupJSONArray.put(jsonObject); childGroupJSONArray.put(jsonObject);
} }
...@@ -648,18 +594,13 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -648,18 +594,13 @@ public class CommunicationLogic extends AbstractLogic {
shopMemberMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(shopMember.profileUrl)); shopMemberMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(shopMember.profileUrl));
shopMemberMap.put(ABookCommConstants.KEY.CHECKED, ""); shopMemberMap.put(ABookCommConstants.KEY.CHECKED, "");
shopMemberMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, chatGroupDao.getUserGroupPathList(shopMember.shopMemberId)); shopMemberMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, chatGroupDao.getUserGroupPathList(shopMember.shopMemberId));
if (StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate)) { shopMemberMap.put(ABookCommConstants.KEY.IS_FAVORITE, !StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate));
shopMemberMap.put(ABookCommConstants.KEY.IS_FAVORITE, false);
} else {
shopMemberMap.put(ABookCommConstants.KEY.IS_FAVORITE, true);
}
JSONObject jsonObject = new JSONObject(shopMemberMap); JSONObject jsonObject = new JSONObject(shopMemberMap);
shopMemberJSONArray.put(jsonObject); shopMemberJSONArray.put(jsonObject);
} }
groupSearchData.put(ABookCommConstants.KEY.GROUP_USER_LIST,shopMemberJSONArray); groupSearchData.put(ABookCommConstants.KEY.GROUP_USER_LIST,shopMemberJSONArray);
String groupSearchDataStr = groupSearchData.toString(); return groupSearchData.toString();
return groupSearchDataStr;
} }
public String getGroupSearchDataForAddUser(Integer groupId, Integer roomId) { public String getGroupSearchDataForAddUser(Integer groupId, Integer roomId) {
...@@ -671,12 +612,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -671,12 +612,7 @@ public class CommunicationLogic extends AbstractLogic {
ChatGroupDto myGroup = chatGroupDao.getMyGroups().get(0); ChatGroupDto myGroup = chatGroupDao.getMyGroups().get(0);
ChatGroupDto rootGroup = chatGroupDao.getRootGroup(); ChatGroupDto rootGroup = chatGroupDao.getRootGroup();
Integer targetGroupId; Integer targetGroupId = groupId == 0 ? rootGroup.groupId : groupId;
if (groupId == 0) {
targetGroupId = rootGroup.groupId;
} else {
targetGroupId = groupId;
}
ChatGroupDto parentGroup = chatGroupDao.getParentGroup(targetGroupId); ChatGroupDto parentGroup = chatGroupDao.getParentGroup(targetGroupId);
if (parentGroup != null) { if (parentGroup != null) {
...@@ -704,11 +640,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -704,11 +640,7 @@ public class CommunicationLogic extends AbstractLogic {
Map<String, Object> groupTreeMap = new HashMap<String, Object>(); Map<String, Object> groupTreeMap = new HashMap<String, Object>();
groupTreeMap.put(ABookCommConstants.KEY.GROUP_NAME, group.groupName); groupTreeMap.put(ABookCommConstants.KEY.GROUP_NAME, group.groupName);
groupTreeMap.put(ABookCommConstants.KEY.GROUP_ID, group.groupId); groupTreeMap.put(ABookCommConstants.KEY.GROUP_ID, group.groupId);
if (StringUtil.isNullOrEmpty(group.favoriteRegisterDate)) { groupTreeMap.put(ABookCommConstants.KEY.IS_FAVORITE, !StringUtil.isNullOrEmpty(group.favoriteRegisterDate));
groupTreeMap.put(ABookCommConstants.KEY.IS_FAVORITE, false);
} else {
groupTreeMap.put(ABookCommConstants.KEY.IS_FAVORITE, true);
}
JSONObject jsonObject = new JSONObject(groupTreeMap); JSONObject jsonObject = new JSONObject(groupTreeMap);
childGroupJSONArray.put(jsonObject); childGroupJSONArray.put(jsonObject);
} }
...@@ -724,18 +656,13 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -724,18 +656,13 @@ public class CommunicationLogic extends AbstractLogic {
shopMemberMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(shopMember.profileUrl)); shopMemberMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(shopMember.profileUrl));
shopMemberMap.put(ABookCommConstants.KEY.CHECKED, ""); shopMemberMap.put(ABookCommConstants.KEY.CHECKED, "");
shopMemberMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, chatGroupDao.getUserGroupPathList(shopMember.shopMemberId)); shopMemberMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, chatGroupDao.getUserGroupPathList(shopMember.shopMemberId));
if (StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate)) { shopMemberMap.put(ABookCommConstants.KEY.IS_FAVORITE, !StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate));
shopMemberMap.put(ABookCommConstants.KEY.IS_FAVORITE, false);
} else {
shopMemberMap.put(ABookCommConstants.KEY.IS_FAVORITE, true);
}
JSONObject jsonObject = new JSONObject(shopMemberMap); JSONObject jsonObject = new JSONObject(shopMemberMap);
shopMemberJSONArray.put(jsonObject); shopMemberJSONArray.put(jsonObject);
} }
groupSearchData.put(ABookCommConstants.KEY.GROUP_USER_LIST,shopMemberJSONArray); groupSearchData.put(ABookCommConstants.KEY.GROUP_USER_LIST,shopMemberJSONArray);
String groupSearchDataStr = groupSearchData.toString(); return groupSearchData.toString();
return groupSearchDataStr;
} }
public void insertChatRoomList(List<ChatRoomDto> roomList) { public void insertChatRoomList(List<ChatRoomDto> roomList) {
...@@ -766,10 +693,6 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -766,10 +693,6 @@ public class CommunicationLogic extends AbstractLogic {
chatRoomDao.insertChatRoomUsers(userIdList, roomId); chatRoomDao.insertChatRoomUsers(userIdList, roomId);
} }
public void insertChatMessage(ChatMessageDto chatMessageDto) {
chatMessageDao.insertChatMessage(chatMessageDto);
}
public void updateChatRoomName(String roomName, Integer roomId) { public void updateChatRoomName(String roomName, Integer roomId) {
chatRoomDao.updateChatRoomName(roomName, roomId); chatRoomDao.updateChatRoomName(roomName, roomId);
} }
...@@ -789,22 +712,16 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -789,22 +712,16 @@ public class CommunicationLogic extends AbstractLogic {
ShopMemberDto myInfo = shopMemberDao.getMyInfo(); ShopMemberDto myInfo = shopMemberDao.getMyInfo();
List<ShopMemberDto> insertList = new ArrayList<ShopMemberDto>(); List<ShopMemberDto> insertList = new ArrayList<ShopMemberDto>();
List<ShopMemberDto> deleteList = new ArrayList<ShopMemberDto>();
for (ShopMemberDto shopMemberDto : shopMemberDtoList) { for (ShopMemberDto shopMemberDto : shopMemberDtoList) {
//if (ABookCommConstants.FLAG.DEL_FLAG.EXIST.equals(shopMemberDto.delFlg)) {
if (myInfo.shopMemberId.equals(shopMemberDto.shopMemberId)) { if (myInfo.shopMemberId.equals(shopMemberDto.shopMemberId)) {
shopMemberDto.selfFlg = 1; shopMemberDto.selfFlg = 1;
} else { } else {
shopMemberDto.selfFlg = 0; shopMemberDto.selfFlg = 0;
} }
insertList.add(shopMemberDto); insertList.add(shopMemberDto);
//} else {
// deleteList.add(shopMemberDto);
//}
} }
shopMemberDao.insertShopMember(insertList); shopMemberDao.insertShopMember(insertList);
//shopMemberDao.deleteShopMemberByList(deleteList);
} }
...@@ -884,12 +801,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -884,12 +801,7 @@ public class CommunicationLogic extends AbstractLogic {
} }
public ShopMemberDto getMyShopMemberDto() { public ShopMemberDto getMyShopMemberDto() {
ShopMemberDto myInfo = shopMemberDao.getMyInfo(); return shopMemberDao.getMyInfo();
return myInfo;
}
public void deleteChatRoomList() {
chatRoomDao.deleteChatRoom();
} }
public void insertMyInfo(ShopMemberDto shopMemberDto) { public void insertMyInfo(ShopMemberDto shopMemberDto) {
...@@ -940,13 +852,6 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -940,13 +852,6 @@ public class CommunicationLogic extends AbstractLogic {
archiveDao.deleteArchiveAllData(); archiveDao.deleteArchiveAllData();
} }
public void initChatData() {
chatGroupDao.deleteChatGroup();
chatMessageDao.deleteChatMessage();
shopMemberDao.deleteShopMember();
archiveDao.deleteArchiveAllData();
}
public void roomDisplayOff(Integer roomId, Integer viewFlg) { public void roomDisplayOff(Integer roomId, Integer viewFlg) {
chatRoomDao.changeRoomViewFlg(roomId, viewFlg); chatRoomDao.changeRoomViewFlg(roomId, viewFlg);
} }
...@@ -963,7 +868,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -963,7 +868,7 @@ public class CommunicationLogic extends AbstractLogic {
attendUsers.put(jsonObject); attendUsers.put(jsonObject);
} }
return attendUsers.toString(); return attendUsers.toString();
}; }
public String getProfileUrlPath(String profileUrl) { public String getProfileUrlPath(String profileUrl) {
if (profileUrl == null) { if (profileUrl == null) {
...@@ -974,12 +879,11 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -974,12 +879,11 @@ public class CommunicationLogic extends AbstractLogic {
String filePath = localFilePath + fileName; String filePath = localFilePath + fileName;
File file = new File(filePath); File file = new File(filePath);
if (file.exists()) { if (file.exists()) {
String uri = file.toURI().toString(); return file.toURI().toString();
return uri;
} else { } else {
return profileUrl; return profileUrl;
} }
}; }
public String getFileUrlPath(String fileUrlPath) { public String getFileUrlPath(String fileUrlPath) {
if (!fileUrlPath.contains("fileName=")) { if (!fileUrlPath.contains("fileName=")) {
...@@ -999,7 +903,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -999,7 +903,7 @@ public class CommunicationLogic extends AbstractLogic {
} else { } else {
return fileUrlPath; return fileUrlPath;
} }
}; }
public void setPackagePath(String localFilePath) { public void setPackagePath(String localFilePath) {
this.localFilePath = localFilePath; this.localFilePath = localFilePath;
...@@ -1097,21 +1001,6 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -1097,21 +1001,6 @@ public class CommunicationLogic extends AbstractLogic {
return resultJsonArray.toString(); return resultJsonArray.toString();
} }
public String getCollaborationMemberList(Integer collaborationDetailId) {
List<ShopMemberDto> shopMemberDtoListDtoList = shopMemberDao.getCollaborationMemberList(collaborationDetailId);
JSONArray resultJsonArray = new JSONArray();
for (ShopMemberDto dto : shopMemberDtoListDtoList) {
Map<String, Object> userMap = new HashMap<String, Object>();
userMap.put(ABookCommConstants.KEY.SHOP_MEMBER_ID, dto.shopMemberId);
userMap.put(ABookCommConstants.KEY.LOGIN_ID, dto.loginId);
userMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(dto.profileUrl));
userMap.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, dto.shopMemberName);
JSONObject jsonObject = new JSONObject(userMap);
resultJsonArray.put(jsonObject);
}
return resultJsonArray.toString();
}
public Map<Integer, ChatGroupDto> convertGroupListToMap(List<ChatGroupDto> groupList) { public Map<Integer, ChatGroupDto> convertGroupListToMap(List<ChatGroupDto> groupList) {
Map<Integer, ChatGroupDto> map = new HashMap<Integer, ChatGroupDto>(); Map<Integer, ChatGroupDto> map = new HashMap<Integer, ChatGroupDto>();
for (ChatGroupDto group : groupList) { for (ChatGroupDto group : groupList) {
......
...@@ -144,20 +144,25 @@ public class ChatData { ...@@ -144,20 +144,25 @@ public class ChatData {
} }
public void updateMyInfoFromServer() throws NetworkDisconnectedException, AcmsException { public void updateMyInfoFromServer() throws NetworkDisconnectedException, AcmsException {
MyInfoJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).getMyInfo(sid); MyInfoJSON resultJson = AcmsClient
.getInstance(ABVEnvironment.getInstance().networkAdapter)
.getMyInfo(sid);
if (resultJson.shopMemberDto != null) { if (resultJson.shopMemberDto != null) {
communicationLogic.insertMyInfo(resultJson.shopMemberDto); communicationLogic.insertMyInfo(resultJson.shopMemberDto);
} }
} }
public void updateUserInfoFromServer(String shopMemberId) throws NetworkDisconnectedException, AcmsException { public void updateUserInfoFromServer(String shopMemberId) throws NetworkDisconnectedException, AcmsException {
MyInfoJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter) MyInfoJSON resultJson = AcmsClient
.getInstance(ABVEnvironment.getInstance().networkAdapter)
.getNameCard(sid, shopMemberId); .getNameCard(sid, shopMemberId);
communicationLogic.insertShopMember(resultJson.shopMemberDto); communicationLogic.insertShopMember(resultJson.shopMemberDto);
} }
public boolean insertFavoriteUser(String shopMemberId) throws NetworkDisconnectedException, AcmsException { public boolean insertFavoriteUser(String shopMemberId) throws NetworkDisconnectedException, AcmsException {
boolean result = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).insertFavoriteUser(sid,Integer.parseInt(shopMemberId)); boolean result = AcmsClient
.getInstance(ABVEnvironment.getInstance().networkAdapter)
.insertFavoriteUser(sid,Integer.parseInt(shopMemberId));
if (!result) { return false; } if (!result) { return false; }
List<Integer> shopMeberIds = new ArrayList<>(); List<Integer> shopMeberIds = new ArrayList<>();
shopMeberIds.add(Integer.parseInt(shopMemberId)); shopMeberIds.add(Integer.parseInt(shopMemberId));
...@@ -166,7 +171,8 @@ public class ChatData { ...@@ -166,7 +171,8 @@ public class ChatData {
} }
public boolean deleteFavoriteUser(String shopMemberId) throws NetworkDisconnectedException, AcmsException { public boolean deleteFavoriteUser(String shopMemberId) throws NetworkDisconnectedException, AcmsException {
boolean result = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter) boolean result = AcmsClient
.getInstance(ABVEnvironment.getInstance().networkAdapter)
.deleteFavoriteUser(sid, Integer.parseInt(shopMemberId)); .deleteFavoriteUser(sid, Integer.parseInt(shopMemberId));
if (result) { if (result) {
List<Integer> deleteFavoriteList = new ArrayList<Integer>(); List<Integer> deleteFavoriteList = new ArrayList<Integer>();
...@@ -177,18 +183,23 @@ public class ChatData { ...@@ -177,18 +183,23 @@ public class ChatData {
} }
public boolean insertFavoriteGroup(String groupId) throws NetworkDisconnectedException, AcmsException { public boolean insertFavoriteGroup(String groupId) throws NetworkDisconnectedException, AcmsException {
boolean result = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter) boolean result = AcmsClient
.getInstance(ABVEnvironment.getInstance().networkAdapter)
.insertFavoriteGroup(sid, Integer.parseInt(groupId)); .insertFavoriteGroup(sid, Integer.parseInt(groupId));
return result; return result;
} }
public void updateUnreadCount() throws NetworkDisconnectedException, AcmsException { public void updateUnreadCount() throws NetworkDisconnectedException, AcmsException {
UnreadCountJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).getMessagesUnreadCount(sid, Integer.toString(roomId.intValue())); UnreadCountJSON resultJson = AcmsClient
.getInstance(ABVEnvironment.getInstance().networkAdapter)
.getMessagesUnreadCount(sid, Integer.toString(roomId.intValue()));
communicationLogic.updateUnreadCount(resultJson.chatMessageDtoArrayList, Integer.toString(roomId.intValue())); communicationLogic.updateUnreadCount(resultJson.chatMessageDtoArrayList, Integer.toString(roomId.intValue()));
} }
public void updateMessageFromMessageId(String messageId) throws NetworkDisconnectedException, AcmsException { public void updateMessageFromMessageId(String messageId) throws NetworkDisconnectedException, AcmsException {
MessageInfoListJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).getMessages(sid, Integer.toString(roomId.intValue()), messageId, null); MessageInfoListJSON resultJson = AcmsClient
.getInstance(ABVEnvironment.getInstance().networkAdapter)
.getMessages(sid, Integer.toString(roomId.intValue()), messageId, null);
for (ChatMessageDto chatMessageDto : resultJson.chatMessageDtoArrayList) { for (ChatMessageDto chatMessageDto : resultJson.chatMessageDtoArrayList) {
chatMessageDto.chatRoomId = roomId.intValue(); chatMessageDto.chatRoomId = roomId.intValue();
} }
...@@ -198,7 +209,9 @@ public class ChatData { ...@@ -198,7 +209,9 @@ public class ChatData {
} }
public void updateRoomList() throws NetworkDisconnectedException, AcmsException { public void updateRoomList() throws NetworkDisconnectedException, AcmsException {
RoomListJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).getRoomList(sid); RoomListJSON resultJson = AcmsClient
.getInstance(ABVEnvironment.getInstance().networkAdapter)
.getRoomList(sid);
communicationLogic.insertChatRoomList(resultJson.roomList); communicationLogic.insertChatRoomList(resultJson.roomList);
} }
...@@ -209,7 +222,9 @@ public class ChatData { ...@@ -209,7 +222,9 @@ public class ChatData {
* @throws AcmsException * @throws AcmsException
*/ */
public void changeRoomName(String changeRoomName) throws NetworkDisconnectedException, AcmsException { public void changeRoomName(String changeRoomName) throws NetworkDisconnectedException, AcmsException {
ChangeRoomNameJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).changeRoomName(sid, changeRoomName, roomId.intValue()); ChangeRoomNameJSON resultJson = AcmsClient
.getInstance(ABVEnvironment.getInstance().networkAdapter)
.changeRoomName(sid, changeRoomName, roomId.intValue());
if (resultJson.status != 200) { return; } if (resultJson.status != 200) { return; }
communicationLogic.updateChatRoomName(changeRoomName, roomId.intValue()); communicationLogic.updateChatRoomName(changeRoomName, roomId.intValue());
...@@ -227,7 +242,9 @@ public class ChatData { ...@@ -227,7 +242,9 @@ public class ChatData {
public void updateArchiveList() throws NetworkDisconnectedException, AcmsException { public void updateArchiveList() throws NetworkDisconnectedException, AcmsException {
SharedPreferences pref = context.getSharedPreferences(ABookCommConstants.TAG, Context.MODE_PRIVATE); SharedPreferences pref = context.getSharedPreferences(ABookCommConstants.TAG, Context.MODE_PRIVATE);
String updateDate = pref.getString(ABookCommConstants.KEY.ARCHIVE_UPDATED_DATE, ABookCommConstants.DEFAULT_CHECKSUM); String updateDate = pref.getString(ABookCommConstants.KEY.ARCHIVE_UPDATED_DATE, ABookCommConstants.DEFAULT_CHECKSUM);
ArchiveListJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).getArchives(sid, updateDate); ArchiveListJSON resultJson = AcmsClient
.getInstance(ABVEnvironment.getInstance().networkAdapter)
.getArchives(sid, updateDate);
communicationLogic.updateArchives(resultJson.archiveList); communicationLogic.updateArchives(resultJson.archiveList);
if (StringUtil.isNullOrEmpty(resultJson.archiveLastUpdateDate)) { return; } if (StringUtil.isNullOrEmpty(resultJson.archiveLastUpdateDate)) { return; }
SharedPreferences.Editor editor = pref.edit(); SharedPreferences.Editor editor = pref.edit();
...@@ -237,7 +254,9 @@ public class ChatData { ...@@ -237,7 +254,9 @@ public class ChatData {
public void updateArchiveDetail(String archiveId) throws NetworkDisconnectedException, AcmsException { public void updateArchiveDetail(String archiveId) throws NetworkDisconnectedException, AcmsException {
ArchiveDto archiveDto = communicationLogic.getArchive(Integer.parseInt(archiveId)); ArchiveDto archiveDto = communicationLogic.getArchive(Integer.parseInt(archiveId));
RoomJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).getRoom(sid, archiveDto.roomId.toString()); RoomJSON resultJson = AcmsClient
.getInstance(ABVEnvironment.getInstance().networkAdapter)
.getRoom(sid, archiveDto.roomId.toString());
archiveDto.roomName = resultJson.chatRoomDto.chatRoomName; archiveDto.roomName = resultJson.chatRoomDto.chatRoomName;
communicationLogic.updateArchiveDetial(archiveDto); communicationLogic.updateArchiveDetial(archiveDto);
} }
...@@ -276,12 +295,16 @@ public class ChatData { ...@@ -276,12 +295,16 @@ public class ChatData {
finishAllCollaboration(sid, roomId.intValue()); finishAllCollaboration(sid, roomId.intValue());
} }
private void updateFavoriteUser() throws NetworkDisconnectedException, AcmsException { private void updateFavoriteUser() throws NetworkDisconnectedException, AcmsException {
GetFavoriteUserJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).getFavoriteUser(sid); GetFavoriteUserJSON resultJson = AcmsClient
.getInstance(ABVEnvironment.getInstance().networkAdapter)
.getFavoriteUser(sid);
communicationLogic.updateFavoriteUser(resultJson.favoriteUserIds); communicationLogic.updateFavoriteUser(resultJson.favoriteUserIds);
} }
public void updateFavoriteGroup() throws NetworkDisconnectedException, AcmsException { public void updateFavoriteGroup() throws NetworkDisconnectedException, AcmsException {
GetFavoriteGroupJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).getFavoriteGroup(sid); GetFavoriteGroupJSON resultJson = AcmsClient
.getInstance(ABVEnvironment.getInstance().networkAdapter)
.getFavoriteGroup(sid);
communicationLogic.updateFavoriteGroup(resultJson.favoriteGroupIds); communicationLogic.updateFavoriteGroup(resultJson.favoriteGroupIds);
} }
...@@ -294,12 +317,13 @@ public class ChatData { ...@@ -294,12 +317,13 @@ public class ChatData {
updateFavoriteGroup(); updateFavoriteGroup();
} }
public void updateGroupInfoFromServer() throws NetworkDisconnectedException, AcmsException { public void updateGroupInfoFromServer() throws NetworkDisconnectedException {
ArrayList<String> checkSumList = new ArrayList<String>();
SharedPreferences pref = context.getSharedPreferences(ABookCommConstants.TAG, Context.MODE_PRIVATE); SharedPreferences pref = context.getSharedPreferences(ABookCommConstants.TAG, Context.MODE_PRIVATE);
String lastUpdatedDate = pref.getString(ABookCommConstants.KEY.GROUP_MEMBER_UPDATED_DATE, ABookCommConstants.DEFAULT_CHECKSUM); String lastUpdatedDate = pref.getString(ABookCommConstants.KEY.GROUP_MEMBER_UPDATED_DATE, ABookCommConstants.DEFAULT_CHECKSUM);
try { try {
GroupListJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).getGroupInfo(sid, lastUpdatedDate); GroupListJSON resultJson = AcmsClient
.getInstance(ABVEnvironment.getInstance().networkAdapter)
.getGroupInfo(sid, lastUpdatedDate);
if (CollectionUtil.isNotEmpty(resultJson.groupList)) { if (CollectionUtil.isNotEmpty(resultJson.groupList)) {
communicationLogic.updateGroup(resultJson.groupList); communicationLogic.updateGroup(resultJson.groupList);
SharedPreferences.Editor editor = pref.edit(); SharedPreferences.Editor editor = pref.edit();
......
...@@ -23,8 +23,6 @@ import android.os.AsyncTask; ...@@ -23,8 +23,6 @@ import android.os.AsyncTask;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.Environment; import android.os.Environment;
import android.provider.BaseColumns;
import android.provider.MediaStore;
import android.support.annotation.RequiresApi; import android.support.annotation.RequiresApi;
import android.util.Log; import android.util.Log;
import android.view.KeyEvent; import android.view.KeyEvent;
...@@ -56,8 +54,6 @@ import java.util.TimerTask; ...@@ -56,8 +54,6 @@ import java.util.TimerTask;
import jp.agentec.abook.abv.bl.acms.client.AcmsClient; import jp.agentec.abook.abv.bl.acms.client.AcmsClient;
import jp.agentec.abook.abv.bl.acms.client.json.CreatedRoomJSON; import jp.agentec.abook.abv.bl.acms.client.json.CreatedRoomJSON;
import jp.agentec.abook.abv.bl.acms.client.json.GetFavoriteGroupJSON;
import jp.agentec.abook.abv.bl.acms.client.json.GetFavoriteUserJSON;
import jp.agentec.abook.abv.bl.acms.client.json.MessageInfoListJSON; import jp.agentec.abook.abv.bl.acms.client.json.MessageInfoListJSON;
import jp.agentec.abook.abv.bl.acms.client.json.UserInviteResultJSON; import jp.agentec.abook.abv.bl.acms.client.json.UserInviteResultJSON;
import jp.agentec.abook.abv.bl.common.ABVEnvironment; import jp.agentec.abook.abv.bl.common.ABVEnvironment;
...@@ -71,7 +67,6 @@ import jp.agentec.abook.abv.bl.data.ABVDataCache; ...@@ -71,7 +67,6 @@ import jp.agentec.abook.abv.bl.data.ABVDataCache;
import jp.agentec.abook.abv.bl.dto.ChatMessageDto; import jp.agentec.abook.abv.bl.dto.ChatMessageDto;
import jp.agentec.abook.abv.bl.dto.ChatRoomDto; import jp.agentec.abook.abv.bl.dto.ChatRoomDto;
import jp.agentec.abook.abv.bl.dto.MeetingDto; import jp.agentec.abook.abv.bl.dto.MeetingDto;
import jp.agentec.abook.abv.bl.dto.PushMessageDto;
import jp.agentec.abook.abv.bl.dto.ShopMemberDto; import jp.agentec.abook.abv.bl.dto.ShopMemberDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic; import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.CommunicationLogic; import jp.agentec.abook.abv.bl.logic.CommunicationLogic;
...@@ -102,28 +97,28 @@ import static org.chromium.net.NetError.ERR_FAILED; ...@@ -102,28 +97,28 @@ import static org.chromium.net.NetError.ERR_FAILED;
*/ */
public class ChatWebViewActivity extends CommunicationWebViewActivity { public class ChatWebViewActivity extends CommunicationWebViewActivity {
public ChatWebView mChatWebView; private ChatWebView mChatWebView;
private String chatWebviewUrl; private String chatWebviewUrl;
private final String TAG = "ChatWebViewActivity"; private final String TAG = "ChatWebViewActivity";
private ValueCallback<Uri[]> mUploadMessage; private ValueCallback<Uri[]> mUploadMessage;
public ChatData chatData; private ChatData chatData;
public String selectedUserIdList; private String selectedUserIdList;
public String mSkey; private String mSkey;
private boolean isPIP; private boolean isPIP;
private boolean isStop; private boolean isStop;
private String encodedFilePath; private String encodedFilePath;
public MeetingManager meetingManager = MeetingManager.getInstance(); private MeetingManager meetingManager = MeetingManager.getInstance();
public AlertDialog myAlertDialog; private AlertDialog myAlertDialog;
private BroadcastReceiver receiver; private BroadcastReceiver receiver;
private CommunicationLogic communicationLogic = AbstractLogic.getLogic(CommunicationLogic.class); private final CommunicationLogic communicationLogic = AbstractLogic.getLogic(CommunicationLogic.class);
public boolean needHostAlert = false; private boolean needHostAlert = false;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
...@@ -133,7 +128,10 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -133,7 +128,10 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
} }
initializeWebView(); initializeWebView();
FrameLayout layout = new FrameLayout(this); FrameLayout layout = new FrameLayout(this);
FrameLayout.LayoutParams param = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); FrameLayout.LayoutParams param = new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT
);
setContentView(mChatWebView, param); setContentView(mChatWebView, param);
} }
...@@ -150,13 +148,13 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -150,13 +148,13 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
private void initiateDatas(Intent intent) { private void initiateDatas(Intent intent) {
communicationLogic.setPackagePath(getFilesDir().getAbsolutePath() + "/"); communicationLogic.setPackagePath(getFilesDir().getAbsolutePath() + "/");
chatData = ChatData.getInstance(); chatData = ChatData.getInstance();
chatData.setSid(intent.getStringExtra("sid")); chatData.setSid(intent.getStringExtra(ABookCommConstants.KEY.SID));
chatData.setRoomID(intent.getLongExtra("roomId", 0)); chatData.setRoomID(intent.getLongExtra(ABookCommConstants.KEY.ROOM_ID, 0));
chatData.roomName = intent.getStringExtra("roomName"); chatData.roomName = intent.getStringExtra(ABookCommConstants.KEY.ROOM_NAME);
chatData.roomType = intent.getStringExtra("roomType"); chatData.roomType = intent.getStringExtra(ABookCommConstants.KEY.ROOM_TYPE);
chatData.loginId = intent.getStringExtra("loginId"); chatData.loginId = intent.getStringExtra(ABookCommConstants.KEY.LOGIN_ID);
chatData.shopName = intent.getStringExtra("shopName"); chatData.shopName = intent.getStringExtra(ABookCommConstants.KEY.SHOP_NAME);
chatData.setStrCollaborationType(intent.getStringExtra("collaborationType")); chatData.setStrCollaborationType(intent.getStringExtra(ABookCommConstants.KEY.COLLABORATION_TYPE));
chatData.setIsOnline(false); chatData.setIsOnline(false);
chatData.setContext(ChatWebViewActivity.this); chatData.setContext(ChatWebViewActivity.this);
chatData.setIsMobile(!isNormalSize()); chatData.setIsMobile(!isNormalSize());
...@@ -164,7 +162,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -164,7 +162,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
private void setupChatWebView() { private void setupChatWebView() {
mChatWebView = new ChatWebView(ChatWebViewActivity.this); mChatWebView = new ChatWebView(ChatWebViewActivity.this);
mChatWebView.init(chatData); mChatWebView.configue(chatData);
} }
private void setupDefaultChatWebViewURL() { private void setupDefaultChatWebViewURL() {
...@@ -220,11 +218,22 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -220,11 +218,22 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
private void registChatRoomPageLoader() { private void registChatRoomPageLoader() {
// 最後のチャットのルーム名 // 最後のチャットのルーム名
String lastRoomName = PreferenceUtil.getUserPref(getApplicationContext(), AppDefType.UserPrefKey.CHAT_LAST_ROOMNAME, ""); String lastRoomName = PreferenceUtil
.getUserPref(
getApplicationContext(),
AppDefType.UserPrefKey.CHAT_LAST_ROOMNAME,
""
);
// 最後のチャットのルーム // 最後のチャットのルーム
String lastRoomId = PreferenceUtil.getUserPref(getApplicationContext(), AppDefType.UserPrefKey.CHAT_LAST_ROOMID, ""); String lastRoomId = PreferenceUtil
.getUserPref(
String fixedParam = "&platform=android&isMobile=true&chatServerUrl=" + ABVEnvironment.getInstance().websocketServerHttpUrl; getApplicationContext(),
AppDefType.UserPrefKey.CHAT_LAST_ROOMID,
""
);
String fixedParam = "&platform=android&isMobile=true&chatServerUrl="
+ ABVEnvironment.getInstance().websocketServerHttpUrl;
//ページをロード //ページをロード
if (chatData.roomId != 0 && chatData.roomName != null) { // by push message if (chatData.roomId != 0 && chatData.roomName != null) { // by push message
try { try {
...@@ -237,25 +246,38 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -237,25 +246,38 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
chatData.roomType = communicationLogic.getChatRoom(integerRoomId).type.toString(); chatData.roomType = communicationLogic.getChatRoom(integerRoomId).type.toString();
} }
if (StringUtil.isNullOrEmpty(chatData.getStrCollaborationType())) { if (StringUtil.isNullOrEmpty(chatData.getStrCollaborationType())) {
String parameterData = "sid=" + chatData.sid + "&loginId=" + chatData.loginId + "&shopName=" + chatData.shopName + "&roomId=" + chatData.roomId + "&roomName=" + chatData.roomName + fixedParam; String parameterData = "sid=" + chatData.sid
+ "&loginId=" + chatData.loginId
+ "&shopName=" + chatData.shopName
+ "&roomId=" + chatData.roomId
+ "&roomName=" + chatData.roomName
+ fixedParam;
mChatWebView.postUrl(ABookCommConstants.CHAT_ROOM_PAGE_URL, parameterData.getBytes()); mChatWebView.postUrl(ABookCommConstants.CHAT_ROOM_PAGE_URL, parameterData.getBytes());
} else { } else {
chatData.setCollaborationJoinFlg(ABookCommConstants.FLAG.COLLABORATION_JOIN_FLG.INVITE); chatData.setCollaborationJoinFlg(ABookCommConstants.FLAG.COLLABORATION_JOIN_FLG.INVITE);
try { try {
AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).joinCollaboration(chatData.sid, chatData.roomId.intValue()); AcmsClient
} catch (NetworkDisconnectedException e) { .getInstance(ABVEnvironment.getInstance().networkAdapter)
e.printStackTrace(); .joinCollaboration(chatData.sid, chatData.roomId.intValue());
} catch (AcmsException e) { } catch (NetworkDisconnectedException | AcmsException e) {
e.printStackTrace(); e.printStackTrace();
} }
moveCollaborationScreen(Integer.parseInt(chatData.getStrCollaborationType())); moveCollaborationScreen(Integer.parseInt(chatData.getStrCollaborationType()));
} }
} else { // Chat } else { // Chat
if (lastRoomName.length() > 0 && lastRoomId.length() > 0) { if (lastRoomName.length() > 0 && lastRoomId.length() > 0) {
String parameterData = "sid=" + chatData.sid + "&loginId=" + chatData.loginId + "&shopName=" + chatData.shopName + "&roomId=" + lastRoomId + "&roomName=" + lastRoomName + fixedParam; String parameterData = "sid=" + chatData.sid
+ "&loginId=" + chatData.loginId
+ "&shopName=" + chatData.shopName
+ "&roomId=" + lastRoomId
+ "&roomName=" + lastRoomName
+ fixedParam;
mChatWebView.postUrl(chatWebviewUrl, parameterData.getBytes()); mChatWebView.postUrl(chatWebviewUrl, parameterData.getBytes());
} else { } else {
String parameterData = "sid=" + chatData.sid + "&loginId=" + chatData.loginId + "&shopName=" + chatData.shopName + fixedParam; String parameterData = "sid=" + chatData.sid
+ "&loginId=" + chatData.loginId
+ "&shopName=" + chatData.shopName
+ fixedParam;
mChatWebView.postUrl(chatWebviewUrl, parameterData.getBytes()); mChatWebView.postUrl(chatWebviewUrl, parameterData.getBytes());
} }
} }
...@@ -274,10 +296,10 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -274,10 +296,10 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> filePathCallback, FileChooserParams fileChooserParams) { public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> filePathCallback, FileChooserParams fileChooserParams) {
boolean result = false; boolean result = false;
// 画像が選択された場合 // 画像が選択された場合
if (fileChooserParams.getAcceptTypes()[0].toLowerCase().indexOf(ABookKeys.IMAGE) != -1) { if (fileChooserParams.getAcceptTypes()[0].toLowerCase().contains(ABookKeys.IMAGE)) {
result = startCameraIntent(ABOOK_CHECK_TASK_IMAGE, "Camera", ABookKeys.IMAGE, true); result = startCameraIntent(ABOOK_CHECK_TASK_IMAGE, "Camera", ABookKeys.IMAGE, true);
// 動画が選択された場合 // 動画が選択された場合
} else if (fileChooserParams.getAcceptTypes()[0].toLowerCase().indexOf(ABookKeys.VIDEO) != -1) { } else if (fileChooserParams.getAcceptTypes()[0].toLowerCase().contains(ABookKeys.VIDEO)) {
result = startCameraIntent(ABOOK_CHECK_TASK_VIDEO, "Camera", ABookKeys.VIDEO, true); result = startCameraIntent(ABOOK_CHECK_TASK_VIDEO, "Camera", ABookKeys.VIDEO, true);
} }
if (result) { if (result) {
...@@ -293,9 +315,8 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -293,9 +315,8 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
// message.equals で、 fermi側のHTMLを解析して、処理を分けている。 // message.equals で、 fermi側のHTMLを解析して、処理を分けている。
@Override @Override
public boolean onJsAlert(WebView view, String url, String message, final JsResult result) { public boolean onJsAlert(WebView view, String url, String message, final JsResult result) {
if (mChatWebView.getUrl() != null && mChatWebView.getUrl().equals(ABookCommConstants.COLLABORATION_PAGE_URL)) { mChatWebView.extendHeartBeatIfNeeded();
mChatWebView.loadUrl("javascript:coview_api.HeartBeatUser(globalUserInfo.loginId);");
}
if (myAlertDialog != null && myAlertDialog.isShowing()) { if (myAlertDialog != null && myAlertDialog.isShowing()) {
result.confirm(); result.confirm();
return true; return true;
...@@ -326,13 +347,13 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -326,13 +347,13 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
} else if (message.equals("SC_FORBIDDEN")) { } else if (message.equals("SC_FORBIDDEN")) {
message = getString(R.string.msg_error_chat_room_sc_forbidden); message = getString(R.string.msg_error_chat_room_sc_forbidden);
} else if (message.contains("Send owner complete")) { } else if (message.contains("Send owner complete")) {
mChatWebView.loadUrl("javascript:$('#userNameCardInCollaboration').modal('hide');"); mChatWebView.hideNameCardInCollaboaration();
result.confirm(); result.confirm();
return true; return true;
} else if (message.contains("REJECT for owner user")) { } else if (message.contains("REJECT for owner user")) {
mChatWebView.loadUrl("javascript:$('#userNameCardInCollaboration').modal('hide');"); mChatWebView.hideNameCardInCollaboaration();
mChatWebView.loadUrl("javascript:$('#hostRequestModal').modal('hide');"); mChatWebView.hideHostRequestModal();
mChatWebView.loadUrl("javascript:$('#userNameCardInCollaboration').modal('hide');"); mChatWebView.hideNameCardInCollaboaration();
message = getString(R.string.msg_rejected_by_host); message = getString(R.string.msg_rejected_by_host);
} else if (message.contains("Invalid Parameters")) { } else if (message.contains("Invalid Parameters")) {
message = getString(R.string.msg_invalid_parameters); message = getString(R.string.msg_invalid_parameters);
...@@ -344,7 +365,8 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -344,7 +365,8 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
final String tempMessage = message; final String tempMessage = message;
ABookAlertDialog dialog = AlertDialogUtil.createAlertDialog(ChatWebViewActivity.this, R.string.app_name); ABookAlertDialog dialog = AlertDialogUtil
.createAlertDialog(ChatWebViewActivity.this, R.string.app_name);
dialog.setMessage(message); dialog.setMessage(message);
dialog.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { dialog.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
@Override @Override
...@@ -357,8 +379,10 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -357,8 +379,10 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
public void onDismiss(DialogInterface dialog) { public void onDismiss(DialogInterface dialog) {
// サーバと接続された場合、チャット画面を閉じる // サーバと接続された場合、チャット画面を閉じる
if (tempMessage.equals(getString(R.string.msg_error_chat_disconnected)) || tempMessage.equals(getString(R.string.msg_error_chat_room_sc_forbidden))) { if (tempMessage.equals(getString(R.string.msg_error_chat_disconnected))
mChatWebView.loadUrl("javascript:ReverseDelegate.leaveRoom()"); || tempMessage.equals(getString(R.string.msg_error_chat_room_sc_forbidden)))
{
mChatWebView.leaveRoom();
finish(); finish();
} else if (tempMessage.equals(getString(R.string.msg_error_chat_join))) { } else if (tempMessage.equals(getString(R.string.msg_error_chat_join))) {
finish(); finish();
...@@ -369,7 +393,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -369,7 +393,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
mChatWebView.loadUrl(ABookCommConstants.CHAT_PAGE_URL); mChatWebView.loadUrl(ABookCommConstants.CHAT_PAGE_URL);
} }
} else if (tempMessage.equals(getString(R.string.error_fail_record))) { } else if (tempMessage.equals(getString(R.string.error_fail_record))) {
mChatWebView.loadUrl("javascript:recordFinished()"); mChatWebView.recordFinished();
} }
} }
}); });
...@@ -398,9 +422,9 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -398,9 +422,9 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
} else if (message.equals("방장 권한을 전달 받으시겠습니까?")){ } else if (message.equals("방장 권한을 전달 받으시겠습니까?")){
message = getString(R.string.msg_confirm_send_host_change); message = getString(R.string.msg_confirm_send_host_change);
if (chatData.getHostRequestFlg() == 1) { if (chatData.getHostRequestFlg() == 1) {
mChatWebView.loadUrl("javascript:penOff();"); mChatWebView.penOff();
mChatWebView.loadUrl("javascript:$('#hostRequestModal').modal('hide');"); mChatWebView.hideHostRequestModal();
mChatWebView.loadUrl("javascript:$('#userNameCardInCollaboration').modal('hide');"); mChatWebView.hideNameCardInCollaboaration();
if (meetingManager.isConnected() && meetingManager.isSubscribed()) { if (meetingManager.isConnected() && meetingManager.isSubscribed()) {
sendPromoteRequest(); sendPromoteRequest();
} }
...@@ -412,47 +436,65 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -412,47 +436,65 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
} else if (message.contains("Create room anyway?")) { } else if (message.contains("Create room anyway?")) {
message = getString(R.string.msg_destroy_exist_collaboration); message = getString(R.string.msg_destroy_exist_collaboration);
} }
final ABookAlertDialog confirmAlert = AlertDialogUtil.createAlertDialog(ChatWebViewActivity.this, R.string.app_name); final ABookAlertDialog confirmAlert = AlertDialogUtil
.createAlertDialog(ChatWebViewActivity.this, R.string.app_name);
confirmAlert.setMessage(message); confirmAlert.setMessage(message);
if (message.equals(getString(R.string.msg_error_already_exist_same_room))) { if (message.equals(getString(R.string.msg_error_already_exist_same_room))) {
confirmAlert.setButton(DialogInterface.BUTTON_POSITIVE, getResources().getString(R.string.move), new DialogInterface.OnClickListener() { confirmAlert.setButton(
@Override DialogInterface.BUTTON_POSITIVE,
public void onClick(DialogInterface dialog, int which) { getResources().getString(R.string.move),
result.confirm(); new DialogInterface.OnClickListener() {
} @Override
}); public void onClick(DialogInterface dialog, int which) {
result.confirm();
}
}
);
} else if (message.equals(getString(R.string.msg_confirm_send_host_change))){ } else if (message.equals(getString(R.string.msg_confirm_send_host_change))){
confirmAlert.setButton(DialogInterface.BUTTON_POSITIVE, getResources().getString(R.string.confirm), new DialogInterface.OnClickListener() { confirmAlert.setButton(
@Override DialogInterface.BUTTON_POSITIVE,
public void onClick(DialogInterface dialog, int which) { getResources().getString(R.string.confirm),
mChatWebView.loadUrl("javascript:penOff();"); new DialogInterface.OnClickListener() {
mChatWebView.loadUrl("javascript:$('#hostRequestModal').modal('hide');"); @Override
mChatWebView.loadUrl("javascript:$('#userNameCardInCollaboration').modal('hide');"); public void onClick(DialogInterface dialog, int which) {
if (meetingManager.isConnected() && meetingManager.isSubscribed()) { mChatWebView.penOff();
sendPromoteRequest(); mChatWebView.hideHostRequestModal();
mChatWebView.hideNameCardInCollaboaration();
if (meetingManager.isConnected() && meetingManager.isSubscribed()) {
sendPromoteRequest();
}
result.confirm();
}
} }
result.confirm(); );
}
});
} else { } else {
confirmAlert.setButton(DialogInterface.BUTTON_POSITIVE, getResources().getString(R.string.confirm), new DialogInterface.OnClickListener() { confirmAlert.setButton(
@Override DialogInterface.BUTTON_POSITIVE,
public void onClick(DialogInterface dialog, int which) { getResources().getString(R.string.confirm),
result.confirm(); new DialogInterface.OnClickListener() {
} @Override
}); public void onClick(DialogInterface dialog, int which) {
result.confirm();
}
}
);
} }
confirmAlert.setButton(DialogInterface.BUTTON_NEGATIVE, getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() { confirmAlert.setButton(
@Override DialogInterface.BUTTON_NEGATIVE,
public void onClick(DialogInterface dialog, int which) { getResources().getString(R.string.cancel),
result.cancel(); new DialogInterface.OnClickListener() {
} @Override
}); public void onClick(DialogInterface dialog, int which) {
result.cancel();
}
}
);
confirmAlert.setCancelable(false); confirmAlert.setCancelable(false);
showAlertDialog(confirmAlert); showAlertDialog(confirmAlert);
if (message.equals(getString(R.string.msg_confirm_send_host_change)) if (message.equals(getString(R.string.msg_confirm_send_host_change))
|| message.contains(getString(R.string.host_confirm)) || message.contains(getString(R.string.host_confirm))
|| message.equals(getString(R.string.msg_confirm_share_image))) { || message.equals(getString(R.string.msg_confirm_share_image)))
{
Thread thread = new Thread(new Runnable() { Thread thread = new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
...@@ -478,9 +520,11 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -478,9 +520,11 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
private void addDownloadListener() { private void addDownloadListener() {
mChatWebView.setDownloadListener(new DownloadListener() { mChatWebView.setDownloadListener(new DownloadListener() {
@Override @Override
public void onDownloadStart(String url, String userAgent, public void onDownloadStart(
String contentDisposition, String mimetype, String url, String userAgent,
long contentLength) { String contentDisposition, String mimetype,
long contentLength)
{
Uri uri = Uri.parse(url); Uri uri = Uri.parse(url);
DownloadManager.Request request = new DownloadManager.Request(uri); DownloadManager.Request request = new DownloadManager.Request(uri);
...@@ -499,8 +543,11 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -499,8 +543,11 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
if (dm != null) { if (dm != null) {
dm.enqueue(request); dm.enqueue(request);
} }
Toast.makeText(getApplicationContext(), getString(R.string.download_start), //To notify the Client that the file is being downloaded Toast.makeText(
Toast.LENGTH_LONG).show(); getApplicationContext(),
getString(R.string.download_start), //To notify the Client that the file is being downloaded
Toast.LENGTH_LONG
).show();
} }
}); });
} }
...@@ -510,22 +557,25 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -510,22 +557,25 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
receiver = new BroadcastReceiver() { receiver = new BroadcastReceiver() {
@Override @Override
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
ConnectivityManager connectivityManager = (ConnectivityManager) getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE); ConnectivityManager connectivityManager = (ConnectivityManager) getApplicationContext()
.getSystemService(Context.CONNECTIVITY_SERVICE);
if (DownloadManager.ACTION_DOWNLOAD_COMPLETE.equals(intent.getAction())) { if (DownloadManager.ACTION_DOWNLOAD_COMPLETE.equals(intent.getAction())) {
mChatWebView.loadUrl("javascript:Common.dismissLoadingIndicator()"); mChatWebView.dismissLoadingIndicator();
} }
if (intent.getAction().equals(ConnectivityManager.CONNECTIVITY_ACTION)) { if (intent.getAction().equals(ConnectivityManager.CONNECTIVITY_ACTION)) {
NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo(); NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo();
if (networkInfo == null || !networkInfo.isConnectedOrConnecting()) { if (networkInfo == null || !networkInfo.isConnectedOrConnecting()) {
chatData.setIsOnline(false); chatData.setIsOnline(false);
mChatWebView.loadUrl("javascript:Common.refreshForOffline();"); mChatWebView.refreshForOffline();
} else { } else {
chatData.setIsOnline(true); chatData.setIsOnline(true);
mChatWebView.loadUrl("javascript:Common.refreshForOnline();"); mChatWebView.refreshForOnline();
if (mChatWebView.getUrl() != null && mChatWebView.getUrl().equals(ABookCommConstants.CHAT_ROOM_PAGE_URL)) { if (mChatWebView.getUrl() != null
mChatWebView.loadUrl("javascript:window.location.reload();"); && mChatWebView.getUrl().equals(ABookCommConstants.CHAT_ROOM_PAGE_URL))
{
mChatWebView.windowReload();
} }
} }
} }
...@@ -587,12 +637,15 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -587,12 +637,15 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
String fileName = new File(Objects.requireNonNull(uri.getPath())).getName(); String fileName = new File(Objects.requireNonNull(uri.getPath())).getName();
// イメージをダウンロードする(png, jpg, jpeg, mp4, mov) // イメージをダウンロードする(png, jpg, jpeg, mp4, mov)
if (url.toLowerCase().endsWith(".png") || url.toLowerCase().endsWith(".jpg") || url.toLowerCase().endsWith(".jpeg") if (url.toLowerCase().endsWith(".png")
|| url.toLowerCase().endsWith(".mov") || url.toLowerCase().endsWith(".mp4")) { || url.toLowerCase().endsWith(".jpg")
|| url.toLowerCase().endsWith(".jpeg")
|| url.toLowerCase().endsWith(".mov")
|| url.toLowerCase().endsWith(".mp4"))
{
view.loadUrl("javascript:Common.showLoadingIndicator()"); view.loadUrl("javascript:Common.showLoadingIndicator()");
DownloadManager mdDownloadManager = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE); DownloadManager mdDownloadManager = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);
DownloadManager.Request request = new DownloadManager.Request( DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url));
Uri.parse(url));
File destinationFile = new File(Environment.getExternalStorageDirectory(), fileName); File destinationFile = new File(Environment.getExternalStorageDirectory(), fileName);
request.setDescription("Downloading ..."); request.setDescription("Downloading ...");
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED); request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
...@@ -622,140 +675,98 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -622,140 +675,98 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
// 保存するファイルをjpgに固定する // 保存するファイルをjpgに固定する
public String getFileName(String url) { public String getFileName(String url) {
String filenameWithoutExtension = ""; return System.currentTimeMillis() + ".jpg";
filenameWithoutExtension = String.valueOf(System.currentTimeMillis()
+ ".jpg");
return filenameWithoutExtension;
} }
@Override @Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) { protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data); super.onActivityResult(requestCode, resultCode, data);
Uri[] result = null;
Uri dataUri = null; Uri dataUri = null;
if (data != null && resultCode == RESULT_OK) { if (data != null && resultCode == RESULT_OK) {
String dataString = data.getDataString(); String dataString = data.getDataString();
if (dataString != null) { if (dataString != null) {
dataUri = Uri.parse(dataString); dataUri = Uri.parse(dataString);
result = new Uri[]{dataUri};
} }
} }
if (requestCode == ABOOK_CHECK_TASK_IMAGE) { if (requestCode == ABOOK_CHECK_TASK_IMAGE) {
if (mUploadMessage == null) { activityResultReceivedImage(dataUri);
return;
}
// 画像
try {
if (dataUri == null) {
dataUri = imageUri;
}
Uri responseUri = attachmentImageProcessing(dataUri);
if (responseUri != null) {
mUploadMessage.onReceiveValue(new Uri[]{responseUri});
} else {
mUploadMessage.onReceiveValue(null);
}
} catch (Exception e) {
Logger.e(TAG, e);
mUploadMessage.onReceiveValue(null);
ErrorMessage.showErrorMessageToast(getApplicationContext(), ErrorCode.E107);
}
} else if (requestCode == ABOOK_CHECK_TASK_VIDEO) { } else if (requestCode == ABOOK_CHECK_TASK_VIDEO) {
if (mUploadMessage == null) { activityResultReceivedMovie(dataUri);
return;
}
if (dataUri != null) {
mChatWebView.loadChatViewUrl("javascript:Common.showLoadingIndicator();");
Cursor cursor = getContentResolver().query(dataUri, null, null, null, null);
cursor.moveToNext();
final String filePath = cursor.getString(cursor.getColumnIndex("_data"));
cursor.close();
Runnable r = new Runnable() {
@Override
public void run() {
try {
//CallBack
Runnable callBack = new Runnable() {
@Override
public void run() {
runOnUiThread(new Runnable() {
@Override
public void run() {
mChatWebView.loadUrl("javascript:ChatMediaHandler.videoEncodeEnd('" +encodedFilePath + "')");
}
});
}
};
Context c = getApplicationContext();
File file = new File(filePath);
String encodedPath = new VideoEncoder().changeResolution(file, callBack);
encodedFilePath = encodedPath;
} catch (Throwable throwable) {
mChatWebView.loadUrl("javascript:ChatMediaHandler.videoEncodeFail();)");
}
}
};
r.run();
}
mUploadMessage.onReceiveValue(null);
} }
mUploadMessage = null; mUploadMessage = null;
} }
public static Uri getImageContentUri(Context context, File file) { private void activityResultReceivedImage(Uri dataUri) {
if (!file.exists()) { if (mUploadMessage == null) {
return null; return;
} }
String filePath = file.getAbsolutePath(); // 画像
Cursor cursor = context.getContentResolver().query( try {
MediaStore.Images.Media.EXTERNAL_CONTENT_URI, if (dataUri == null) {
new String[] {BaseColumns._ID}, dataUri = imageUri;
MediaStore.MediaColumns.DATA + "=? ", }
new String[] { filePath }, null); Uri responseUri = attachmentImageProcessing(dataUri);
if (responseUri != null) {
if (cursor != null && cursor.moveToFirst()) { mUploadMessage.onReceiveValue(new Uri[]{responseUri});
int id = cursor.getInt(cursor } else {
.getColumnIndex(BaseColumns._ID)); mUploadMessage.onReceiveValue(null);
Uri baseUri = Uri.parse("content://media/external/video/media"); }
return Uri.withAppendedPath(baseUri, "" + id); } catch (Exception e) {
} else { Logger.e(TAG, e);
if (!file.exists()) { return null; } mUploadMessage.onReceiveValue(null);
ContentValues values = new ContentValues(); ErrorMessage.showErrorMessageToast(getApplicationContext(), ErrorCode.E107);
values.put(MediaStore.MediaColumns.DATA, filePath);
return context.getContentResolver().insert(
MediaStore.Video.Media.EXTERNAL_CONTENT_URI,
values);
} }
} }
private void activityResultReceivedMovie(Uri dataUri) {
/** if (mUploadMessage == null) {
* 未読のプッシュメッセージが存在するかチェック return;
* @param pushMessageDtoList チェックするリスト
* @return
*/
private boolean checkUnReadCommunication(List<PushMessageDto> pushMessageDtoList) {
boolean existUnreadFlg = false;
for (PushMessageDto pushMessageDto : pushMessageDtoList) {
if (!pushMessageDto.readingFlg) {
existUnreadFlg = true;
break;
}
} }
return existUnreadFlg; if (dataUri != null) {
mChatWebView.showLoadingIndicator();
Cursor cursor = getContentResolver().query(dataUri, null, null, null, null);
cursor.moveToNext();
final String filePath = cursor.getString(cursor.getColumnIndex("_data"));
cursor.close();
Runnable r = new Runnable() {
@Override
public void run() {
try {
//CallBack
Runnable callBack = new Runnable() {
@Override
public void run() {
runOnUiThread(new Runnable() {
@Override
public void run() {
mChatWebView.finishedVideoEncoding(encodedFilePath);
}
});
}
};
Context c = getApplicationContext();
File file = new File(filePath);
encodedFilePath = new VideoEncoder().changeResolution(file, callBack);
} catch (Throwable throwable) {
mChatWebView.failedVideoEncoding();
}
}
};
r.run();
}
mUploadMessage.onReceiveValue(null);
} }
/** /**
* 作業一覧へ遷移 * 作業一覧へ遷移
*/ */
public void backToHome() { public void backToHome() {
mChatWebView.loadUrl("javascript:ReverseDelegate.leaveRoom()"); mChatWebView.leaveRoom();
exitAndDeleteMeetingRoom(); exitAndDeleteMeetingRoom();
finish(); finish();
Intent intent = new Intent(); Intent intent = new Intent();
...@@ -772,10 +783,11 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -772,10 +783,11 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
} }
public void finishPIPmode() { public void finishPIPmode() {
if (isPIP) { if (!isPIP) { return; }
getApplication().startActivity(new Intent(this, ChatWebViewActivity.class) getApplication()
.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_NEW_TASK)); .startActivity(new Intent(this, ChatWebViewActivity.class)
} .addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_NEW_TASK)
);
} }
public void startPIPmode() { public void startPIPmode() {
...@@ -822,15 +834,16 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -822,15 +834,16 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
public void moveCollaborationScreen(Integer collaborationType) { public void moveCollaborationScreen(Integer collaborationType) {
if (collaborationType.equals(ABookCommConstants.FLAG.COLLABORATION_TYPE.DOCUMENT) && !isValidVersion()) { if (collaborationType.equals(ABookCommConstants.FLAG.COLLABORATION_TYPE.DOCUMENT) && !isValidVersion()) {
mChatWebView.loadUrl("javascript:alert(getLocalizedString('not_support_version'));"); mChatWebView.showAlert("getLocalizedString('not_support_version')");
return; return;
} }
chatData.setJoinCollaborationType(collaborationType.intValue()); chatData.setJoinCollaborationType(collaborationType);
mChatWebView.loadChatViewUrl(ABookCommConstants.COLLABORATION_PAGE_URL); mChatWebView.loadChatViewUrl(ABookCommConstants.COLLABORATION_PAGE_URL);
} }
public boolean deleteFavoriteGroup(String groupId) throws NetworkDisconnectedException, AcmsException { public boolean deleteFavoriteGroup(String groupId) throws NetworkDisconnectedException, AcmsException {
boolean result = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter) boolean result = AcmsClient
.getInstance(ABVEnvironment.getInstance().networkAdapter)
.deleteFavoriteGroup(chatData.sid, Integer.parseInt(groupId)); .deleteFavoriteGroup(chatData.sid, Integer.parseInt(groupId));
if (!result) { return false; } if (!result) { return false; }
...@@ -841,29 +854,24 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -841,29 +854,24 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
return true; return true;
} }
private void updateFavoriteUser() throws NetworkDisconnectedException, AcmsException {
GetFavoriteUserJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).getFavoriteUser(chatData.sid);
communicationLogic.updateFavoriteUser(resultJson.favoriteUserIds);
}
@Override @Override
public void onPictureInPictureModeChanged (boolean isInPictureInPictureMode, Configuration newConfig) { public void onPictureInPictureModeChanged (boolean isInPictureInPictureMode, Configuration newConfig) {
isPIP = isInPictureInPictureMode; isPIP = isInPictureInPictureMode;
if (isInPictureInPictureMode) { if (isInPictureInPictureMode) {
mChatWebView.loadUrl("javascript:$('.pip_indicator').removeClass('none');"); mChatWebView.removePIPIndicator();
} else { return;
if (isStop) { }
mChatWebView.loadUrl("javascript:CoviewBridge.exitCollaboration();"); if (isStop) {
Intent intent = new Intent(); mChatWebView.exitCollaboration();
Activity currentActivity = ActivityHandlingHelper.getInstance().getCurrentActivity(); Intent intent = new Intent();
intent.setClass(currentActivity, OperationListActivity.class); Activity currentActivity = ActivityHandlingHelper.getInstance().getCurrentActivity();
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); intent.setClass(currentActivity, OperationListActivity.class);
startActivity(intent, NaviConsts.Left); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
} startActivity(intent, NaviConsts.Left);
mChatWebView.loadUrl("javascript:$('.pip_indicator').addClass('none');"); }
if (!meetingManager.isConnected()) { mChatWebView.addPIPIndicator();
mChatWebView.loadUrl("javascript:$('.start_pip_btn').addClass('none');"); if (!meetingManager.isConnected()) {
} mChatWebView.addPIPButton();
} }
} }
...@@ -909,10 +917,8 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -909,10 +917,8 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
f.createNewFile(); f.createNewFile();
Bitmap bitmap = resultBitmap;
ByteArrayOutputStream bos = new ByteArrayOutputStream(); ByteArrayOutputStream bos = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 0, bos); resultBitmap.compress(Bitmap.CompressFormat.PNG, 0, bos);
byte[] bitmapData = bos.toByteArray(); byte[] bitmapData = bos.toByteArray();
FileOutputStream fos = new FileOutputStream(f); FileOutputStream fos = new FileOutputStream(f);
...@@ -930,7 +936,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -930,7 +936,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
isStop = false; isStop = false;
super.onResume(); super.onResume();
if (mChatWebView.getUrl() != null && mChatWebView.getUrl().equals(ABookCommConstants.CHAT_ROOM_PAGE_URL)) { if (mChatWebView.getUrl() != null && mChatWebView.getUrl().equals(ABookCommConstants.CHAT_ROOM_PAGE_URL)) {
mChatWebView.loadUrl("javascript:CHAT_SOCKET.socketCheck();"); mChatWebView.socketCheck();
} }
} }
...@@ -953,20 +959,15 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -953,20 +959,15 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
@Override @Override
public boolean onKeyUp(int keyCode, KeyEvent event) { public boolean onKeyUp(int keyCode, KeyEvent event) {
boolean eventPrevent = false; boolean eventPrevent = false;
switch (keyCode) { if (keyCode == KeyEvent.KEYCODE_BACK) {
case KeyEvent.KEYCODE_BACK: backToHome();
backToHome(); eventPrevent = true;
eventPrevent = true;
break;
} }
return eventPrevent; return eventPrevent;
} }
public boolean isValidVersion() { public boolean isValidVersion() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { return Build.VERSION.SDK_INT >= Build.VERSION_CODES.O;
return false;
}
return true;
} }
public void sendPromoteRequest() { public void sendPromoteRequest() {
...@@ -974,7 +975,13 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -974,7 +975,13 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put(MeetingManager.ID, meetingManager.getSkey()); json.put(MeetingManager.ID, meetingManager.getSkey());
json.put(MeetingManager.LOGIN_ID, ABVDataCache.getInstance().getMemberInfo().loginId); json.put(MeetingManager.LOGIN_ID, ABVDataCache.getInstance().getMemberInfo().loginId);
meetingManager.sendWs(MeetingManager.CMD_PRESENTERREQUEST, contentViewActivity != null ? contentViewActivity.getContentId() : 0, null, null, json); meetingManager.sendWs(
MeetingManager.CMD_PRESENTERREQUEST,
contentViewActivity != null ? contentViewActivity.getContentId() : 0,
null,
null,
json
);
} }
public void setSelectedUserIdList(String userList) { public void setSelectedUserIdList(String userList) {
...@@ -995,12 +1002,21 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -995,12 +1002,21 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
chatData.updateGroupInfoFromServer(); chatData.updateGroupInfoFromServer();
} }
public void createChatRoom(String roomType, String userIdList, String encodedRoomName, String screenFlg, boolean isVoice) throws NetworkDisconnectedException, AcmsException { public void createChatRoom(
CreatedRoomJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).createRoom(chatData.sid, roomType, userIdList, encodedRoomName, chatData.loginId); String roomType,
String userIdList,
String encodedRoomName,
String screenFlg,
boolean isVoice)
throws NetworkDisconnectedException, AcmsException
{
CreatedRoomJSON resultJson = AcmsClient
.getInstance(ABVEnvironment.getInstance().networkAdapter)
.createRoom(chatData.sid, roomType, userIdList, encodedRoomName, chatData.loginId);
if (ABookCommConstants.FLAG.SCREEN_FLG.MAKE_ROOM.equals(Integer.parseInt(screenFlg))) { if (ABookCommConstants.FLAG.SCREEN_FLG.MAKE_ROOM.equals(Integer.parseInt(screenFlg))) {
final ChatRoomDto chatRoomDto = communicationLogic.getChatRoom(resultJson.chatRoomDto.chatRoomId); final ChatRoomDto chatRoomDto = communicationLogic.getChatRoom(resultJson.chatRoomDto.chatRoomId);
if (chatRoomDto != null) { if (chatRoomDto != null) {
mChatWebView.loadChatViewUrl(String.format("javascript:ReverseDelegate.displayExistRoom('%s');", chatRoomDto.chatRoomId.toString())); mChatWebView.displayExistRoom(chatRoomDto.chatRoomId);
return; return;
} }
} }
...@@ -1011,7 +1027,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -1011,7 +1027,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
if (isVoice) { if (isVoice) {
chatData.roomId = chatRoomId.longValue(); chatData.roomId = chatRoomId.longValue();
chatData.roomName = chatRoomName; chatData.roomName = chatRoomName;
mChatWebView.loadChatViewUrl(String.format("javascript:Common.startCollaboration('%s');", ABookCommConstants.FLAG.COLLABORATION_TYPE.AUDIO)); mChatWebView.startAudioCollaboration();
} else { } else {
joinRoom(chatRoomId.toString(), chatRoomName); joinRoom(chatRoomId.toString(), chatRoomName);
} }
...@@ -1034,12 +1050,14 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -1034,12 +1050,14 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
} }
public void inviteUsers(String userIds) throws NetworkDisconnectedException, AcmsException { public void inviteUsers(String userIds) throws NetworkDisconnectedException, AcmsException {
final UserInviteResultJSON result = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).inviteUsers(chatData.sid, chatData.roomId.intValue(), chatData.roomName, userIds); final UserInviteResultJSON result = AcmsClient
.getInstance(ABVEnvironment.getInstance().networkAdapter)
.inviteUsers(chatData.sid, chatData.roomId.intValue(), chatData.roomName, userIds);
if (result.roomId == null) { if (result.roomId == null) {
communicationLogic.addUserInRoom(userIds, chatData.roomId.intValue()); communicationLogic.addUserInRoom(userIds, chatData.roomId.intValue());
mChatWebView.loadChatViewUrl(ABookCommConstants.CHAT_ROOM_PAGE_URL); mChatWebView.loadChatViewUrl(ABookCommConstants.CHAT_ROOM_PAGE_URL);
} else { } else {
mChatWebView.loadChatViewUrl(String.format("javascript:ReverseDelegate.displayExistRoom('%s');", result.roomId.toString())); mChatWebView.displayExistRoom(result.roomId);
} }
} }
...@@ -1058,7 +1076,9 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -1058,7 +1076,9 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
public void updateMessages(String roomId) throws NetworkDisconnectedException, AcmsException { public void updateMessages(String roomId) throws NetworkDisconnectedException, AcmsException {
SharedPreferences pref = getSharedPreferences(ABookCommConstants.TAG, MODE_PRIVATE); SharedPreferences pref = getSharedPreferences(ABookCommConstants.TAG, MODE_PRIVATE);
String lastUpdatedDate = pref.getString(ABookCommConstants.KEY.MESSAGE_UPDATED_DATE + roomId, DEFAULT_CHECKSUM); String lastUpdatedDate = pref.getString(ABookCommConstants.KEY.MESSAGE_UPDATED_DATE + roomId, DEFAULT_CHECKSUM);
MessageInfoListJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).getMessages(chatData.sid, roomId, null, lastUpdatedDate); MessageInfoListJSON resultJson = AcmsClient
.getInstance(ABVEnvironment.getInstance().networkAdapter)
.getMessages(chatData.sid, roomId, null, lastUpdatedDate);
for (ChatMessageDto chatMessageDto : resultJson.chatMessageDtoArrayList) { for (ChatMessageDto chatMessageDto : resultJson.chatMessageDtoArrayList) {
chatMessageDto.chatRoomId = Integer.parseInt(roomId); chatMessageDto.chatRoomId = Integer.parseInt(roomId);
} }
...@@ -1101,19 +1121,19 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -1101,19 +1121,19 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
public boolean addFavoriteUser(String shopMemberId) throws AcmsException { public boolean addFavoriteUser(String shopMemberId) throws AcmsException {
Integer favoriteCount = communicationLogic.getFavoriteCount(); Integer favoriteCount = communicationLogic.getFavoriteCount();
if (favoriteCount >= ABookCommConstants.SIZE.MAX_FAVORITE_COUNT ) { if (favoriteCount >= ABookCommConstants.SIZE.MAX_FAVORITE_COUNT ) {
mChatWebView.loadChatViewUrl("javascript:alert('" + getString(R.string.msg_error_favorites_100_over) + "');"); mChatWebView.showAlert(getString(R.string.msg_error_favorites_100_over));
return false; return false;
} else {
boolean result = false;
try {
result = chatData.insertFavoriteUser(shopMemberId);
if (!result) { return false; }
mChatWebView.loadChatViewUrl("javascript:Common.refreshContactScreen();");
return true;
} catch (NetworkDisconnectedException e) {
mChatWebView.loadChatViewUrl("javascript:alert('" + getString(R.string.msg_eroor_network_offline) + "');");
}
} }
try {
boolean result = chatData.insertFavoriteUser(shopMemberId);
if (!result) { return false; }
mChatWebView.refreshContactScreen();
return true;
} catch (NetworkDisconnectedException e) {
mChatWebView.showAlert(getString(R.string.msg_eroor_network_offline));
}
return false; return false;
} }
...@@ -1123,10 +1143,10 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -1123,10 +1143,10 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
if (!result) { if (!result) {
return false; return false;
} }
mChatWebView.loadChatViewUrl("javascript:Common.refreshContactScreen();"); mChatWebView.refreshContactScreen();
return true; return true;
} catch (NetworkDisconnectedException e) { } catch (NetworkDisconnectedException e) {
mChatWebView.loadChatViewUrl("javascript:alert('" + getString(R.string.msg_eroor_network_offline) + "');"); mChatWebView.showAlert(getString(R.string.msg_eroor_network_offline));
} }
return false; return false;
} }
...@@ -1134,35 +1154,34 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -1134,35 +1154,34 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
public boolean addFavoriteGroup(String groupId) throws AcmsException { public boolean addFavoriteGroup(String groupId) throws AcmsException {
Integer favoriteCount = communicationLogic.getFavoriteCount(); Integer favoriteCount = communicationLogic.getFavoriteCount();
if (favoriteCount >= ABookCommConstants.SIZE.MAX_FAVORITE_COUNT) { if (favoriteCount >= ABookCommConstants.SIZE.MAX_FAVORITE_COUNT) {
mChatWebView.loadChatViewUrl("javascript:alert('" + getString(R.string.msg_error_favorites_100_over) + "');"); mChatWebView.showAlert(getString(R.string.msg_error_favorites_100_over));
return false; return false;
} else { }
boolean result = false;
try { try {
result = chatData.insertFavoriteGroup(groupId); boolean result = chatData.insertFavoriteGroup(groupId);
if (!result) { if (!result) {
return false; return false;
}
mChatWebView.loadChatViewUrl("javascript:Common.refreshContactScreen();");
return true;
} catch (NetworkDisconnectedException e) {
mChatWebView.loadChatViewUrl("javascript:alert('" + getString(R.string.msg_eroor_network_offline) + "');");
} }
mChatWebView.refreshContactScreen();
return true;
} catch (NetworkDisconnectedException e) {
mChatWebView.showAlert(getString(R.string.msg_eroor_network_offline));
} }
return false; return false;
} }
public boolean removeFavoriteGroup(String groupId) throws AcmsException { public boolean removeFavoriteGroup(String groupId) throws AcmsException {
boolean result = false;
try { try {
result = deleteFavoriteGroup(groupId); boolean result = deleteFavoriteGroup(groupId);
if (!result) { if (!result) {
return false; return false;
} }
mChatWebView.loadChatViewUrl("javascript:Common.refreshContactScreen();"); mChatWebView.refreshContactScreen();
return true; return true;
} catch (NetworkDisconnectedException e) { } catch (NetworkDisconnectedException e) {
mChatWebView.loadChatViewUrl("javascript:alert('" + getString(R.string.msg_eroor_network_offline) + "');"); mChatWebView.showAlert(getString(R.string.msg_eroor_network_offline));
} }
return false; return false;
} }
...@@ -1189,30 +1208,29 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -1189,30 +1208,29 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
meetingManager.join(meetingId, mSkey, chatData.roomId.toString(), true); meetingManager.join(meetingId, mSkey, chatData.roomId.toString(), true);
meetingManager.setCollaboration(true); meetingManager.setCollaboration(true);
} catch (Exception e) { } catch (Exception e) {
mChatWebView.loadUrl("javascript:alert('" + getString(R.string.msg_error_connection_error_meeting_room) + "');"); mChatWebView.showAlert(getString(R.string.msg_error_connection_error_meeting_room));
} }
startContentListActivity(true); startContentListActivity(true);
return meetingId.intValue(); return meetingId;
} }
public void startContentView() throws InterruptedException { public void startContentView() {
finishBeforeContentListActivity(); finishBeforeContentListActivity();
PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder(); PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder();
enterPictureInPictureMode(mPipBuilder.build()); enterPictureInPictureMode(mPipBuilder.build());
meetingManager.close(); meetingManager.close();
try { try {
connectMeetingServer(); connectMeetingServer();
List<MeetingDto> meetingList= meetingManager.getMeetingList(mSkey); List<MeetingDto> meetingList = meetingManager.getMeetingList(mSkey);
meetingManager.join(chatData.joinMeetingId, mSkey, chatData.roomId.toString(), false); meetingManager.join(chatData.joinMeetingId, mSkey, chatData.roomId.toString(), false);
meetingManager.setCollaboration(true); meetingManager.setCollaboration(true);
} catch (Exception e) { } catch (Exception e) {
mChatWebView.loadUrl("javascript:alert('" + getString(R.string.msg_error_connection_error_meeting_room) + "');"); mChatWebView.showAlert(getString(R.string.msg_error_connection_error_meeting_room));
} }
startContentListActivity(false); startContentListActivity(false);
} }
public void joinMeetingRoom(int newMeetingId) throws InterruptedException { public void joinMeetingRoom(int newMeetingId) {
finishBeforeContentListActivity(); finishBeforeContentListActivity();
PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder(); PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder();
enterPictureInPictureMode(mPipBuilder.build()); enterPictureInPictureMode(mPipBuilder.build());
...@@ -1223,7 +1241,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -1223,7 +1241,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
meetingManager.join(chatData.joinMeetingId, mSkey, chatData.roomId.toString(), false); meetingManager.join(chatData.joinMeetingId, mSkey, chatData.roomId.toString(), false);
meetingManager.setCollaboration(true); meetingManager.setCollaboration(true);
} catch (Exception e) { } catch (Exception e) {
mChatWebView.loadUrl("javascript:alert('" + getString(R.string.msg_error_connection_error_meeting_room) + "');"); mChatWebView.showAlert(getString(R.string.msg_error_connection_error_meeting_room));
} }
startContentListActivity(false); startContentListActivity(false);
} }
......
package jp.agentec.abook.abv.ui.home.view; package jp.agentec.abook.abv.ui.home.view;
import android.annotation.SuppressLint;
import android.content.Context; import android.content.Context;
import android.os.Build; import android.os.Build;
import android.view.View; import android.view.View;
...@@ -20,7 +21,7 @@ import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper; ...@@ -20,7 +21,7 @@ import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
public class ChatWebView extends WebView { public class ChatWebView extends WebView {
private ChatWebViewActivity chatActivity; private final ChatWebViewActivity chatActivity;
private ChatData chatData; private ChatData chatData;
public ChatWebView(Context context) { public ChatWebView(Context context) {
...@@ -28,7 +29,8 @@ public class ChatWebView extends WebView { ...@@ -28,7 +29,8 @@ public class ChatWebView extends WebView {
chatActivity = (ChatWebViewActivity)context; chatActivity = (ChatWebViewActivity)context;
} }
public void init(ChatData chatData) { @SuppressLint("SetJavaScriptEnabled")
public void configue(ChatData chatData) {
setOverScrollMode(View.OVER_SCROLL_NEVER); //オーバースクロールしない。 setOverScrollMode(View.OVER_SCROLL_NEVER); //オーバースクロールしない。
setVerticalScrollBarEnabled(false); //スクロールバーを消す。 setVerticalScrollBarEnabled(false); //スクロールバーを消す。
addJavascriptInterface(this, "android"); addJavascriptInterface(this, "android");
...@@ -121,7 +123,9 @@ public class ChatWebView extends WebView { ...@@ -121,7 +123,9 @@ public class ChatWebView extends WebView {
@JavascriptInterface @JavascriptInterface
public void test() { public void test() {
OperationRelatedContentActivity testact = ActivityHandlingHelper.getInstance().getActivity(OperationRelatedContentActivity.class); OperationRelatedContentActivity testact = ActivityHandlingHelper
.getInstance()
.getActivity(OperationRelatedContentActivity.class);
testact.finish(); testact.finish();
} }
...@@ -141,7 +145,14 @@ public class ChatWebView extends WebView { ...@@ -141,7 +145,14 @@ public class ChatWebView extends WebView {
} }
@JavascriptInterface @JavascriptInterface
public void createChatRoom(String roomType, String userIdList, String encodedRoomName, String screenFlg, boolean isVoice) throws NetworkDisconnectedException, AcmsException { public void createChatRoom(
String roomType,
String userIdList,
String encodedRoomName,
String screenFlg,
boolean isVoice)
throws NetworkDisconnectedException, AcmsException
{
chatActivity.createChatRoom(roomType, userIdList, encodedRoomName, screenFlg, isVoice); chatActivity.createChatRoom(roomType, userIdList, encodedRoomName, screenFlg, isVoice);
} }
...@@ -341,17 +352,23 @@ public class ChatWebView extends WebView { ...@@ -341,17 +352,23 @@ public class ChatWebView extends WebView {
} }
@JavascriptInterface @JavascriptInterface
public void joinCollaboration(String collaborationType, String meetingId) throws NetworkDisconnectedException, AcmsException { public void joinCollaboration(String collaborationType, String meetingId)
throws NetworkDisconnectedException, AcmsException
{
chatActivity.joinCollaboration(collaborationType, meetingId); chatActivity.joinCollaboration(collaborationType, meetingId);
} }
@JavascriptInterface @JavascriptInterface
public void joinChangedCollaboration(String collaborationType, String meetingId) throws NetworkDisconnectedException, AcmsException { public void joinChangedCollaboration(String collaborationType, String meetingId)
throws NetworkDisconnectedException, AcmsException
{
chatData.joinChangedCollaboration(collaborationType, meetingId); chatData.joinChangedCollaboration(collaborationType, meetingId);
} }
@JavascriptInterface @JavascriptInterface
public void inviteCollaboration(String inviteUserIds, String collaborationType) throws NetworkDisconnectedException, AcmsException { public void inviteCollaboration(String inviteUserIds, String collaborationType)
throws NetworkDisconnectedException, AcmsException
{
chatData.inviteCollaboration(inviteUserIds, collaborationType); chatData.inviteCollaboration(inviteUserIds, collaborationType);
} }
...@@ -400,7 +417,6 @@ public class ChatWebView extends WebView { ...@@ -400,7 +417,6 @@ public class ChatWebView extends WebView {
return chatData.getUserListByLoginId(loginIdList); return chatData.getUserListByLoginId(loginIdList);
} }
@JavascriptInterface @JavascriptInterface
public int createContentView() { public int createContentView() {
return chatActivity.createContentView(); return chatActivity.createContentView();
...@@ -442,7 +458,9 @@ public class ChatWebView extends WebView { ...@@ -442,7 +458,9 @@ public class ChatWebView extends WebView {
} }
@JavascriptInterface @JavascriptInterface
public void changeCollaboration(int changeCollaborationType, int meetingId) throws NetworkDisconnectedException, AcmsException { public void changeCollaboration(int changeCollaborationType, int meetingId)
throws NetworkDisconnectedException, AcmsException
{
chatData.changeCollaboration(changeCollaborationType, meetingId); chatData.changeCollaboration(changeCollaborationType, meetingId);
} }
...@@ -485,7 +503,9 @@ public class ChatWebView extends WebView { ...@@ -485,7 +503,9 @@ public class ChatWebView extends WebView {
} }
@JavascriptInterface @JavascriptInterface
public void updatePreMessage(String messageId) throws NetworkDisconnectedException, AcmsException { public void updatePreMessage(String messageId)
throws NetworkDisconnectedException, AcmsException
{
chatData.updatePreMessage(messageId); chatData.updatePreMessage(messageId);
} }
...@@ -522,4 +542,98 @@ public class ChatWebView extends WebView { ...@@ -522,4 +542,98 @@ public class ChatWebView extends WebView {
} }
}); });
} }
public void showAlert(String message) {
loadChatViewUrl("javascript:alert('" + message + "');");
}
public void extendHeartBeat() {
loadUrl("javascript:coview_api.HeartBeatUser(globalUserInfo.loginId);");
}
public void extendHeartBeatIfNeeded() {
if (getUrl() != null && getUrl().equals(ABookCommConstants.COLLABORATION_PAGE_URL)) {
extendHeartBeat();
}
}
public void hideNameCardInCollaboaration() {
loadUrl("javascript:$('#userNameCardInCollaboration').modal('hide');");
}
public void hideHostRequestModal() {
loadUrl("javascript:$('#hostRequestModal').modal('hide');");
}
public void leaveRoom() {
loadUrl("javascript:ReverseDelegate.leaveRoom()");
}
public void recordFinished() {
loadUrl("javascript:recordFinished()");
}
public void penOff() {
loadUrl("javascript:penOff();");
}
public void showLoadingIndicator() {
loadChatViewUrl("javascript:Common.showLoadingIndicator();");
}
public void dismissLoadingIndicator() {
loadUrl("javascript:Common.dismissLoadingIndicator()");
}
public void refreshForOffline() {
loadUrl("javascript:Common.refreshForOffline();");
}
public void refreshForOnline() {
loadUrl("javascript:Common.refreshForOnline();");
}
public void windowReload() {
loadUrl("javascript:window.location.reload();");
}
public void finishedVideoEncoding(String encodedFilePath) {
loadUrl("javascript:ChatMediaHandler.videoEncodeEnd('" +encodedFilePath + "')");
}
public void failedVideoEncoding() {
loadUrl("javascript:ChatMediaHandler.videoEncodeFail();)");
}
public void removePIPIndicator() {
loadUrl("javascript:$('.pip_indicator').removeClass('none');");
}
public void exitCollaboration() {
loadUrl("javascript:CoviewBridge.exitCollaboration();");
}
public void addPIPIndicator() {
loadUrl("javascript:$('.pip_indicator').addClass('none');");
}
public void addPIPButton() {
loadUrl("javascript:$('.start_pip_btn').addClass('none');");
}
public void socketCheck() {
loadUrl("javascript:CHAT_SOCKET.socketCheck();");
}
public void displayExistRoom(Integer chatRoomId) {
loadChatViewUrl(String.format("javascript:ReverseDelegate.displayExistRoom('%s');", chatRoomId.toString()));
}
public void startAudioCollaboration() {
loadChatViewUrl(String.format("javascript:Common.startCollaboration('%s');", ABookCommConstants.FLAG.COLLABORATION_TYPE.AUDIO ));
}
public void refreshContactScreen() {
loadChatViewUrl("javascript:Common.refreshContactScreen();");
}
} }
package jp.agentec.abook.abv.ui.viewer.activity; package jp.agentec.abook.abv.ui.viewer.activity;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.database.Cursor; import android.database.Cursor;
import android.net.Uri; import android.net.Uri;
import android.provider.MediaStore; import android.provider.MediaStore;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Button; import android.widget.Button;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.LinearLayout; import android.widget.LinearLayout;
...@@ -16,45 +10,11 @@ import android.widget.ProgressBar; ...@@ -16,45 +10,11 @@ import android.widget.ProgressBar;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON;
import jp.agentec.abook.abv.bl.acms.type.OperationType;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.Callback;
import jp.agentec.abook.abv.bl.common.CommonExecutor;
import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.exception.ABVExceptionCode;
import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.common.log.Logger; import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
import jp.agentec.abook.abv.bl.data.dao.ContentDao;
import jp.agentec.abook.abv.bl.dto.ContentDto; import jp.agentec.abook.abv.bl.dto.ContentDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.ContentObjectLogLogic;
import jp.agentec.abook.abv.bl.logic.OperationLogic;
import jp.agentec.abook.abv.cl.util.ContentLogUtil;
import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.activity.ABVAuthenticatedActivity; import jp.agentec.abook.abv.ui.common.activity.ABVAuthenticatedActivity;
import jp.agentec.abook.abv.ui.common.activity.ABVContentViewActivity;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.common.constant.ErrorCode;
import jp.agentec.abook.abv.ui.common.constant.ErrorMessage;
import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog;
import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
import jp.agentec.abook.abv.ui.common.util.PatternStringUtil;
import jp.agentec.abook.abv.ui.home.activity.ABookSettingActivity;
import jp.agentec.abook.abv.ui.home.helper.ABookCheckWebViewHelper; import jp.agentec.abook.abv.ui.home.helper.ABookCheckWebViewHelper;
import jp.agentec.abook.abv.ui.home.helper.ABookPermissionHelper;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.home.helper.ContentViewHelper;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.FileUtil;
public class CommunicationWebViewActivity extends ABVAuthenticatedActivity { public class CommunicationWebViewActivity extends ABVAuthenticatedActivity {
private static final String TAG = "CommunicationWebViewActivity"; private static final String TAG = "CommunicationWebViewActivity";
......
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