Commit 02afc046 by onuma

文字列を外部リソースに移動、SQL修正他

parent 3ed63fe8
...@@ -70,7 +70,7 @@ public class ChatGroupDao extends AbstractCommunicationDao { ...@@ -70,7 +70,7 @@ public class ChatGroupDao extends AbstractCommunicationDao {
sql.append(" FROM m_chat_group mygroup "); sql.append(" FROM m_chat_group mygroup ");
sql.append(" LEFT JOIN m_chat_group parentgroup on mygroup.parent_group_id = parentgroup.group_id "); sql.append(" LEFT JOIN m_chat_group parentgroup on mygroup.parent_group_id = parentgroup.group_id ");
sql.append(" LEFT JOIN m_chat_group grandparentgroup on parentgroup.parent_group_id = grandparentgroup.group_id "); sql.append(" LEFT JOIN m_chat_group grandparentgroup on parentgroup.parent_group_id = grandparentgroup.group_id ");
sql.append(" WHERE mygroup.group_id IN (select group_id from m_shop_member sm inner join r_shop_member_group rmg on sm.shop_member_id = rmg.shop_member_id where sm.self_flg = 1)"); sql.append(" WHERE mygroup.group_id IN (select group_id from m_shop_member sm INNER JOIN r_shop_member_group rmg on sm.shop_member_id = rmg.shop_member_id WHERE sm.self_flg = 1)");
return rawQueryGetStringList(sql.toString(), null); return rawQueryGetStringList(sql.toString(), null);
} }
...@@ -83,7 +83,7 @@ public class ChatGroupDao extends AbstractCommunicationDao { ...@@ -83,7 +83,7 @@ public class ChatGroupDao extends AbstractCommunicationDao {
sql.append(" END AS group_path, usergroup.group_id "); sql.append(" END AS group_path, usergroup.group_id ");
sql.append(" FROM m_chat_group usergroup "); sql.append(" FROM m_chat_group usergroup ");
sql.append(" LEFT JOIN m_chat_group parentgroup on usergroup.parent_group_id = parentgroup.group_id "); sql.append(" LEFT JOIN m_chat_group parentgroup on usergroup.parent_group_id = parentgroup.group_id ");
sql.append(" LEFT JOIN m_chat_group grandparentgroup on parentgroup.parent_group_id = grandparentgroup.group_id "); sql.append(" LEFT JOIN m_chat_group grandparentgroup ON parentgroup.parent_group_id = grandparentgroup.group_id ");
sql.append(" WHERE usergroup.group_id IN "); sql.append(" WHERE usergroup.group_id IN ");
sql.append(" (SELECT group_id "); sql.append(" (SELECT group_id ");
sql.append(" FROM m_shop_member sm INNER JOIN r_shop_member_group rsmg on sm.shop_member_id = rsmg.shop_member_id "); sql.append(" FROM m_shop_member sm INNER JOIN r_shop_member_group rsmg on sm.shop_member_id = rsmg.shop_member_id ");
...@@ -156,11 +156,11 @@ public class ChatGroupDao extends AbstractCommunicationDao { ...@@ -156,11 +156,11 @@ public class ChatGroupDao extends AbstractCommunicationDao {
} }
public ChatGroupDto getGroup(int groupId) { public ChatGroupDto getGroup(int groupId) {
return rawQueryGetDto("select * from m_chat_group where group_id = " + groupId, null, ChatGroupDto.class); return rawQueryGetDto("SELECT * from m_chat_group WHERE group_id = " + groupId, null, ChatGroupDto.class);
} }
public List<ChatGroupDto> getFavoriteGroup() { public List<ChatGroupDto> getFavoriteGroup() {
return rawQueryGetDtoList("select * from m_chat_group where favorite_register_date IS NOT NULL ORDER BY favorite_register_date ", null, ChatGroupDto.class); return rawQueryGetDtoList("SELECT * from m_chat_group WHERE favorite_register_date IS NOT NULL ORDER BY favorite_register_date ", null, ChatGroupDto.class);
} }
public List<ChatGroupDto> getGroupByName(String[] keywords) { public List<ChatGroupDto> getGroupByName(String[] keywords) {
...@@ -187,10 +187,10 @@ public class ChatGroupDao extends AbstractCommunicationDao { ...@@ -187,10 +187,10 @@ public class ChatGroupDao extends AbstractCommunicationDao {
StringBuffer sql = new StringBuffer(); StringBuffer sql = new StringBuffer();
sql.append(" WITH group_loop AS "); sql.append(" WITH group_loop AS ");
sql.append(" ( "); sql.append(" ( ");
sql.append(" SELECT 1 rownum, group_id, group_name, parent_group_id from m_chat_group where group_id = ? "); sql.append(" SELECT 1 rownum, group_id, group_name, parent_group_id FROM m_chat_group WHERE group_id = ? ");
sql.append(" UNION ALL "); sql.append(" UNION ALL ");
sql.append(" SELECT rownum+1 rownum, parent.group_id, parent.group_name, parent.parent_group_id "); sql.append(" SELECT rownum+1 rownum, parent.group_id, parent.group_name, parent.parent_group_id ");
sql.append(" FROM group_loop inner join m_chat_group parent on parent.group_id = group_loop.parent_group_id "); sql.append(" FROM group_loop inner JOIN m_chat_group parent on parent.group_id = group_loop.parent_group_id ");
sql.append(" ) "); sql.append(" ) ");
sql.append(" SELECT * FROM group_loop ORDER BY group_loop.rownum DESC "); sql.append(" SELECT * FROM group_loop ORDER BY group_loop.rownum DESC ");
...@@ -200,24 +200,24 @@ public class ChatGroupDao extends AbstractCommunicationDao { ...@@ -200,24 +200,24 @@ public class ChatGroupDao extends AbstractCommunicationDao {
public List<ChatGroupDto> getGroupChildList(int parentId) { public List<ChatGroupDto> getGroupChildList(int parentId) {
List<ChatGroupDto> list; List<ChatGroupDto> list;
list = rawQueryGetDtoList("select * from m_chat_group mg where (mg.parent_group_id = ?) ORDER BY group_name", new String[]{""+ parentId}, ChatGroupDto.class); list = rawQueryGetDtoList("SELECT * FROM m_chat_group mg WHERE (mg.parent_group_id = ?) ORDER BY group_name", new String[]{""+ parentId}, ChatGroupDto.class);
return list; return list;
} }
public ChatGroupDto getRootGroup() { public ChatGroupDto getRootGroup() {
return rawQueryGetDto("select * from m_chat_group mg where (mg.parent_group_id = 0)",null, ChatGroupDto.class); return rawQueryGetDto("SELECT * FROM m_chat_group mg WHERE (mg.parent_group_id = 0)",null, ChatGroupDto.class);
} }
public ChatGroupDto getParentGroup(Integer childGroupId) { public ChatGroupDto getParentGroup(Integer childGroupId) {
return rawQueryGetDto("select parent.* from m_chat_group parent inner join m_chat_group child on child.parent_group_id = parent.group_id where child.group_id = ?", new String[]{""+ childGroupId}, ChatGroupDto.class); return rawQueryGetDto("SELECT parent.* from m_chat_group parent INNER JOIN m_chat_group child on child.parent_group_id = parent.group_id WHERE child.group_id = ?", new String[]{""+ childGroupId}, ChatGroupDto.class);
} }
public boolean isExistParent(int baseId) { public boolean isExistParent(int baseId) {
return rawQueryGetInt("select * from m_chat_group where parent_group_id = " + baseId, null) > 0; return rawQueryGetInt("SELECT * FROM m_chat_group WHERE parent_group_id = " + baseId, null) > 0;
} }
public List<ChatGroupDto> getMyGroups() { public List<ChatGroupDto> getMyGroups() {
return rawQueryGetDtoList("select * from m_chat_group where group_id IN (select group_id from m_shop_member sm inner join r_shop_member_group rmg on sm.shop_member_id = rmg.shop_member_id where sm.self_flg = 1) ORDER BY group_name ASC", null, ChatGroupDto.class); return rawQueryGetDtoList("SELECT * FROM m_chat_group WHERE group_id IN (SELECT group_id from m_shop_member sm INNER JOIN r_shop_member_group rmg on sm.shop_member_id = rmg.shop_member_id WHERE sm.self_flg = 1) ORDER BY group_name ASC", null, ChatGroupDto.class);
} }
public void insertGroupList(List<ChatGroupDto> groupList) { public void insertGroupList(List<ChatGroupDto> groupList) {
...@@ -277,13 +277,13 @@ public class ChatGroupDao extends AbstractCommunicationDao { ...@@ -277,13 +277,13 @@ public class ChatGroupDao extends AbstractCommunicationDao {
public void deleteGroupList(List<ChatGroupDto> groupList) { public void deleteGroupList(List<ChatGroupDto> groupList) {
StringBuffer sql = new StringBuffer(); StringBuffer sql = new StringBuffer();
sql.append(" delete from m_chat_group "); sql.append(" DELETE FROM m_chat_group ");
sql.append(" WHERE group_id = ? "); sql.append(" WHERE group_id = ? ");
try { try {
beginTransaction(); beginTransaction();
for (ChatGroupDto groupDto : groupList) { for (ChatGroupDto groupDto : groupList) {
update(sql.toString(), new Object[] { groupDto.groupId }); update(sql.toString(), new Object[] { groupDto.groupId });
update("delete from r_shop_member_group where group_id = ? ", new Object[] { groupDto.groupId }); update("DELETE FROM r_shop_member_group WHERE group_id = ? ", new Object[] { groupDto.groupId });
} }
commit(); commit();
} catch (Exception e) { } catch (Exception e) {
...@@ -292,6 +292,4 @@ public class ChatGroupDao extends AbstractCommunicationDao { ...@@ -292,6 +292,4 @@ public class ChatGroupDao extends AbstractCommunicationDao {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
} }
} }
...@@ -187,7 +187,7 @@ public class ChatMessageDao extends AbstractCommunicationDao { ...@@ -187,7 +187,7 @@ public class ChatMessageDao extends AbstractCommunicationDao {
} }
public void insertChatMessage(ChatMessageDto dto) { public void insertChatMessage(ChatMessageDto dto) {
insert("insert or replace into t_chat_message (chat_message_id, chat_room_id, shop_member_id, login_id, message, message_type, image_name, download_file_name, save_path, insert_date, unread_count) values (?,?,?,?,?,?,?,?,?,?,?)", dto.getInsertValues()); insert("INSERT OR replace INTO t_chat_message (chat_message_id, chat_room_id, shop_member_id, login_id, message, message_type, image_name, download_file_name, save_path, insert_date, unread_count) VALUES (?,?,?,?,?,?,?,?,?,?,?)", dto.getInsertValues());
} }
public void insertChatMessage(List<ChatMessageDto> chatMessageDtoList) { public void insertChatMessage(List<ChatMessageDto> chatMessageDtoList) {
...@@ -205,15 +205,15 @@ public class ChatMessageDao extends AbstractCommunicationDao { ...@@ -205,15 +205,15 @@ public class ChatMessageDao extends AbstractCommunicationDao {
} }
public boolean updateChatMessage(ChatMessageDto dto) { public boolean updateChatMessage(ChatMessageDto dto) {
long count = update("update t_chat_message set chat_room_id=?, shop_member_id=?, login_id=?,message=?, message_type=?, image_name=?, download_file_name=?, save_path=?, insert_date=?, unread_count where chat_message_id=?", dto.getUpdateValues()); long count = update("UPDATE t_chat_message set chat_room_id=?, shop_member_id=?, login_id=?,message=?, message_type=?, image_name=?, download_file_name=?, save_path=?, insert_date=?, unread_count WHERE chat_message_id=?", dto.getUpdateValues());
return count > 0; return count > 0;
} }
public void updatUnreadCount(List<ChatMessageDto> messageDtoList, String roomId) { public void updatUnreadCount(List<ChatMessageDto> messageDtoList, String roomId) {
beginTransaction(); beginTransaction();
update("update t_chat_message set unread_count = 0 where chat_room_id=?", new String[]{"" + roomId}); update("UPDATE t_chat_message set unread_count = 0 WHERE chat_room_id=?", new String[]{"" + roomId});
for (ChatMessageDto messageDto : messageDtoList) { for (ChatMessageDto messageDto : messageDtoList) {
update("update t_chat_message set unread_count = ? where chat_message_id=?", new String[]{"" + messageDto.unreadCount, "" + messageDto.chatMessageId}); update("UPDATE t_chat_message set unread_count = ? WHERE chat_message_id=?", new String[]{"" + messageDto.unreadCount, "" + messageDto.chatMessageId});
} }
commit(); commit();
} }
......
...@@ -2,16 +2,12 @@ package jp.agentec.abook.abv.bl.data.dao; ...@@ -2,16 +2,12 @@ package jp.agentec.abook.abv.bl.data.dao;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
import jp.agentec.abook.abv.bl.common.db.Cursor; import jp.agentec.abook.abv.bl.common.db.Cursor;
import jp.agentec.abook.abv.bl.common.log.Logger; import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.dto.ChatRoomDto;
import jp.agentec.abook.abv.bl.dto.MemberInfoDto;
import jp.agentec.abook.abv.bl.dto.ShopMemberDto; import jp.agentec.abook.abv.bl.dto.ShopMemberDto;
import jp.agentec.adf.util.CollectionUtil; import jp.agentec.adf.util.CollectionUtil;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil; import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.StringUtil; import jp.agentec.adf.util.StringUtil;
...@@ -58,22 +54,22 @@ public class ShopMemberDao extends AbstractCommunicationDao { ...@@ -58,22 +54,22 @@ public class ShopMemberDao extends AbstractCommunicationDao {
} }
public List<ShopMemberDto> getAllShopMember() { public List<ShopMemberDto> getAllShopMember() {
List<ShopMemberDto> list = rawQueryGetDtoList("select * from m_shop_member", null, ShopMemberDto.class); List<ShopMemberDto> list = rawQueryGetDtoList("SELECT * FROM m_shop_member", null, ShopMemberDto.class);
return list; return list;
} }
public ShopMemberDto getShopMember(int shopMemberId) { public ShopMemberDto getShopMember(int shopMemberId) {
return rawQueryGetDto("select * from m_shop_member where shop_member_id=?", new String[]{""+ shopMemberId}, ShopMemberDto.class); return rawQueryGetDto("SELECT * FROM m_shop_member WHERE shop_member_id=?", new String[]{""+ shopMemberId}, ShopMemberDto.class);
} }
public void insertShopMember(ShopMemberDto dto) { public void insertShopMember(ShopMemberDto dto) {
try { try {
beginTransaction(); beginTransaction();
insert("insert or replace into m_shop_member (shop_member_id, shop_member_name, login_id, profile_url, self_flg, favorite_register_date) values (?,?,?,?,?,(select favorite_register_date from m_shop_member where shop_member_id = ?))", dto.getInsertValues()); insert("INSERT OR REPLACE INTO m_shop_member (shop_member_id, shop_member_name, login_id, profile_url, self_flg, favorite_register_date) VALUES (?,?,?,?,?,(SELECT favorite_register_date FROM m_shop_member WHERE shop_member_id = ?))", dto.getInsertValues());
if (dto.groupIdList != null && dto.groupIdList.size() > 0) { if (dto.groupIdList != null && dto.groupIdList.size() > 0) {
update(" delete from r_shop_member_group WHERE shop_member_id = ? ", new Integer[]{dto.shopMemberId}); update(" DELETE FROM r_shop_member_group WHERE shop_member_id = ? ", new Integer[]{dto.shopMemberId});
for (Integer groupId : dto.groupIdList) { for (Integer groupId : dto.groupIdList) {
insert("insert or replace into r_shop_member_group (shop_member_id, group_id) values ("+dto.shopMemberId+",?)", new Integer[]{groupId}); insert("INSERT OR REPLACE INTO r_shop_member_group (shop_member_id, group_id) VALUES ("+dto.shopMemberId+",?)", new Integer[]{groupId});
} }
} }
commit(); commit();
...@@ -89,10 +85,10 @@ public class ShopMemberDao extends AbstractCommunicationDao { ...@@ -89,10 +85,10 @@ public class ShopMemberDao extends AbstractCommunicationDao {
try { try {
beginTransaction(); beginTransaction();
for (ShopMemberDto dto : dtoList) { for (ShopMemberDto dto : dtoList) {
insert("insert or replace into m_shop_member (shop_member_id, shop_member_name, login_id, profile_url, self_flg, favorite_register_date) values (?,?,?,?,?, (select favorite_register_date from m_shop_member where shop_member_id = ?))", dto.getInsertValues()); insert("INSERT OR REPLACE INTO m_shop_member (shop_member_id, shop_member_name, login_id, profile_url, self_flg, favorite_register_date) VALUES (?,?,?,?,?, (SELECT favorite_register_date FROM m_shop_member WHERE shop_member_id = ?))", dto.getInsertValues());
if (dto.groupIdList == null) { continue; } if (dto.groupIdList == null) { continue; }
for (Integer groupId : dto.groupIdList) { for (Integer groupId : dto.groupIdList) {
insert("insert or replace into r_shop_member_group (shop_member_id, group_id) values ("+dto.shopMemberId+",?)", new Integer[]{groupId}); insert("INSERT OR REPLACE INTO r_shop_member_group (shop_member_id, group_id) VALUES ("+dto.shopMemberId+",?)", new Integer[]{groupId});
} }
} }
commit(); commit();
...@@ -107,9 +103,9 @@ public class ShopMemberDao extends AbstractCommunicationDao { ...@@ -107,9 +103,9 @@ public class ShopMemberDao extends AbstractCommunicationDao {
public void insertShopMemberGroupRelation(Integer groupId, List<ShopMemberDto> dtoList) { public void insertShopMemberGroupRelation(Integer groupId, List<ShopMemberDto> dtoList) {
try { try {
update("delete from r_shop_member_group where group_id = ? ", new Object[] { groupId }); update("DELETE FROM r_shop_member_group WHERE group_id = ? ", new Object[] { groupId });
for (ShopMemberDto dto : dtoList) { for (ShopMemberDto dto : dtoList) {
insert("insert or replace into r_shop_member_group (shop_member_id, group_id) values ("+dto.shopMemberId+",?)", new Integer[]{groupId}); insert("INSERT OR REPLACE INTO r_shop_member_group (shop_member_id, group_id) VALUES ("+dto.shopMemberId+",?)", new Integer[]{groupId});
} }
} catch (Exception e) { } catch (Exception e) {
rollback(); rollback();
...@@ -120,11 +116,11 @@ public class ShopMemberDao extends AbstractCommunicationDao { ...@@ -120,11 +116,11 @@ public class ShopMemberDao extends AbstractCommunicationDao {
} }
public ShopMemberDto getMyInfo() { public ShopMemberDto getMyInfo() {
return rawQueryGetDto("select * from m_shop_member where self_flg = 1", null, ShopMemberDto.class); return rawQueryGetDto("SELECT * FROM m_shop_member WHERE self_flg = 1", null, ShopMemberDto.class);
} }
public void resetSelfFlg() { public void resetSelfFlg() {
update("update m_shop_member set self_flg = 0", new String[]{}); update("UPDATE m_shop_member SET self_flg = 0", new String[]{});
} }
public List<ShopMemberDto> getUserInRoom(Integer chatRoomId) { public List<ShopMemberDto> getUserInRoom(Integer chatRoomId) {
...@@ -196,7 +192,7 @@ public class ShopMemberDao extends AbstractCommunicationDao { ...@@ -196,7 +192,7 @@ public class ShopMemberDao extends AbstractCommunicationDao {
} }
public List<ShopMemberDto> getfavoriteUserList() { public List<ShopMemberDto> getfavoriteUserList() {
return rawQueryGetDtoList("select * from m_shop_member where favorite_register_date NOT NULL", null, ShopMemberDto.class); return rawQueryGetDtoList("SELECT * FROM m_shop_member WHERE favorite_register_date NOT NULL", null, ShopMemberDto.class);
} }
public List<ShopMemberDto> getfavoriteUserListNotInRoom(Integer roomId) { public List<ShopMemberDto> getfavoriteUserListNotInRoom(Integer roomId) {
...@@ -257,7 +253,7 @@ public class ShopMemberDao extends AbstractCommunicationDao { ...@@ -257,7 +253,7 @@ public class ShopMemberDao extends AbstractCommunicationDao {
sql.append(" m_shop_member AS sm "); sql.append(" m_shop_member AS sm ");
sql.append(" INNER JOIN r_shop_member_group AS rsmg "); sql.append(" INNER JOIN r_shop_member_group AS rsmg ");
sql.append(" ON sm.shop_member_id = rsmg.shop_member_id "); sql.append(" ON sm.shop_member_id = rsmg.shop_member_id ");
sql.append("WHERE rsmg.group_id IN (select group_id from m_shop_member sm inner join r_shop_member_group rmg on sm.shop_member_id = rmg.shop_member_id where sm.self_flg = 1) "); sql.append("WHERE rsmg.group_id IN (SELECT group_id FROM m_shop_member sm INNER JOIN r_shop_member_group rmg on sm.shop_member_id = rmg.shop_member_id WHERE sm.self_flg = 1) ");
sql.append(" AND sm.self_flg != 1 "); sql.append(" AND sm.self_flg != 1 ");
ArrayList<String> whereSqlList = new ArrayList<String>(); ArrayList<String> whereSqlList = new ArrayList<String>();
for (String keyword : keywords) { for (String keyword : keywords) {
...@@ -286,7 +282,7 @@ public class ShopMemberDao extends AbstractCommunicationDao { ...@@ -286,7 +282,7 @@ public class ShopMemberDao extends AbstractCommunicationDao {
sql.append(" m_shop_member AS sm "); sql.append(" m_shop_member AS sm ");
sql.append(" INNER JOIN r_shop_member_group AS rsmg "); sql.append(" INNER JOIN r_shop_member_group AS rsmg ");
sql.append(" ON sm.shop_member_id = rsmg.shop_member_id "); sql.append(" ON sm.shop_member_id = rsmg.shop_member_id ");
sql.append(" WHERE rsmg.group_id IN (select group_id from m_shop_member sm inner join r_shop_member_group rmg on sm.shop_member_id = rmg.shop_member_id where sm.self_flg = 1)"); sql.append(" WHERE rsmg.group_id IN (SELECT group_id FROM m_shop_member sm INNER JOIN r_shop_member_group rmg on sm.shop_member_id = rmg.shop_member_id WHERE sm.self_flg = 1)");
sql.append(" AND sm.self_flg != 1"); sql.append(" AND sm.self_flg != 1");
sql.append(" AND sm.shop_member_id NOT IN (SELECT shop_member_id FROM r_chat_room_shop_member WHERE chat_room_id = ?)"); sql.append(" AND sm.shop_member_id NOT IN (SELECT shop_member_id FROM r_chat_room_shop_member WHERE chat_room_id = ?)");
ArrayList<String> whereSqlList = new ArrayList<String>(); ArrayList<String> whereSqlList = new ArrayList<String>();
...@@ -389,12 +385,12 @@ public class ShopMemberDao extends AbstractCommunicationDao { ...@@ -389,12 +385,12 @@ public class ShopMemberDao extends AbstractCommunicationDao {
} }
public boolean updateShopMember(ShopMemberDto dto) { public boolean updateShopMember(ShopMemberDto dto) {
long count = update("update m_shop_member set shop_member_name=?, profile_url=? where shop_member_id=?", dto.getUpdateValues()); long count = update("UPDATE m_shop_member SET shop_member_name=?, profile_url=? WHERE shop_member_id=?", dto.getUpdateValues());
return count > 0; return count > 0;
} }
public boolean deleteShopMember(ShopMemberDto dto) { public boolean deleteShopMember(ShopMemberDto dto) {
long count = update("delete from m_shop_member where shop_member_id=?", new String[] {"" + dto.shopMemberId}); long count = update("DELETE FROM m_shop_member WHERE shop_member_id=?", new String[] {"" + dto.shopMemberId});
return count > 0; return count > 0;
} }
...@@ -402,9 +398,9 @@ public class ShopMemberDao extends AbstractCommunicationDao { ...@@ -402,9 +398,9 @@ public class ShopMemberDao extends AbstractCommunicationDao {
try { try {
beginTransaction(); beginTransaction();
for (ShopMemberDto dto : dtoList) { for (ShopMemberDto dto : dtoList) {
update("delete from r_shop_member_group where shop_member_id=?", new String[] {"" + dto.shopMemberId}); update("DELETE FROM r_shop_member_group WHERE shop_member_id=?", new String[] {"" + dto.shopMemberId});
update("delete from r_chat_room_shop_member where shop_member_id=?", new String[] {"" + dto.shopMemberId}); update("DELETE FROM r_chat_room_shop_member WHERE shop_member_id=?", new String[] {"" + dto.shopMemberId});
update("delete from m_shop_member where shop_member_id=?", new String[] {"" + dto.shopMemberId}); update("DELETE FROM m_shop_member WHERE shop_member_id=?", new String[] {"" + dto.shopMemberId});
} }
commit(); commit();
} catch (Exception e) { } catch (Exception e) {
...@@ -417,7 +413,7 @@ public class ShopMemberDao extends AbstractCommunicationDao { ...@@ -417,7 +413,7 @@ public class ShopMemberDao extends AbstractCommunicationDao {
} }
public boolean updateFavoriteUser(ShopMemberDto dto) { public boolean updateFavoriteUser(ShopMemberDto dto) {
long count = update("update m_shop_member set favorite_register_date=? where shop_member_id=?", new Object[]{dto.favoriteRegisterDate, dto.shopMemberId}); long count = update("UPDATE m_shop_member SET favorite_register_date=? WHERE shop_member_id=?", new Object[]{dto.favoriteRegisterDate, dto.shopMemberId});
return count > 0; return count > 0;
} }
...@@ -427,7 +423,7 @@ public class ShopMemberDao extends AbstractCommunicationDao { ...@@ -427,7 +423,7 @@ public class ShopMemberDao extends AbstractCommunicationDao {
ShopMemberDto favoriteUserDto= new ShopMemberDto(); ShopMemberDto favoriteUserDto= new ShopMemberDto();
favoriteUserDto.shopMemberId = shopMemberId; favoriteUserDto.shopMemberId = shopMemberId;
favoriteUserDto.favoriteRegisterDate = DateTimeUtil.toString_yyyyMMddHHmmss_none(new Date(System.currentTimeMillis())); favoriteUserDto.favoriteRegisterDate = DateTimeUtil.toString_yyyyMMddHHmmss_none(new Date(System.currentTimeMillis()));
update("update m_shop_member set favorite_register_date=? where shop_member_id=?", new Object[]{favoriteUserDto.favoriteRegisterDate, favoriteUserDto.shopMemberId}); update("UPDATE m_shop_member SET favorite_register_date=? WHERE shop_member_id=?", new Object[]{favoriteUserDto.favoriteRegisterDate, favoriteUserDto.shopMemberId});
} }
commit(); commit();
} }
......
...@@ -1490,9 +1490,11 @@ ...@@ -1490,9 +1490,11 @@
<string name="msg_destroy_exist_collaboration">進行中の協業が存在します。既存協業を終了し、新しい協業を開始してもよろしいですか</string> <string name="msg_destroy_exist_collaboration">進行中の協業が存在します。既存協業を終了し、新しい協業を開始してもよろしいですか</string>
<string name="not_found_camera">利用可能なカメラを見つかりませんでした。</string> <string name="not_found_camera">利用可能なカメラを見つかりませんでした。</string>
<string name="error_fail_record">レコーディングに失敗しました。管理者にお問い合わせしてください。</string> <string name="error_fail_record">レコーディングに失敗しました。管理者にお問い合わせしてください。</string>
<!-- 連続作業 --> <!-- 連続作業 -->
<string name="msg_error_all_process_delete">全削除の送信に失敗しました。</string> <string name="msg_error_all_process_delete">全削除の送信に失敗しました。</string>
<string name="msg_ozd_file_could_not_opened">帳票ファイルを開くことができませんでした。</string> <string name="msg_ozd_file_could_not_opened">帳票ファイルを開くことができませんでした。</string>
<!-- Communication 会議室 -->
<string name="msg_error_favorites_100_over">お気に入りは最大100件までです。</string>
<string name="msg_eroor_network_offline">接続しているネットワークがありません。</string>
<string name="msg_error_connection_error_meeting_room">会議室サーバに接続できませんでした。</string>
</resources> </resources>
...@@ -1498,4 +1498,8 @@ ...@@ -1498,4 +1498,8 @@
<string name="not_found_camera">사용 가능한 카메라 기기를 찾을수 없습니다.</string> <string name="not_found_camera">사용 가능한 카메라 기기를 찾을수 없습니다.</string>
<string name="msg_destroy_exist_collaboration">진행중인 협업이 존재합니다. 기존 협업을 종료하고 새로운 협업을 시작 하시겠습니까?</string> <string name="msg_destroy_exist_collaboration">진행중인 협업이 존재합니다. 기존 협업을 종료하고 새로운 협업을 시작 하시겠습니까?</string>
<string name="error_fail_record">레코드에 실패했습니다. 관리자에게 문의해주세요.</string> <string name="error_fail_record">레코드에 실패했습니다. 관리자에게 문의해주세요.</string>
<!-- Communication 会議室 -->
<string name="msg_error_favorites_100_over">즐겨찾기는 최대 100개까지 입니다.</string>
<string name="msg_eroor_network_offline">연결된 네트워크가 없습니다.</string>
<string name="msg_error_connection_error_meeting_room">회의실 서버에 연결할 수 없습니다.</string>
</resources> </resources>
\ No newline at end of file
...@@ -1495,4 +1495,8 @@ ...@@ -1495,4 +1495,8 @@
<string name="not_found_camera">Not found camera device.</string> <string name="not_found_camera">Not found camera device.</string>
<string name="msg_destroy_exist_collaboration">Ongoing collaboration exist. Do you want to terminate exist collaboration and start new?</string> <string name="msg_destroy_exist_collaboration">Ongoing collaboration exist. Do you want to terminate exist collaboration and start new?</string>
<string name="error_fail_record">Recording failed. Please contact the administrator.</string> <string name="error_fail_record">Recording failed. Please contact the administrator.</string>
<!-- Communication 会議室 -->
<string name="msg_error_favorites_100_over">You can have up to 100 favorites.</string>
<string name="msg_eroor_network_offline">There is no network connected.</string>
<string name="msg_error_connection_error_meeting_room">Could not connect to the meeting room server.</string>
</resources> </resources>
...@@ -26,6 +26,7 @@ import android.os.Environment; ...@@ -26,6 +26,7 @@ import android.os.Environment;
import android.provider.BaseColumns; import android.provider.BaseColumns;
import android.provider.MediaStore; import android.provider.MediaStore;
import android.support.annotation.RequiresApi; import android.support.annotation.RequiresApi;
import android.util.Log;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
...@@ -56,12 +57,18 @@ import java.util.Timer; ...@@ -56,12 +57,18 @@ import java.util.Timer;
import java.util.TimerTask; 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.ArchiveListJSON;
import jp.agentec.abook.abv.bl.acms.client.json.ChangeRoomNameJSON;
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.GetFavoriteGroupJSON;
import jp.agentec.abook.abv.bl.acms.client.json.GetFavoriteUserJSON; import jp.agentec.abook.abv.bl.acms.client.json.GetFavoriteUserJSON;
import jp.agentec.abook.abv.bl.acms.client.json.GroupListJSON; import jp.agentec.abook.abv.bl.acms.client.json.GroupListJSON;
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.MyInfoJSON; import jp.agentec.abook.abv.bl.acms.client.json.MyInfoJSON;
import jp.agentec.abook.abv.bl.acms.client.json.RoomJSON;
import jp.agentec.abook.abv.bl.acms.client.json.RoomListJSON;
import jp.agentec.abook.abv.bl.acms.client.json.UnreadCountJSON; import jp.agentec.abook.abv.bl.acms.client.json.UnreadCountJSON;
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;
import jp.agentec.abook.abv.bl.common.CommonExecutor; import jp.agentec.abook.abv.bl.common.CommonExecutor;
import jp.agentec.abook.abv.bl.common.constant.ABookCommConstants; import jp.agentec.abook.abv.bl.common.constant.ABookCommConstants;
...@@ -70,7 +77,10 @@ import jp.agentec.abook.abv.bl.common.exception.AcmsException; ...@@ -70,7 +77,10 @@ import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException; import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException;
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.ABVDataCache; import jp.agentec.abook.abv.bl.data.ABVDataCache;
import jp.agentec.abook.abv.bl.dto.ArchiveDto;
import jp.agentec.abook.abv.bl.dto.ChatMessageDto; import jp.agentec.abook.abv.bl.dto.ChatMessageDto;
import jp.agentec.abook.abv.bl.dto.ChatRoomDto;
import jp.agentec.abook.abv.bl.dto.MeetingDto;
import jp.agentec.abook.abv.bl.dto.PushMessageDto; 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;
...@@ -85,6 +95,7 @@ import jp.agentec.abook.abv.ui.common.constant.ErrorCode; ...@@ -85,6 +95,7 @@ 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.constant.ErrorMessage;
import jp.agentec.abook.abv.ui.common.constant.NaviConsts; import jp.agentec.abook.abv.ui.common.constant.NaviConsts;
import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog; import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog;
import jp.agentec.abook.abv.ui.Interface.ChatRoomEventListener;
import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil; import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper; import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.home.helper.VideoEncoder; import jp.agentec.abook.abv.ui.home.helper.VideoEncoder;
...@@ -94,13 +105,14 @@ import jp.agentec.abook.abv.ui.viewer.activity.CommunicationWebViewActivity; ...@@ -94,13 +105,14 @@ import jp.agentec.abook.abv.ui.viewer.activity.CommunicationWebViewActivity;
import jp.agentec.adf.util.CollectionUtil; import jp.agentec.adf.util.CollectionUtil;
import jp.agentec.adf.util.StringUtil; import jp.agentec.adf.util.StringUtil;
import static jp.agentec.abook.abv.bl.common.constant.ABookCommConstants.DEFAULT_CHECKSUM;
import static org.chromium.net.NetError.ERR_FAILED; import static org.chromium.net.NetError.ERR_FAILED;
/** /**
* Created by AIS-NB-048 on 2019/07/31. * Created by AIS-NB-048 on 2019/07/31.
*/ */
public class ChatWebViewActivity extends CommunicationWebViewActivity { public class ChatWebViewActivity extends CommunicationWebViewActivity implements ChatRoomEventListener {
public ChatWebView mChatWebView; public ChatWebView mChatWebView;
private String chatWebviewUrl; private String chatWebviewUrl;
...@@ -153,9 +165,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -153,9 +165,6 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
//setContentView(R.layout.chat_webview); //setContentView(R.layout.chat_webview);
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);
//layout.addView(mChatWebView, param);
//addContentView(disasterView_, param);
setContentView(mChatWebView, param); setContentView(mChatWebView, param);
} }
...@@ -187,7 +196,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -187,7 +196,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
//mChatWebView = findViewById(R.id.chatWebview); //mChatWebView = findViewById(R.id.chatWebview);
mChatWebView.init(); mChatWebView.init();
mChatWebView.setCommunicationLogic(communicationLogic); mChatWebView.setCommunicationLogic(communicationLogic);
mChatWebView.setChatWebViewActivity(this); mChatWebView.setChatRoomEventListener(this);
} }
private void setupDefaultChatWebViewURL() { private void setupDefaultChatWebViewURL() {
...@@ -313,6 +322,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -313,6 +322,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
} }
// WebView内のAlert Dialogを処理する // WebView内のAlert Dialogを処理する
// 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)) { if (mChatWebView.getUrl() != null && mChatWebView.getUrl().equals(ABookCommConstants.COLLABORATION_PAGE_URL)) {
...@@ -406,6 +416,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -406,6 +416,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
} }
// WebView内のConfirm Dialogを処理する // WebView内のConfirm Dialogを処理する
// message.equals で、 fermi側のHTMLを解析して、処理を分けている。
@Override @Override
public boolean onJsConfirm(WebView view, String url, String message, final JsResult result) { public boolean onJsConfirm(WebView view, String url, String message, final JsResult result) {
if (message.equals("Do you want to leave this room?")) { if (message.equals("Do you want to leave this room?")) {
...@@ -657,6 +668,11 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -657,6 +668,11 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
}); });
} }
@Override
public void showCommunicationChatMenuDialog() {
showCommunicationMenuDialog();
}
// 保存するファイルをjpgに固定する // 保存するファイルをjpgに固定する
public String getFileName(String url) { public String getFileName(String url) {
String filenameWithoutExtension = ""; String filenameWithoutExtension = "";
...@@ -665,6 +681,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -665,6 +681,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
return filenameWithoutExtension; return filenameWithoutExtension;
} }
@Override
public void getLogin() { public void getLogin() {
// ローカルの言語を確認する // ローカルの言語を確認する
String localLanguage = ActivityHandlingHelper.getInstance().getLocaleFileName(); String localLanguage = ActivityHandlingHelper.getInstance().getLocaleFileName();
...@@ -689,6 +706,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -689,6 +706,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
} }
} }
@Override
public void getQueryParam() { public void getQueryParam() {
String chatServerUrl = ABVEnvironment.getInstance().websocketServerHttpUrl; String chatServerUrl = ABVEnvironment.getInstance().websocketServerHttpUrl;
chatServerUrl= chatServerUrl.substring(0, chatServerUrl.length() - 3); chatServerUrl= chatServerUrl.substring(0, chatServerUrl.length() - 3);
...@@ -828,6 +846,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -828,6 +846,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
/** /**
* 作業一覧へ遷移 * 作業一覧へ遷移
*/ */
@Override
public void backToHome() { public void backToHome() {
mChatWebView.loadUrl("javascript:CHAT.leaveRoom()"); mChatWebView.loadUrl("javascript:CHAT.leaveRoom()");
exitAndDeleteMeetingRoom(); exitAndDeleteMeetingRoom();
...@@ -1034,6 +1053,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -1034,6 +1053,7 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
// 共通資料画面表示 // 共通資料画面表示
@Override
public void showCommonContent() { public void showCommonContent() {
Intent intent = new Intent(); Intent intent = new Intent();
intent.setClass(ChatWebViewActivity.this, OperationRelatedContentActivity.class); intent.setClass(ChatWebViewActivity.this, OperationRelatedContentActivity.class);
...@@ -1157,4 +1177,474 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity { ...@@ -1157,4 +1177,474 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity {
communicationLogic.insertShopMember(resultJson.shopMemberDtoArrayList); communicationLogic.insertShopMember(resultJson.shopMemberDtoArrayList);
updateUnreadCount(); updateUnreadCount();
} }
@Override
public void setSelectedUserIdList(String userList) {
selectedUserIdList = userList;
}
@Override
public String getSelectedUserList() {
String userList = communicationLogic.getUserList(selectedUserIdList);
Log.d("getSelectedUserList " , userList );
return userList;
}
@Override
public void updateRoomList() throws NetworkDisconnectedException, AcmsException {
RoomListJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).getRoomList(sid);
communicationLogic.insertChatRoomList(resultJson.roomList);
}
@Override
public void updateMyInfo() throws NetworkDisconnectedException, AcmsException {
updateMyInfoFromServer();
}
@Override
public void updateGroupUser() throws NetworkDisconnectedException, AcmsException {
updateGroupInfoFromServer();
}
@Override
public void createChatRoom(String roomType, String userIdList, String encodedRoomName, String screenFlg, boolean isVoice) throws NetworkDisconnectedException, AcmsException {
CreatedRoomJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).createRoom(sid, roomType, userIdList, encodedRoomName, loginId);
if (ABookCommConstants.FLAG.SCREEN_FLG.MAKE_ROOM.equals(Integer.parseInt(screenFlg))) {
final ChatRoomDto chatRoomDto = communicationLogic.getChatRoom(resultJson.chatRoomDto.chatRoomId);
if (chatRoomDto != null) {
mChatWebView.post(new Runnable() {
@Override
public void run() {
mChatWebView.loadUrl(String.format("javascript:CHAT_UI.displayExistRoom('%s');", chatRoomDto.chatRoomId.toString()));
}
});
return;
}
}
communicationLogic.insertChatRoom(resultJson.chatRoomDto);
communicationLogic.addUserInRoom(StringUtil.join(",", userIdList, shopMemberId.toString()), resultJson.chatRoomDto.chatRoomId);
final Integer chatRoomId = resultJson.chatRoomDto.chatRoomId;
final String chatRoomName = resultJson.chatRoomDto.chatRoomName;
if (isVoice) {
roomId = chatRoomId.longValue();
roomName = chatRoomName;
mChatWebView.post(new Runnable() {
@Override
public void run() {
mChatWebView.loadUrl(String.format("javascript:CHAT_UI.startCollaboration('%s');", ABookCommConstants.FLAG.COLLABORATION_TYPE.AUDIO));
}
});
} else {
mChatWebView.post(new Runnable() {
@Override
public void run() {
mChatWebView.loadUrl(String.format("javascript:CHAT_UI.joinRoom('%s', '%s');", chatRoomId, chatRoomName));
}
});
}
}
@Override
public void changeRoomName(String changeRoomName) throws NetworkDisconnectedException, AcmsException {
ChangeRoomNameJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).changeRoomName(sid, changeRoomName, roomId.intValue());
if (resultJson.status != 200) { return; }
communicationLogic.updateChatRoomName(changeRoomName, roomId.intValue());
joinRoom(roomId.toString(), changeRoomName);
}
@Override
public void joinRoom(String joinRoomId, String joinRoomName) {
ChatRoomDto chatRoom = communicationLogic.getChatRoom(Integer.parseInt(joinRoomId));
roomId = chatRoom.chatRoomId.longValue();
roomName = chatRoom.chatRoomName;
roomType = chatRoom.type.toString();
beforeRoomType = chatRoom.type.toString();
communicationLogic.roomDisplayOff(roomId.intValue(), ABookCommConstants.FLAG.ROOM_VIEW_FLAG.VISIBLE);
mChatWebView.loadChatViewUrl(ABookCommConstants.CHAT_ROOM_PAGE_URL);
}
@Override
public void roomDisplayOff(){
communicationLogic.roomDisplayOff(roomId.intValue(), ABookCommConstants.FLAG.ROOM_VIEW_FLAG.INVISIBLE);
mChatWebView.loadChatViewUrl(ABookCommConstants.CHAT_PAGE_URL);
}
@Override
public void inviteUsers(String userIds, boolean isCollaboration) throws NetworkDisconnectedException, AcmsException {
final UserInviteResultJSON result = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).inviteUsers(sid, roomId.intValue(), roomName, userIds);
if (result.roomId == null) {
communicationLogic.addUserInRoom(userIds, roomId.intValue());
if (!isCollaboration) {
mChatWebView.loadChatViewUrl(ABookCommConstants.CHAT_ROOM_PAGE_URL);
}
} else {
mChatWebView.loadChatViewUrl(String.format("javascript:CHAT_UI.displayExistRoom('%s');", result.roomId.toString()));
}
}
@Override
public String getRoomType() {
return roomType;
}
@Override
public String getBeforeRoomType() {
return beforeRoomType;
}
@Override
public void clearBeforeRoomType() {
beforeRoomType = null;
}
@Override
public void updateMessages(String roomId) throws NetworkDisconnectedException, AcmsException {
SharedPreferences pref = getSharedPreferences(ABookCommConstants.TAG, MODE_PRIVATE);
String lastUpdatedDate = pref.getString(ABookCommConstants.KEY.MESSAGE_UPDATED_DATE + roomId, DEFAULT_CHECKSUM);
MessageInfoListJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).getMessages(sid, roomId, null, lastUpdatedDate);
for (ChatMessageDto chatMessageDto : resultJson.chatMessageDtoArrayList) {
chatMessageDto.chatRoomId = Integer.parseInt(roomId);
}
communicationLogic.insertMessageList(resultJson.chatMessageDtoArrayList);
communicationLogic.insertShopMember(resultJson.shopMemberDtoArrayList);
updateUnreadCount();
SharedPreferences.Editor editor = pref.edit();
editor.putString(ABookCommConstants.KEY.MESSAGE_UPDATED_DATE + roomId, resultJson.updateDate);
editor.commit();
}
@Override
public String searchMessages(String keyword, String userList) {
String messageListStr = communicationLogic.searMessages(roomId.intValue(), keyword, userList);
return messageListStr;
}
@Override
public String getFavoriteUsersNotInRoom() {
String favoriteUsersStr = communicationLogic.getFavoriteUsersNotInRoom(roomId.intValue());
return favoriteUsersStr;
}
@Override
public String getMyGroupUsersNotInRoom() {
String myGroupUsersStr = communicationLogic.getMyGroupUsersNotInRoom(roomId.intValue());
return myGroupUsersStr;
}
@Override
public String getMyGroupShopMemberNotInRoomByName(String keywords) {
String searchUserStr = communicationLogic.getMyGroupUserNotInRoomByName(keywords, roomId.intValue());
return searchUserStr;
}
@Override
public String getAllGroupShopMemberNotInRoomByName(String keywords) {
String searchUserStr = communicationLogic.getAllGroupShopMemberNotInRoomByName(keywords, roomId.intValue());
return searchUserStr;
}
@Override
public void updateUserInfo(String shopMemberId) throws NetworkDisconnectedException, AcmsException {
updateUserInfoFromServer(shopMemberId);
}
@Override
public String getGroupInfoForAddUser(String groupId) {
String groupInfoStr = communicationLogic.getGroupSearchDataForAddUser(Integer.parseInt(groupId), roomId.intValue());
return groupInfoStr;
}
@Override
public boolean addFavoriteUser(String shopMemberId) throws AcmsException {
Integer favoriteCount = communicationLogic.getFavoriteCount();
if (favoriteCount >= ABookCommConstants.SIZE.MAX_FAVORITE_COUNT ) {
mChatWebView.loadChatViewUrl("javascript:alert('" + getString(R.string.msg_error_favorites_100_over) + "');");
return false;
} else {
boolean result = false;
try {
result = insertFavoriteUser(shopMemberId);
if (!result) { return false; }
mChatWebView.loadChatViewUrl("javascript:CHAT_UI.refreshContactScreen();");
return true;
} catch (NetworkDisconnectedException e) {
mChatWebView.loadChatViewUrl("javascript:alert('" + getString(R.string.msg_eroor_network_offline) + "');");
}
}
return false;
}
@Override
public boolean removeFavoriteUser(String shopMemberId) throws AcmsException {
try {
boolean result = deleteFavoriteUser(shopMemberId);
if (!result) {
return false;
}
mChatWebView.loadChatViewUrl("javascript:CHAT_UI.refreshContactScreen();");
return true;
} catch (NetworkDisconnectedException e) {
mChatWebView.loadChatViewUrl("javascript:alert('" + getString(R.string.msg_eroor_network_offline) + "');");
}
return false;
}
@Override
public boolean addFavoriteGroup(String groupId) throws AcmsException {
Integer favoriteCount = communicationLogic.getFavoriteCount();
if (favoriteCount >= ABookCommConstants.SIZE.MAX_FAVORITE_COUNT) {
mChatWebView.loadChatViewUrl("javascript:alert('" + getString(R.string.msg_error_favorites_100_over) + "');");
return false;
} else {
boolean result = false;
try {
result = insertFavoriteGroup(groupId);
if (!result) {
return false;
}
mChatWebView.loadChatViewUrl("javascript:CHAT_UI.refreshContactScreen();");
return true;
} catch (NetworkDisconnectedException e) {
mChatWebView.loadChatViewUrl("javascript:alert('" + getString(R.string.msg_eroor_network_offline) + "');");
}
}
return false;
}
@Override
public boolean removeFavoriteGroup(String groupId) throws AcmsException {
boolean result = false;
try {
result = deleteFavoriteGroup(groupId);
if (!result) {
return false;
}
mChatWebView.loadChatViewUrl("javascript:CHAT_UI.refreshContactScreen();");
return true;
} catch (NetworkDisconnectedException e) {
mChatWebView.loadChatViewUrl("javascript:alert('" + getString(R.string.msg_eroor_network_offline) + "');");
}
return false;
}
@Override
public void updateFavorite() throws NetworkDisconnectedException, AcmsException {
updateFavoriteInfo();
}
@Override
public void updateArchiveList() throws NetworkDisconnectedException, AcmsException {
SharedPreferences pref = getSharedPreferences(ABookCommConstants.TAG, MODE_PRIVATE);
String updateDate = pref.getString(ABookCommConstants.KEY.ARCHIVE_UPDATED_DATE, DEFAULT_CHECKSUM);
ArchiveListJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).getArchives(sid, updateDate);
communicationLogic.updateArchives(resultJson.archiveList);
if (StringUtil.isNullOrEmpty(resultJson.archiveLastUpdateDate)) { return; }
SharedPreferences.Editor editor = pref.edit();
editor.putString(ABookCommConstants.KEY.ARCHIVE_UPDATED_DATE, resultJson.archiveLastUpdateDate);
editor.commit();
}
@Override
public void updateArchiveDetail(String archiveId) throws NetworkDisconnectedException, AcmsException {
ArchiveDto archiveDto = communicationLogic.getArchive(Integer.parseInt(archiveId));
RoomJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).getRoom(sid, archiveDto.roomId.toString());
archiveDto.roomName = resultJson.chatRoomDto.chatRoomName;
communicationLogic.updateArchiveDetial(archiveDto);
}
@Override
public void joinCollaboration(String collaborationType, String meetingId) throws NetworkDisconnectedException, AcmsException {
joinMeetingId = Integer.parseInt(meetingId);
collaborationJoinFlg = ABookCommConstants.FLAG.COLLABORATION_JOIN_FLG.JOIN;
AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).joinCollaboration(sid, roomId.intValue());
moveCollaborationScreen(Integer.parseInt(collaborationType));
}
@Override
public void joinChangedCollaboration(String collaborationType, String meetingId) throws NetworkDisconnectedException, AcmsException {
joinMeetingId = Integer.parseInt(meetingId);
collaborationJoinFlg = ABookCommConstants.FLAG.COLLABORATION_JOIN_FLG.JOIN;
AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).joinCollaboration(sid, roomId.intValue());
}
@Override
public void inviteCollaboration(String inviteUserIds, String collaborationType) throws NetworkDisconnectedException, AcmsException {
AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).inviteCollaboration(sid, roomId.intValue(), roomName, inviteUserIds, collaborationType);
}
@Override
public void startCollaboration(String collaborationType) {
collaborationJoinFlg = ABookCommConstants.FLAG.COLLABORATION_JOIN_FLG.CREATE;
moveCollaborationScreen(Integer.parseInt(collaborationType));
}
@Override
public void finishCollaboration() throws NetworkDisconnectedException, AcmsException {
AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).finishCollaboration(sid, roomId.intValue());
}
@Override
public void finishAllCollaboration() throws NetworkDisconnectedException, AcmsException {
AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).finishAllCollaboration(sid, roomId.intValue());
}
@Override
public String getCollaborationJoinFlg() {
return collaborationJoinFlg.toString();
}
@Override
public String getCollaborationType() {
return collaborationType;
}
@Override
public String getToMoveGroupId() {
return groupId;
}
@Override
public void setToMoveGroupId(String moveToGroupId) {
groupId = moveToGroupId;
}
@Override
public int createContentView() {
finishBeforeContentListActivity();
PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder();
enterPictureInPictureMode(mPipBuilder.build());
Integer meetingId = null;
meetingManager.close();
try {
connectMeetingServer();
List<MeetingDto> meetingList= meetingManager.getMeetingList(mSkey);
for (MeetingDto meeting : meetingList) {
if (meeting.title.equals("Collaboration__" + roomId) && meetingManager.isOwner()) {
meetingManager.deleteMeeting(meeting.meetingId, mSkey);
}
}
meetingId = meetingManager.createMeeting(mSkey, "Collaboration_" + roomId, roomId.toString());
meetingManager.join(meetingId, mSkey, roomId.toString(), true);
meetingManager.setCollaboration(true);
} catch (Exception e) {
mChatWebView.loadUrl("javascript:alert('" + getString(R.string.msg_error_connection_error_meeting_room) + "');");
}
startContentListActivity(true);
return meetingId.intValue();
}
@Override
public void startContentView() throws InterruptedException {
finishBeforeContentListActivity();
PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder();
enterPictureInPictureMode(mPipBuilder.build());
meetingManager.close();
try {
connectMeetingServer();
List<MeetingDto> meetingList= meetingManager.getMeetingList(mSkey);
meetingManager.join(joinMeetingId, mSkey, roomId.toString(), false);
meetingManager.setCollaboration(true);
} catch (Exception e) {
mChatWebView.loadUrl("javascript:alert('" + getString(R.string.msg_error_connection_error_meeting_room) + "');");
}
startContentListActivity(false);
}
@Override
public void joinMeetingRoom(int newMeetingId) throws InterruptedException {
finishBeforeContentListActivity();
PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder();
enterPictureInPictureMode(mPipBuilder.build());
meetingManager.close();
try {
connectMeetingServer();
List<MeetingDto> meetingList= meetingManager.getMeetingList(mSkey);
meetingManager.join(joinMeetingId, mSkey, roomId.toString(), false);
meetingManager.setCollaboration(true);
} catch (Exception e) {
mChatWebView.loadUrl("javascript:alert('" + getString(R.string.msg_error_connection_error_meeting_room) + "');");
}
startContentListActivity(false);
}
@Override
public void startPipMode() {
PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder();
enterPictureInPictureMode(mPipBuilder.build());
}
@Override
public void exitPIPmode() {
finishPIPmode();
}
@Override
public void exitMeetingRoom() {
exitAndDeleteMeetingRoom();
finishPIPmode();
}
@Override
public int getJoinCollaborationType() {
return mCollaborationType;
}
@Override
public void setJoinCollaborationType(int collaborationType) {
mCollaborationType = collaborationType;
}
@Override
public void changeCollaboration(int changeCollaborationType, int meetingId) throws NetworkDisconnectedException, AcmsException {
AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).changeCollaboration(sid, roomId.intValue(), changeCollaborationType, meetingId);
}
@Override
public void setHostRequestFlg(int hostRequestFlg) {
mHostRequestFlg = hostRequestFlg;
}
@Override
public int getHostRequestFlg() {
return mHostRequestFlg;
}
@Override
public void finishPip() {
finishPIPmode();
}
@Override
public void setExitHostAlert() {
needHostAlert = true;
}
@Override
public boolean getExitHostAlert() {
if (needHostAlert) {
needHostAlert = false;
return true;
}
return needHostAlert;
}
@Override
public void updatePreMessage(String messageId) throws NetworkDisconnectedException, AcmsException {
if (messageId.equals("0")) {
return;
}
updateMessageFromMessageId(messageId);
}
@Override
public String getMessageListFromMessageId(String messageId) {
if (messageId.equals("0")) {
return "";
}
String messageListStr = communicationLogic.getMessagesFromMessageId(roomId.intValue(), messageId);
return messageListStr;
}
} }
package jp.agentec.abook.abv.ui.home.view; package jp.agentec.abook.abv.ui.home.view;
import android.app.PictureInPictureParams;
import android.content.Context; import android.content.Context;
import android.content.SharedPreferences;
import android.os.Build; import android.os.Build;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
...@@ -11,42 +9,24 @@ import android.webkit.WebSettings; ...@@ -11,42 +9,24 @@ import android.webkit.WebSettings;
import android.webkit.WebView; import android.webkit.WebView;
import java.io.File; import java.io.File;
import java.util.List;
import java.util.Map; import java.util.Map;
import jp.agentec.abook.abv.bl.acms.client.AcmsClient;
import jp.agentec.abook.abv.bl.acms.client.json.ArchiveListJSON;
import jp.agentec.abook.abv.bl.acms.client.json.ChangeRoomNameJSON;
import jp.agentec.abook.abv.bl.acms.client.json.CreatedRoomJSON;
import jp.agentec.abook.abv.bl.acms.client.json.MessageInfoListJSON;
import jp.agentec.abook.abv.bl.acms.client.json.RoomJSON;
import jp.agentec.abook.abv.bl.acms.client.json.RoomListJSON;
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.constant.ABookCommConstants; import jp.agentec.abook.abv.bl.common.constant.ABookCommConstants;
import jp.agentec.abook.abv.bl.common.exception.AcmsException; import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException; import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException;
import jp.agentec.abook.abv.bl.common.log.Logger; import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.dto.ArchiveDto;
import jp.agentec.abook.abv.bl.dto.ChatMessageDto;
import jp.agentec.abook.abv.bl.dto.ChatRoomDto;
import jp.agentec.abook.abv.bl.dto.MeetingDto;
import jp.agentec.abook.abv.bl.logic.CommunicationLogic; import jp.agentec.abook.abv.bl.logic.CommunicationLogic;
import jp.agentec.abook.abv.cl.util.PreferenceUtil; import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.home.activity.ChatWebViewActivity; import jp.agentec.abook.abv.ui.Interface.ChatRoomEventListener;
import jp.agentec.abook.abv.ui.home.activity.OperationRelatedContentActivity; import jp.agentec.abook.abv.ui.home.activity.OperationRelatedContentActivity;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper; import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.adf.util.StringUtil;
import static android.content.Context.MODE_PRIVATE;
import static jp.agentec.abook.abv.bl.common.constant.ABookCommConstants.DEFAULT_CHECKSUM;
public class ChatWebView extends WebView { public class ChatWebView extends WebView {
private Context context; private Context context;
private CommunicationLogic communicationLogic; private CommunicationLogic communicationLogic;
private ChatWebViewActivity activity; private ChatRoomEventListener listener = null;
public ChatWebView(Context context) { public ChatWebView(Context context) {
super(context); super(context);
...@@ -81,14 +61,8 @@ public class ChatWebView extends WebView { ...@@ -81,14 +61,8 @@ public class ChatWebView extends WebView {
this.communicationLogic = communicationLogic; this.communicationLogic = communicationLogic;
} }
public void setChatWebViewActivity(ChatWebViewActivity activity) {
this.activity = activity;
}
@JavascriptInterface @JavascriptInterface
public void saveVisitRoomInfo(String roomId, String roomName) { public void saveVisitRoomInfo(String roomId, String roomName) {
System.out.println("roomName : " + roomName);
System.out.println("roomId : " + roomId);
// 最後のチャットのルーム名 // 最後のチャットのルーム名
PreferenceUtil.putUserPref(context, AppDefType.UserPrefKey.CHAT_LAST_ROOMNAME, roomName); PreferenceUtil.putUserPref(context, AppDefType.UserPrefKey.CHAT_LAST_ROOMNAME, roomName);
// 最後のチャットのルーム // 最後のチャットのルーム
...@@ -96,30 +70,39 @@ public class ChatWebView extends WebView { ...@@ -96,30 +70,39 @@ public class ChatWebView extends WebView {
} }
@JavascriptInterface @JavascriptInterface
public void getLoginParameter() { public void getLoginParameter() {
if (listener == null) {
return;
}
post(new Runnable() { post(new Runnable() {
@Override @Override
public void run() { public void run() {
activity.getLogin(); listener.getLogin();
} }
}); });
} }
@JavascriptInterface @JavascriptInterface
public void getGlobalParameter() { public void getGlobalParameter() {
if (listener == null) {
return;
}
post(new Runnable() { post(new Runnable() {
@Override @Override
public void run() { public void run() {
activity.getQueryParam(); listener.getQueryParam();
} }
}); });
} }
@JavascriptInterface @JavascriptInterface
public void goHome() { public void goHome() {
if (listener == null) {
return;
}
post(new Runnable() { post(new Runnable() {
@Override @Override
public void run() { public void run() {
activity.backToHome(); listener.backToHome();
} }
}); });
...@@ -127,17 +110,23 @@ public class ChatWebView extends WebView { ...@@ -127,17 +110,23 @@ public class ChatWebView extends WebView {
@JavascriptInterface @JavascriptInterface
public void openOperationRelatedContent() { public void openOperationRelatedContent() {
if (listener == null) {
return;
}
post(new Runnable() { post(new Runnable() {
@Override @Override
public void run() { public void run() {
activity.showCommonContent(); listener.showCommonContent();
} }
}); });
} }
@JavascriptInterface @JavascriptInterface
public void openCommunication() { public void openCommunication() {
activity.showCommunicationMenuDialog(); if (listener == null) {
return;
}
listener.showCommunicationChatMenuDialog();
} }
@JavascriptInterface @JavascriptInterface
...@@ -150,6 +139,7 @@ public class ChatWebView extends WebView { ...@@ -150,6 +139,7 @@ public class ChatWebView extends WebView {
}); });
} }
@Override
@JavascriptInterface @JavascriptInterface
public void reload() { public void reload() {
post(new Runnable() { post(new Runnable() {
...@@ -163,14 +153,18 @@ public class ChatWebView extends WebView { ...@@ -163,14 +153,18 @@ public class ChatWebView extends WebView {
@JavascriptInterface @JavascriptInterface
public void saveSelectedUserList(String userIdList) { public void saveSelectedUserList(String userIdList) {
Log.d("userIdList " , userIdList ); Log.d("userIdList " , userIdList );
activity.selectedUserIdList = userIdList; if (listener == null) {
return;
}
listener.setSelectedUserIdList(userIdList);
} }
@JavascriptInterface @JavascriptInterface
public String getSelectedUserList() { public String getSelectedUserList() {
String userList = communicationLogic.getUserList(activity.selectedUserIdList); if (listener == null) {
Log.d("getSelectedUserList " , userList ); return null;
return userList; }
return listener.getSelectedUserList();
} }
@JavascriptInterface @JavascriptInterface
...@@ -183,157 +177,104 @@ public class ChatWebView extends WebView { ...@@ -183,157 +177,104 @@ public class ChatWebView extends WebView {
public void test() { public void test() {
OperationRelatedContentActivity testact = ActivityHandlingHelper.getInstance().getActivity(OperationRelatedContentActivity.class); OperationRelatedContentActivity testact = ActivityHandlingHelper.getInstance().getActivity(OperationRelatedContentActivity.class);
testact.finish(); testact.finish();
/*testact.System.runFinalization();
System.exit(0);*/
} }
@JavascriptInterface @JavascriptInterface
public void updateRoomList() throws NetworkDisconnectedException, AcmsException { public void updateRoomList() throws NetworkDisconnectedException, AcmsException {
Map<String, Object> chatRoomList; Map<String, Object> chatRoomList;
RoomListJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).getRoomList(activity.sid); if (listener == null) {
communicationLogic.insertChatRoomList(resultJson.roomList); return;
}
listener.updateRoomList();
} }
@JavascriptInterface @JavascriptInterface
public void updateMyInfo() throws NetworkDisconnectedException, AcmsException { public void updateMyInfo() throws NetworkDisconnectedException, AcmsException {
activity.updateMyInfoFromServer(); if (listener == null) {
return;
}
listener.updateMyInfo();
} }
@JavascriptInterface @JavascriptInterface
public void updateGroupUser() throws NetworkDisconnectedException, AcmsException { public void updateGroupUser() throws NetworkDisconnectedException, AcmsException {
activity.updateGroupInfoFromServer(); if (listener == null) {
return;
}
listener.updateGroupUser();
} }
@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 {
CreatedRoomJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).createRoom(activity.sid, roomType, userIdList, encodedRoomName, activity.loginId); if (listener == null) {
if (ABookCommConstants.FLAG.SCREEN_FLG.MAKE_ROOM.equals(Integer.parseInt(screenFlg))) {
final ChatRoomDto chatRoomDto = communicationLogic.getChatRoom(resultJson.chatRoomDto.chatRoomId);
if (chatRoomDto != null) {
post(new Runnable() {
@Override
public void run() {
loadUrl(String.format("javascript:CHAT_UI.displayExistRoom('%s');", chatRoomDto.chatRoomId.toString()));
}
});
return; return;
} }
} listener.createChatRoom(roomType, userIdList, encodedRoomName, screenFlg, isVoice);
communicationLogic.insertChatRoom(resultJson.chatRoomDto);
communicationLogic.addUserInRoom(StringUtil.join(",", userIdList, activity.shopMemberId.toString()), resultJson.chatRoomDto.chatRoomId);
final Integer chatRoomId = resultJson.chatRoomDto.chatRoomId;
final String chatRoomName = resultJson.chatRoomDto.chatRoomName;
if (isVoice) {
activity.roomId = chatRoomId.longValue();
activity.roomName = chatRoomName;
post(new Runnable() {
@Override
public void run() {
loadUrl(String.format("javascript:CHAT_UI.startCollaboration('%s');", ABookCommConstants.FLAG.COLLABORATION_TYPE.AUDIO));
}
});
} else {
post(new Runnable() {
@Override
public void run() {
loadUrl(String.format("javascript:CHAT_UI.joinRoom('%s', '%s');", chatRoomId, chatRoomName));
}
});
}
} }
@JavascriptInterface @JavascriptInterface
public void changeRoomName(String changeRoomName) throws NetworkDisconnectedException, AcmsException { public void changeRoomName(String changeRoomName) throws NetworkDisconnectedException, AcmsException {
ChangeRoomNameJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).changeRoomName(activity.sid, changeRoomName, activity.roomId.intValue()); if (listener == null) {
if (resultJson.status != 200) { return; } return;
}
communicationLogic.updateChatRoomName(changeRoomName, activity.roomId.intValue()); listener.changeRoomName(changeRoomName);
joinRoom(activity.roomId.toString(), changeRoomName);
} }
@JavascriptInterface @JavascriptInterface
public void joinRoom(String joinRoomId, String joinRoomName) { public void joinRoom(String joinRoomId, String joinRoomName) {
ChatRoomDto chatRoom = communicationLogic.getChatRoom(Integer.parseInt(joinRoomId)); if (listener == null) {
activity.roomId = chatRoom.chatRoomId.longValue(); return;
activity.roomName = chatRoom.chatRoomName;
activity.roomType = chatRoom.type.toString();
activity.beforeRoomType = chatRoom.type.toString();
communicationLogic.roomDisplayOff(activity.roomId.intValue(), ABookCommConstants.FLAG.ROOM_VIEW_FLAG.VISIBLE);
post(new Runnable() {
@Override
public void run() {
loadUrl(ABookCommConstants.CHAT_ROOM_PAGE_URL);
} }
}); listener.joinRoom(joinRoomId, joinRoomName);
} }
@JavascriptInterface @JavascriptInterface
public void roomDisplayOff() { public void roomDisplayOff() {
communicationLogic.roomDisplayOff(activity.roomId.intValue(), ABookCommConstants.FLAG.ROOM_VIEW_FLAG.INVISIBLE); if (listener == null) {
post(new Runnable() { return;
@Override
public void run() {
loadUrl(ABookCommConstants.CHAT_PAGE_URL);
} }
}); listener.roomDisplayOff();
} }
@JavascriptInterface @JavascriptInterface
public void inviteUsers(String userIds, boolean isCollaboration) throws NetworkDisconnectedException, AcmsException { public void inviteUsers(String userIds, boolean isCollaboration) throws NetworkDisconnectedException, AcmsException {
final UserInviteResultJSON result = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).inviteUsers(activity.sid, activity.roomId.intValue(), activity.roomName, userIds); if (listener == null) {
if (result.roomId == null) { return;
communicationLogic.addUserInRoom(userIds, activity.roomId.intValue());
if (!isCollaboration) {
post(new Runnable() {
@Override
public void run() {
loadUrl(ABookCommConstants.CHAT_ROOM_PAGE_URL);
}
});
}
} else {
post(new Runnable() {
@Override
public void run() {
loadUrl(String.format("javascript:CHAT_UI.displayExistRoom('%s');", result.roomId.toString()));
}
});
} }
listener.inviteUsers(userIds,isCollaboration);
} }
@JavascriptInterface @JavascriptInterface
public String getRoomType() { public String getRoomType() {
return activity.roomType; if (listener == null) {
return null;
}
return listener.getRoomType();
} }
@JavascriptInterface @JavascriptInterface
public String getBeforeRoomType() { public String getBeforeRoomType() {
return activity.beforeRoomType; if (listener == null) {
return null;
}
return listener.getBeforeRoomType();
} }
@JavascriptInterface @JavascriptInterface
public void clearBeforeRoomType() { public void clearBeforeRoomType() {
activity.beforeRoomType = null; if (listener == null) {
return;
}
listener.clearBeforeRoomType();
} }
@JavascriptInterface @JavascriptInterface
public void updateMessages(String roomId) throws NetworkDisconnectedException, AcmsException { public void updateMessages(String roomId) throws NetworkDisconnectedException, AcmsException {
SharedPreferences pref = context.getSharedPreferences(ABookCommConstants.TAG, MODE_PRIVATE); if (listener == null) {
String lastUpdatedDate = pref.getString(ABookCommConstants.KEY.MESSAGE_UPDATED_DATE + roomId, DEFAULT_CHECKSUM); return;
MessageInfoListJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).getMessages(activity.sid, roomId, null, lastUpdatedDate);
for (ChatMessageDto chatMessageDto : resultJson.chatMessageDtoArrayList) {
chatMessageDto.chatRoomId = Integer.parseInt(roomId);
} }
communicationLogic.insertMessageList(resultJson.chatMessageDtoArrayList); listener.updateMessages(roomId);
communicationLogic.insertShopMember(resultJson.shopMemberDtoArrayList);
activity.updateUnreadCount();
SharedPreferences.Editor editor = pref.edit();
editor.putString(ABookCommConstants.KEY.MESSAGE_UPDATED_DATE + roomId, resultJson.updateDate);
editor.commit();
} }
@JavascriptInterface @JavascriptInterface
...@@ -344,8 +285,10 @@ public class ChatWebView extends WebView { ...@@ -344,8 +285,10 @@ public class ChatWebView extends WebView {
@JavascriptInterface @JavascriptInterface
public String searchMessages(String keyword, String userList) { public String searchMessages(String keyword, String userList) {
String messageListStr = communicationLogic.searMessages(activity.roomId.intValue(), keyword, userList); if (listener == null) {
return messageListStr; return null;
}
return listener.searchMessages(keyword, userList);
} }
@JavascriptInterface @JavascriptInterface
...@@ -356,8 +299,10 @@ public class ChatWebView extends WebView { ...@@ -356,8 +299,10 @@ public class ChatWebView extends WebView {
@JavascriptInterface @JavascriptInterface
public String getFavoriteUsersNotInRoom() { public String getFavoriteUsersNotInRoom() {
String favoriteUsersStr = communicationLogic.getFavoriteUsersNotInRoom(activity.roomId.intValue()); if (listener == null) {
return favoriteUsersStr; return null;
}
return listener.getFavoriteUsersNotInRoom();
} }
@JavascriptInterface @JavascriptInterface
...@@ -380,8 +325,10 @@ public class ChatWebView extends WebView { ...@@ -380,8 +325,10 @@ public class ChatWebView extends WebView {
@JavascriptInterface @JavascriptInterface
public String getMyGroupUsersNotInRoom() { public String getMyGroupUsersNotInRoom() {
String myGroupUsersStr = communicationLogic.getMyGroupUsersNotInRoom(activity.roomId.intValue()); if (listener == null) {
return myGroupUsersStr; return null;
}
return listener.getMyGroupUsersNotInRoom();
} }
@JavascriptInterface @JavascriptInterface
...@@ -392,8 +339,10 @@ public class ChatWebView extends WebView { ...@@ -392,8 +339,10 @@ public class ChatWebView extends WebView {
@JavascriptInterface @JavascriptInterface
public String getMyGroupShopMemberNotInRoomByName(String keywords) { public String getMyGroupShopMemberNotInRoomByName(String keywords) {
String searchUserStr = communicationLogic.getMyGroupUserNotInRoomByName(keywords, activity.roomId.intValue()); if (listener == null) {
return searchUserStr; return null;
}
return listener.getMyGroupShopMemberNotInRoomByName(keywords);
} }
@JavascriptInterface @JavascriptInterface
...@@ -404,8 +353,10 @@ public class ChatWebView extends WebView { ...@@ -404,8 +353,10 @@ public class ChatWebView extends WebView {
@JavascriptInterface @JavascriptInterface
public String getAllGroupShopMemberNotInRoomByName(String keywords) { public String getAllGroupShopMemberNotInRoomByName(String keywords) {
String searchUserStr = communicationLogic.getAllGroupShopMemberNotInRoomByName(keywords, activity.roomId.intValue()); if (listener == null) {
return searchUserStr; return null;
}
return listener.getAllGroupShopMemberNotInRoomByName(keywords);
} }
@JavascriptInterface @JavascriptInterface
...@@ -421,7 +372,10 @@ public class ChatWebView extends WebView { ...@@ -421,7 +372,10 @@ public class ChatWebView extends WebView {
} }
@JavascriptInterface @JavascriptInterface
public void updateUserInfo(String shopMemberId) throws NetworkDisconnectedException, AcmsException { public void updateUserInfo(String shopMemberId) throws NetworkDisconnectedException, AcmsException {
activity.updateUserInfoFromServer(shopMemberId); if (listener == null) {
return ;
}
listener.updateUserInfo(shopMemberId);
} }
@JavascriptInterface @JavascriptInterface
...@@ -432,8 +386,10 @@ public class ChatWebView extends WebView { ...@@ -432,8 +386,10 @@ public class ChatWebView extends WebView {
@JavascriptInterface @JavascriptInterface
public String getGroupInfoForAddUser(String groupId) { public String getGroupInfoForAddUser(String groupId) {
String groupInfoStr = communicationLogic.getGroupSearchDataForAddUser(Integer.parseInt(groupId), activity.roomId.intValue()); if (listener == null) {
return groupInfoStr; return null;
}
return listener.getGroupInfoForAddUser(groupId);
} }
@JavascriptInterface @JavascriptInterface
...@@ -450,145 +406,50 @@ public class ChatWebView extends WebView { ...@@ -450,145 +406,50 @@ public class ChatWebView extends WebView {
@JavascriptInterface @JavascriptInterface
public boolean addFavoriteUser(String shopMemberId) throws AcmsException { public boolean addFavoriteUser(String shopMemberId) throws AcmsException {
Integer favoriteCount = communicationLogic.getFavoriteCount(); if (listener == null) {
if (favoriteCount >= ABookCommConstants.SIZE.MAX_FAVORITE_COUNT ) {
post(new Runnable() {
@Override
public void run() {
loadUrl("javascript:alert('" + "お気に入りは最大100件までです。" + "');");
}
});
return false; return false;
} else {
boolean result = false;
try {
result = activity.insertFavoriteUser(shopMemberId);
if (!result) { return false; }
post(new Runnable() {
@Override
public void run() {
loadUrl("javascript:CHAT_UI.refreshContactScreen();");
}
});
return true;
} catch (NetworkDisconnectedException e) {
post(new Runnable() {
@Override
public void run() {
loadUrl("javascript:alert('接続しているネットワークがありません。');");
}
});
} }
} return listener.addFavoriteUser(shopMemberId);
return false;
} }
@JavascriptInterface @JavascriptInterface
public boolean removeFavoriteUser(String shopMemberId) throws AcmsException { public boolean removeFavoriteUser(String shopMemberId) throws AcmsException {
try { if (listener == null) {
boolean result = activity.deleteFavoriteUser(shopMemberId);
if (!result) {
return false; return false;
} }
post(new Runnable() { return listener.removeFavoriteUser(shopMemberId);
@Override
public void run() {
loadUrl("javascript:CHAT_UI.refreshContactScreen();");
}
});
return true;
} catch (NetworkDisconnectedException e) {
post(new Runnable() {
@Override
public void run() {
loadUrl("javascript:alert('接続しているネットワークがありません。');");
}
});
}
return false;
} }
@JavascriptInterface @JavascriptInterface
public boolean addFavoriteGroup(String groupId) throws AcmsException { public boolean addFavoriteGroup(String groupId) throws AcmsException {
if (listener == null) {
Integer favoriteCount = communicationLogic.getFavoriteCount();
if (favoriteCount >= ABookCommConstants.SIZE.MAX_FAVORITE_COUNT) {
post(new Runnable() {
@Override
public void run() {
loadUrl("javascript:alert('" + "お気に入りは最大100件までです。" + "');");
}
});
return false; return false;
} else {
boolean result = false;
try {
result = activity.insertFavoriteGroup(groupId);
if (!result) {
return false;
}
post(new Runnable() {
@Override
public void run() {
loadUrl("javascript:CHAT_UI.refreshContactScreen();");
}
});
return true;
} catch (NetworkDisconnectedException e) {
post(new Runnable() {
@Override
public void run() {
loadUrl("javascript:alert('接続しているネットワークがありません。');");
}
});
} }
} return listener.addFavoriteGroup(groupId);
return false;
} }
@JavascriptInterface @JavascriptInterface
public boolean removeFavoriteGroup(String groupId) throws AcmsException { public boolean removeFavoriteGroup(String groupId) throws AcmsException {
boolean result = false; if (listener == null) {
try {
result = activity.deleteFavoriteGroup(groupId);
if (!result) {
return false; return false;
} }
return listener.removeFavoriteGroup(groupId);
post(new Runnable() {
@Override
public void run() {
loadUrl("javascript:CHAT_UI.refreshContactScreen();");
}
});
return true;
} catch (NetworkDisconnectedException e) {
post(new Runnable() {
@Override
public void run() {
loadUrl("javascript:alert('接続しているネットワークがありません。');");
}
});
}
return false;
} }
@JavascriptInterface @JavascriptInterface
public void updateFavorite() throws NetworkDisconnectedException, AcmsException { public void updateFavorite() throws NetworkDisconnectedException, AcmsException {
activity.updateFavoriteInfo(); if (listener == null) {
return;
}
listener.updateFavorite();
} }
@JavascriptInterface @JavascriptInterface
public void updateArchiveList() throws NetworkDisconnectedException, AcmsException { public void updateArchiveList() throws NetworkDisconnectedException, AcmsException {
SharedPreferences pref = context.getSharedPreferences(ABookCommConstants.TAG, MODE_PRIVATE); if (listener == null) {
String updateDate = pref.getString(ABookCommConstants.KEY.ARCHIVE_UPDATED_DATE, DEFAULT_CHECKSUM); return;
ArchiveListJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).getArchives(activity.sid, updateDate); }
communicationLogic.updateArchives(resultJson.archiveList); listener.updateArchiveList();
if (StringUtil.isNullOrEmpty(resultJson.archiveLastUpdateDate)) { return; }
SharedPreferences.Editor editor = pref.edit();
editor.putString(ABookCommConstants.KEY.ARCHIVE_UPDATED_DATE, resultJson.archiveLastUpdateDate);
editor.commit();
} }
@JavascriptInterface @JavascriptInterface
...@@ -624,66 +485,87 @@ public class ChatWebView extends WebView { ...@@ -624,66 +485,87 @@ public class ChatWebView extends WebView {
@JavascriptInterface @JavascriptInterface
public void updateArchiveDetail(String archiveId) throws NetworkDisconnectedException, AcmsException { public void updateArchiveDetail(String archiveId) throws NetworkDisconnectedException, AcmsException {
ArchiveDto archiveDto = communicationLogic.getArchive(Integer.parseInt(archiveId)); if (listener == null) {
RoomJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).getRoom(activity.sid, archiveDto.roomId.toString()); return;
archiveDto.roomName = resultJson.chatRoomDto.chatRoomName; }
communicationLogic.updateArchiveDetial(archiveDto); listener.updateArchiveDetail(archiveId);
} }
@JavascriptInterface @JavascriptInterface
public void joinCollaboration(String collaborationType, String meetingId) throws NetworkDisconnectedException, AcmsException { public void joinCollaboration(String collaborationType, String meetingId) throws NetworkDisconnectedException, AcmsException {
activity.joinMeetingId = Integer.parseInt(meetingId); if (listener == null) {
activity.collaborationJoinFlg = ABookCommConstants.FLAG.COLLABORATION_JOIN_FLG.JOIN; return;
AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).joinCollaboration(activity.sid, activity.roomId.intValue()); }
activity.moveCollaborationScreen(Integer.parseInt(collaborationType)); listener.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 {
activity.joinMeetingId = Integer.parseInt(meetingId); if (listener == null) {
activity.collaborationJoinFlg = ABookCommConstants.FLAG.COLLABORATION_JOIN_FLG.JOIN; return;
AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).joinCollaboration(activity.sid, activity.roomId.intValue()); }
listener.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 {
AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).inviteCollaboration(activity.sid, activity.roomId.intValue(), activity.roomName, inviteUserIds, collaborationType); if (listener == null) {
return;
}
listener.inviteCollaboration(inviteUserIds, collaborationType);
} }
@JavascriptInterface @JavascriptInterface
public void startCollaboration(String collaborationType) { public void startCollaboration(String collaborationType) {
activity.collaborationJoinFlg = ABookCommConstants.FLAG.COLLABORATION_JOIN_FLG.CREATE; if (listener == null) {
activity.moveCollaborationScreen(Integer.parseInt(collaborationType)); return;
}
listener.startCollaboration(collaborationType);
} }
@JavascriptInterface @JavascriptInterface
public void finishCollaboration() throws NetworkDisconnectedException, AcmsException { public void finishCollaboration() throws NetworkDisconnectedException, AcmsException {
AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).finishCollaboration(activity.sid, activity.roomId.intValue()); if (listener == null) {
return;
}
listener.finishCollaboration();
} }
@JavascriptInterface @JavascriptInterface
public void finishAllCollaboration() throws NetworkDisconnectedException, AcmsException { public void finishAllCollaboration() throws NetworkDisconnectedException, AcmsException {
AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).finishAllCollaboration(activity.sid, activity.roomId.intValue()); if (listener == null) {
return;
}
listener.finishAllCollaboration();
} }
@JavascriptInterface @JavascriptInterface
public String getCollaborationJoinFlg() { public String getCollaborationJoinFlg() {
return activity.collaborationJoinFlg.toString(); if (listener == null) {
return null;
}
return listener.getCollaborationJoinFlg();
} }
@JavascriptInterface @JavascriptInterface
public String getCollaborationType() { public String getCollaborationType() {
return activity.collaborationType; if (listener == null) {
return null;
}
return listener.getCollaborationType();
} }
@JavascriptInterface @JavascriptInterface
public String getToMoveGroupId() { public String getToMoveGroupId() {
return activity.groupId; if (listener == null) {
return null;
}
return listener.getToMoveGroupId();
} }
@JavascriptInterface @JavascriptInterface
public void setToMoveGroupId(String moveToGroupId) { public void setToMoveGroupId(String moveToGroupId) {
activity.groupId = moveToGroupId; listener.setToMoveGroupId(moveToGroupId);
} }
@JavascriptInterface @JavascriptInterface
...@@ -699,93 +581,74 @@ public class ChatWebView extends WebView { ...@@ -699,93 +581,74 @@ public class ChatWebView extends WebView {
@JavascriptInterface @JavascriptInterface
public int createContentView() { public int createContentView() {
activity.finishBeforeContentListActivity(); if (listener == null) {
PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder(); return 0;
activity.enterPictureInPictureMode(mPipBuilder.build());
Integer meetingId = null;
activity.meetingManager.close();
try {
activity.connectMeetingServer();
List<MeetingDto> meetingList= activity.meetingManager.getMeetingList(activity.mSkey);
for (MeetingDto meeting : meetingList) {
if (meeting.title.equals("Collaboration__" + activity.roomId) && activity.meetingManager.isOwner()) {
activity.meetingManager.deleteMeeting(meeting.meetingId, activity.mSkey);
}
} }
meetingId = activity.meetingManager.createMeeting(activity.mSkey, "Collaboration_" + activity.roomId, activity.roomId.toString()); return listener.createContentView();
activity.meetingManager.join(meetingId, activity.mSkey, activity.roomId.toString(), true);
activity.meetingManager.setCollaboration(true);
} catch (Exception e) {
loadUrl("javascript:alert('" + "会議室サーバに接続できませんでした。" + "');");
}
activity.startContentListActivity(true);
return meetingId.intValue();
} }
@JavascriptInterface @JavascriptInterface
public void startContentView() throws InterruptedException { public void startContentView() throws InterruptedException {
activity.finishBeforeContentListActivity(); if (listener == null) {
PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder(); return;
activity.enterPictureInPictureMode(mPipBuilder.build());
activity.meetingManager.close();
try {
activity.connectMeetingServer();
List<MeetingDto> meetingList= activity.meetingManager.getMeetingList(activity.mSkey);
activity.meetingManager.join(activity.joinMeetingId, activity.mSkey, activity.roomId.toString(), false);
activity.meetingManager.setCollaboration(true);
} catch (Exception e) {
loadUrl("javascript:alert('" + "会議室サーバに接続できませんでした。" + "');");
} }
activity.startContentListActivity(false); listener.startContentView();
} }
@JavascriptInterface @JavascriptInterface
public void joinMeetingRoom(int newMeetingId) throws InterruptedException { public void joinMeetingRoom(int newMeetingId) throws InterruptedException {
activity.finishBeforeContentListActivity(); if (listener == null) {
PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder(); return;
activity.enterPictureInPictureMode(mPipBuilder.build());
activity.meetingManager.close();
try {
activity.connectMeetingServer();
List<MeetingDto> meetingList= activity.meetingManager.getMeetingList(activity.mSkey);
activity.meetingManager.join(activity.joinMeetingId, activity.mSkey, activity.roomId.toString(), false);
activity.meetingManager.setCollaboration(true);
} catch (Exception e) {
loadUrl("javascript:alert('" + "会議室サーバに接続できませんでした。" + "');");
} }
activity.startContentListActivity(false); listener.joinMeetingRoom(newMeetingId);
} }
@JavascriptInterface @JavascriptInterface
public void startPipMode() { public void startPipMode() {
PictureInPictureParams.Builder mPipBuilder = new PictureInPictureParams.Builder(); if (listener == null) {
activity.enterPictureInPictureMode(mPipBuilder.build()); return;
}
listener.startPipMode();
} }
@JavascriptInterface @JavascriptInterface
public void exitPIPmode() { public void exitPIPmode() {
activity.finishPIPmode(); if (listener == null) {
return;
}
listener.exitPIPmode();
} }
@JavascriptInterface @JavascriptInterface
public void exitMeetingRoom() { public void exitMeetingRoom() {
activity.exitAndDeleteMeetingRoom(); if (listener == null) {
activity.finishPIPmode(); return;
}
listener.exitMeetingRoom();
} }
@JavascriptInterface @JavascriptInterface
public int getJoinCollaborationType() { public int getJoinCollaborationType() {
return activity.mCollaborationType; if (listener == null) {
return 0;
}
return listener.getJoinCollaborationType();
} }
@JavascriptInterface @JavascriptInterface
public void setJoinCollaborationType(int collaborationType) { public void setJoinCollaborationType(int collaborationType) {
activity.mCollaborationType = collaborationType; if (listener == null) {
return;
}
listener.setJoinCollaborationType(collaborationType);
} }
@JavascriptInterface @JavascriptInterface
public void changeCollaboration(int changeCollaborationType, int meetingId) throws NetworkDisconnectedException, AcmsException { public void changeCollaboration(int changeCollaborationType, int meetingId) throws NetworkDisconnectedException, AcmsException {
AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).changeCollaboration(activity.sid, activity.roomId.intValue(), changeCollaborationType, meetingId); if (listener == null) {
return;
}
listener.changeCollaboration(changeCollaborationType, meetingId);
} }
@JavascriptInterface @JavascriptInterface
...@@ -803,47 +666,74 @@ public class ChatWebView extends WebView { ...@@ -803,47 +666,74 @@ public class ChatWebView extends WebView {
@JavascriptInterface @JavascriptInterface
public void setHostRequestFlg(int hostRequestFlg) { public void setHostRequestFlg(int hostRequestFlg) {
activity.mHostRequestFlg = hostRequestFlg; if (listener == null) {
return;
}
listener.setHostRequestFlg(hostRequestFlg);
} }
@JavascriptInterface @JavascriptInterface
public int getHostRequestFlg() { public int getHostRequestFlg() {
return activity.mHostRequestFlg; if (listener == null) {
return 0;
}
return listener.getHostRequestFlg();
} }
@JavascriptInterface @JavascriptInterface
public void finishPip() { public void finishPip() {
activity.finishPIPmode(); if (listener == null) {
return;
}
listener.finishPip();
} }
@JavascriptInterface @JavascriptInterface
public void setExitHostAlert() { public void setExitHostAlert() {
activity.needHostAlert = true; if (listener == null) {
return;
}
listener.setExitHostAlert();
} }
@JavascriptInterface @JavascriptInterface
public boolean getExitHostAlert() { public boolean getExitHostAlert() {
if (activity.needHostAlert) { if (listener == null) {
activity.needHostAlert = false; return false;
return true;
} }
return activity.needHostAlert; return listener.getExitHostAlert();
} }
@JavascriptInterface @JavascriptInterface
public void updatePreMessage(String messageId) throws NetworkDisconnectedException, AcmsException { public void updatePreMessage(String messageId) throws NetworkDisconnectedException, AcmsException {
if (messageId.equals("0")) { if (listener == null) {
return; return;
} }
activity.updateMessageFromMessageId(messageId); listener.updatePreMessage(messageId);
} }
@JavascriptInterface @JavascriptInterface
public String getMessageListFromMessageId(String messageId) { public String getMessageListFromMessageId(String messageId) {
if (messageId.equals("0")) { if (listener == null) {
return ""; return null;
} }
String messageListStr = communicationLogic.getMessagesFromMessageId(activity.roomId.intValue(), messageId); return listener.getMessageListFromMessageId(messageId);
return messageListStr; }
public void setChatRoomEventListener(ChatRoomEventListener listener) {
this.listener = listener;
}
public void removeChatRoomEventListener() {
this.listener = null;
}
public void loadChatViewUrl(final String urlString) {
post(new Runnable() {
@Override
public void run() {
loadUrl(urlString);
}
});
} }
} }
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