Commit 9534665c by Kim Peace

Merge branch 'communication/develop_43526_onuma' into 'communication/develop'

JavaScriptのインタフェース名変更に対応した。

See merge request !186
parents 357051a0 702306a7
......@@ -93,6 +93,16 @@ public interface ABookCommConstants {
String FILE = "file";
String COLLABORATION = "collaboration";
}
String SHOP_NAME = "shopName";
String LANGUAGE_CODE = "languageCode";
String SID = "sid";
String ROOM_ID_UPPERCASE_D = "roomID";
String CHAT_URL = "chatURL";
String CMS_URL = "cmsURL";
String IS_ONLINE = "isOnline";
String IS_MOBILE = "isMobile";
String PLATFORM = "platform";
String COLLABORATION_TYPE = "collaborationType";
}
interface FLAG {
......@@ -150,4 +160,12 @@ public interface ABookCommConstants {
}
String FILE_SAVE_PATH = "/data/user/0/jp.co.agentec.abookplus.check/files/";
String NETWORK_ERROR_PLACE_HOLDER = "file:///android_asset/chat/public_new/chat.html";
String CHAT_PAGE_URL = "file:///android_asset/chat/public_new/chat.html";
String CHAT_ROOM_PAGE_URL = "file:///android_asset/chat/public_new/chat_room.html";
String COLLABORATION_PAGE_URL = "file:///android_asset/chat/public_new/collaboration.html";
String DEFAULT_CHECKSUM = "0000000000";
String PLATFORM_NAME = "android";
}
......@@ -68,9 +68,9 @@ public class ChatGroupDao extends AbstractCommunicationDao {
sql.append(" ELSE mygroup.group_name ");
sql.append(" END AS group_path_list ");
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 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(" 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(" 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);
}
......@@ -82,11 +82,11 @@ public class ChatGroupDao extends AbstractCommunicationDao {
sql.append(" ELSE usergroup.group_name ");
sql.append(" END AS group_path, usergroup.group_id ");
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 grandparentgroup on parentgroup.parent_group_id = grandparentgroup.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(" WHERE usergroup.group_id IN ");
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 ");
sql.append(" WHERE sm.shop_member_id = ? ) ");
return rawQueryGetDtoList(sql.toString(), new String[] { "" + shopMemberId}, ChatGroupDto.class);
}
......@@ -156,11 +156,11 @@ public class ChatGroupDao extends AbstractCommunicationDao {
}
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() {
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) {
......@@ -187,10 +187,10 @@ public class ChatGroupDao extends AbstractCommunicationDao {
StringBuffer sql = new StringBuffer();
sql.append(" WITH group_loop AS ");
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(" 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(" SELECT * FROM group_loop ORDER BY group_loop.rownum DESC ");
......@@ -200,24 +200,24 @@ public class ChatGroupDao extends AbstractCommunicationDao {
public List<ChatGroupDto> getGroupChildList(int parentId) {
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;
}
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) {
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) {
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() {
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) {
......@@ -277,13 +277,13 @@ public class ChatGroupDao extends AbstractCommunicationDao {
public void deleteGroupList(List<ChatGroupDto> groupList) {
StringBuffer sql = new StringBuffer();
sql.append(" delete from m_chat_group ");
sql.append(" DELETE FROM m_chat_group ");
sql.append(" WHERE group_id = ? ");
try {
beginTransaction();
for (ChatGroupDto groupDto : groupList) {
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();
} catch (Exception e) {
......@@ -292,6 +292,4 @@ public class ChatGroupDao extends AbstractCommunicationDao {
throw new RuntimeException(e);
}
}
}
......@@ -187,7 +187,7 @@ public class ChatMessageDao extends AbstractCommunicationDao {
}
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) {
......@@ -205,15 +205,15 @@ public class ChatMessageDao extends AbstractCommunicationDao {
}
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;
}
public void updatUnreadCount(List<ChatMessageDto> messageDtoList, String roomId) {
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) {
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();
}
......
......@@ -2,16 +2,12 @@ package jp.agentec.abook.abv.bl.data.dao;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import jp.agentec.abook.abv.bl.common.db.Cursor;
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.adf.util.CollectionUtil;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.StringUtil;
......@@ -58,22 +54,22 @@ public class ShopMemberDao extends AbstractCommunicationDao {
}
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;
}
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) {
try {
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) {
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) {
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();
......@@ -89,10 +85,10 @@ public class ShopMemberDao extends AbstractCommunicationDao {
try {
beginTransaction();
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; }
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();
......@@ -107,9 +103,9 @@ public class ShopMemberDao extends AbstractCommunicationDao {
public void insertShopMemberGroupRelation(Integer groupId, List<ShopMemberDto> dtoList) {
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) {
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) {
rollback();
......@@ -120,11 +116,11 @@ public class ShopMemberDao extends AbstractCommunicationDao {
}
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() {
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) {
......@@ -196,7 +192,7 @@ public class ShopMemberDao extends AbstractCommunicationDao {
}
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) {
......@@ -257,7 +253,7 @@ public class ShopMemberDao extends AbstractCommunicationDao {
sql.append(" m_shop_member AS sm ");
sql.append(" INNER JOIN r_shop_member_group AS rsmg ");
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 ");
ArrayList<String> whereSqlList = new ArrayList<String>();
for (String keyword : keywords) {
......@@ -286,7 +282,7 @@ public class ShopMemberDao extends AbstractCommunicationDao {
sql.append(" m_shop_member AS sm ");
sql.append(" INNER JOIN r_shop_member_group AS rsmg ");
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.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>();
......@@ -389,12 +385,12 @@ public class ShopMemberDao extends AbstractCommunicationDao {
}
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;
}
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;
}
......@@ -402,9 +398,9 @@ public class ShopMemberDao extends AbstractCommunicationDao {
try {
beginTransaction();
for (ShopMemberDto dto : dtoList) {
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 m_shop_member 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 m_shop_member WHERE shop_member_id=?", new String[] {"" + dto.shopMemberId});
}
commit();
} catch (Exception e) {
......@@ -417,7 +413,7 @@ public class ShopMemberDao extends AbstractCommunicationDao {
}
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;
}
......@@ -427,7 +423,7 @@ public class ShopMemberDao extends AbstractCommunicationDao {
ShopMemberDto favoriteUserDto= new ShopMemberDto();
favoriteUserDto.shopMemberId = shopMemberId;
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();
}
......
......@@ -10,11 +10,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
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.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.AbstractDao;
import jp.agentec.abook.abv.bl.data.dao.ArchiveDao;
......@@ -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.ShopMemberDao;
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.ChatRoomDto;
import jp.agentec.abook.abv.bl.dto.ChatGroupDto;
import jp.agentec.abook.abv.bl.dto.ContentDto;
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.StringUtil;
......@@ -40,14 +35,14 @@ import jp.agentec.adf.util.StringUtil;
public class CommunicationLogic extends AbstractLogic {
private static final String TAG = "CommunicationLogic";
private ChatRoomDao chatRoomDao = AbstractCommunicationDao.getDao(ChatRoomDao.class);
private ChatMessageDao chatMessageDao = AbstractCommunicationDao.getDao(ChatMessageDao.class);
private ShopMemberDao shopMemberDao = AbstractCommunicationDao.getDao(ShopMemberDao.class);
private ChatGroupDao chatGroupDao = AbstractCommunicationDao.getDao(ChatGroupDao.class);
private ContentDao contentDao = AbstractDao.getDao(ContentDao.class);
private final ChatRoomDao chatRoomDao = AbstractCommunicationDao.getDao(ChatRoomDao.class);
private final ChatMessageDao chatMessageDao = AbstractCommunicationDao.getDao(ChatMessageDao.class);
private final ShopMemberDao shopMemberDao = AbstractCommunicationDao.getDao(ShopMemberDao.class);
private final ChatGroupDao chatGroupDao = AbstractCommunicationDao.getDao(ChatGroupDao.class);
private final ContentDao contentDao = AbstractDao.getDao(ContentDao.class);
private String localFilePath;
private ArchiveDao archiveDao = AbstractCommunicationDao.getDao(ArchiveDao.class);
private final ArchiveDao archiveDao = AbstractCommunicationDao.getDao(ArchiveDao.class);
/**
* {@link CommunicationLogic} クラスのインスタンスを初期化します。
......@@ -100,8 +95,7 @@ public class CommunicationLogic extends AbstractLogic {
JSONObject jsonObject = new JSONObject(chatRoomMap);
resultJsonArray.put(jsonObject);
}
String roomListToStr = resultJsonArray.toString();
return roomListToStr;
return resultJsonArray.toString();
}
public String getUsersInRoom(Integer roomId) {
......@@ -115,8 +109,7 @@ public class CommunicationLogic extends AbstractLogic {
JSONObject jsonObject = new JSONObject(userMap);
attendUsers.put(jsonObject);
}
String attendUsersStr = attendUsers.toString();
return attendUsersStr;
return attendUsers.toString();
}
public String getMessages(Integer roomId) {
......@@ -142,8 +135,7 @@ public class CommunicationLogic extends AbstractLogic {
JSONObject jsonObject = new JSONObject(chatMessageMap);
resultJsonArray.put(jsonObject);
}
String messageListStr = resultJsonArray.toString();
return messageListStr;
return resultJsonArray.toString();
}
public String getMessagesFromMessageId(Integer roomId, String messageId) {
......@@ -170,8 +162,7 @@ public class CommunicationLogic extends AbstractLogic {
JSONObject jsonObject = new JSONObject(chatMessageMap);
resultJsonArray.put(jsonObject);
}
String messageListStr = resultJsonArray.toString();
return messageListStr;
return resultJsonArray.toString();
}
public String searMessages(Integer roomId, String keyword, String userList) {
......@@ -197,8 +188,7 @@ public class CommunicationLogic extends AbstractLogic {
JSONObject jsonObject = new JSONObject(chatMessageMap);
resultJsonArray.put(jsonObject);
}
String messageListStr = resultJsonArray.toString();
return messageListStr;
return resultJsonArray.toString();
}
public String getNameCardInfo(Integer shopMemberId) {
......@@ -223,7 +213,7 @@ public class CommunicationLogic extends AbstractLogic {
resultJson.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, shopMemberDto.shopMemberName);
resultJson.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(shopMemberDto.profileUrl));
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);
return resultJson.toString();
......@@ -237,8 +227,7 @@ public class CommunicationLogic extends AbstractLogic {
myInfoJson.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, myInfo.shopMemberName);
myInfoJson.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(myInfo.profileUrl));
myInfoJson.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupPathList);
String myInfoStr = myInfoJson.toString();
return myInfoStr;
return myInfoJson.toString();
}
public String getUserListByLoginId(String loginIdList) {
......@@ -259,8 +248,7 @@ public class CommunicationLogic extends AbstractLogic {
joinedMemberArray.put(myInfoJson);
}
String myInfoStr = joinedMemberArray.toString();
return myInfoStr;
return joinedMemberArray.toString();
}
public String getMyGroupUsers() {
......@@ -279,19 +267,14 @@ public class CommunicationLogic extends AbstractLogic {
myGroupUserMap.put(ABookCommConstants.KEY.CHECKED, "");
myGroupUserMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(groupUser.profileUrl));
myGroupUserMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupUser);
if (StringUtil.isNullOrEmpty(groupUser.favoriteRegisterDate)) {
myGroupUserMap.put(ABookCommConstants.KEY.IS_FAVORITE, false);
} else {
myGroupUserMap.put(ABookCommConstants.KEY.IS_FAVORITE, true);
}
myGroupUserMap.put(ABookCommConstants.KEY.IS_FAVORITE, !StringUtil.isNullOrEmpty(groupUser.favoriteRegisterDate));
JSONObject jsonObject = new JSONObject(myGroupUserMap);
groupUserArray.put(jsonObject);
}
groupUserJson.put(ABookCommConstants.KEY.GROUP_USER_LIST, groupUserArray);
myGroupUsersJson.put(groupUserJson);
}
String myInfoStr = myGroupUsersJson.toString();
return myInfoStr;
return myGroupUsersJson.toString();
}
public String getMyGroupUsersNotInRoom(Integer roomId) {
......@@ -310,19 +293,14 @@ public class CommunicationLogic extends AbstractLogic {
myGroupUserMap.put(ABookCommConstants.KEY.CHECKED, "");
myGroupUserMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(groupUser.profileUrl));
myGroupUserMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupUser);
if (StringUtil.isNullOrEmpty(groupUser.favoriteRegisterDate)) {
myGroupUserMap.put(ABookCommConstants.KEY.IS_FAVORITE, false);
} else {
myGroupUserMap.put(ABookCommConstants.KEY.IS_FAVORITE, true);
}
myGroupUserMap.put(ABookCommConstants.KEY.IS_FAVORITE, !StringUtil.isNullOrEmpty(groupUser.favoriteRegisterDate));
JSONObject jsonObject = new JSONObject(myGroupUserMap);
groupUserArray.put(jsonObject);
}
groupUserJson.put(ABookCommConstants.KEY.GROUP_USER_LIST, groupUserArray);
myGroupUsersJson.put(groupUserJson);
}
String myInfoStr = myGroupUsersJson.toString();
return myInfoStr;
return myGroupUsersJson.toString();
}
public String getMyGroupUserByName(String keyword) {
......@@ -346,17 +324,12 @@ public class CommunicationLogic extends AbstractLogic {
userMap.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, shopMember.shopMemberName);
userMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(shopMember.profileUrl));
userMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupPathArray);
if (StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate)) {
userMap.put(ABookCommConstants.KEY.IS_FAVORITE, false);
} else {
userMap.put(ABookCommConstants.KEY.IS_FAVORITE, true);
}
userMap.put(ABookCommConstants.KEY.IS_FAVORITE, !StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate));
JSONObject jsonObject = new JSONObject(userMap);
resultJsonArray.put(jsonObject);
}
String searchUserStr = resultJsonArray.toString();
return searchUserStr;
return resultJsonArray.toString();
}
public String getMyGroupUserNotInRoomByName(String keywords, Integer roomId) {
......@@ -380,17 +353,12 @@ public class CommunicationLogic extends AbstractLogic {
userMap.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, shopMember.shopMemberName);
userMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(shopMember.profileUrl));
userMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupPathArray);
if (StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate)) {
userMap.put(ABookCommConstants.KEY.IS_FAVORITE, false);
} else {
userMap.put(ABookCommConstants.KEY.IS_FAVORITE, true);
}
userMap.put(ABookCommConstants.KEY.IS_FAVORITE, !StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate));
JSONObject jsonObject = new JSONObject(userMap);
resultJsonArray.put(jsonObject);
}
String searchUserStr = resultJsonArray.toString();
return searchUserStr;
return resultJsonArray.toString();
}
public String getAllGroupShopMemberByName(String keyword) {
......@@ -413,17 +381,12 @@ public class CommunicationLogic extends AbstractLogic {
userMap.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, shopMember.shopMemberName);
userMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(shopMember.profileUrl));
userMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupPathArray);
if (StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate)) {
userMap.put(ABookCommConstants.KEY.IS_FAVORITE, false);
} else {
userMap.put(ABookCommConstants.KEY.IS_FAVORITE, true);
}
userMap.put(ABookCommConstants.KEY.IS_FAVORITE, !StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate));
JSONObject jsonObject = new JSONObject(userMap);
resultJsonArray.put(jsonObject);
}
String searchUserStr = resultJsonArray.toString();
return searchUserStr;
return resultJsonArray.toString();
}
public String getAllGroupShopMemberNotInRoomByName(String keywords, Integer roomId) {
......@@ -448,17 +411,12 @@ public class CommunicationLogic extends AbstractLogic {
userMap.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, shopMember.shopMemberName);
userMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(shopMember.profileUrl));
userMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupPathArray);
if (StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate)) {
userMap.put(ABookCommConstants.KEY.IS_FAVORITE, false);
} else {
userMap.put(ABookCommConstants.KEY.IS_FAVORITE, true);
}
userMap.put(ABookCommConstants.KEY.IS_FAVORITE, !StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate));
JSONObject jsonObject = new JSONObject(userMap);
resultJsonArray.put(jsonObject);
}
String searchUserStr = resultJsonArray.toString();
return searchUserStr;
return resultJsonArray.toString();
}
public String getGroupByName(String keyword) {
......@@ -470,29 +428,24 @@ public class CommunicationLogic extends AbstractLogic {
Map<String, Object> groupMap = new HashMap<String, Object>();
groupMap.put(ABookCommConstants.KEY.GROUP_NAME, group.groupName);
groupMap.put(ABookCommConstants.KEY.GROUP_ID, group.groupId);
if (StringUtil.isNullOrEmpty(group.favoriteRegisterDate)) {
groupMap.put(ABookCommConstants.KEY.IS_FAVORITE, false);
} else {
groupMap.put(ABookCommConstants.KEY.IS_FAVORITE, true);
}
groupMap.put(ABookCommConstants.KEY.IS_FAVORITE, !StringUtil.isNullOrEmpty(group.favoriteRegisterDate));
JSONObject jsonObject = new JSONObject(groupMap);
resultJsonArray.put(jsonObject);
}
String groupsStr = resultJsonArray.toString();
return groupsStr;
return resultJsonArray.toString();
}
public String getMyGroupIds() {
List<ChatGroupDto> myGroupList = chatGroupDao.getMyGroups();
String groupIds = "";
StringBuilder groupIds = new StringBuilder();
for (ChatGroupDto myGroup : myGroupList) {
if (!groupIds.equals("")) {
groupIds = groupIds + ",";
if (!groupIds.toString().equals("")) {
groupIds.append(",");
}
groupIds = groupIds + myGroup.groupId;
groupIds.append(myGroup.groupId);
}
return groupIds;
return groupIds.toString();
}
public List<ChatGroupDto> getAllGroup() {
......@@ -528,8 +481,7 @@ public class CommunicationLogic extends AbstractLogic {
resultJsonArray.put(jsonObject);
}
String favoriteUsersStr = resultJsonArray.toString();
return favoriteUsersStr;
return resultJsonArray.toString();
}
public String getFavoriteUsersNotInRoom(Integer roomId) {
......@@ -558,8 +510,7 @@ public class CommunicationLogic extends AbstractLogic {
resultJsonArray.put(jsonObject);
}
String favoriteUsersStr = resultJsonArray.toString();
return favoriteUsersStr;
return resultJsonArray.toString();
}
public String getFavoriteGroups() {
......@@ -576,8 +527,7 @@ public class CommunicationLogic extends AbstractLogic {
resultJsonArray.put(jsonObject);
}
String favoriteGroupsStr = resultJsonArray.toString();
return favoriteGroupsStr;
return resultJsonArray.toString();
}
public Integer getFavoriteCount() {
......@@ -628,11 +578,7 @@ public class CommunicationLogic extends AbstractLogic {
Map<String, Object> groupTreeMap = new HashMap<String, Object>();
groupTreeMap.put(ABookCommConstants.KEY.GROUP_NAME, group.groupName);
groupTreeMap.put(ABookCommConstants.KEY.GROUP_ID, group.groupId);
if (StringUtil.isNullOrEmpty(group.favoriteRegisterDate)) {
groupTreeMap.put(ABookCommConstants.KEY.IS_FAVORITE, false);
} else {
groupTreeMap.put(ABookCommConstants.KEY.IS_FAVORITE, true);
}
groupTreeMap.put(ABookCommConstants.KEY.IS_FAVORITE, !StringUtil.isNullOrEmpty(group.favoriteRegisterDate));
JSONObject jsonObject = new JSONObject(groupTreeMap);
childGroupJSONArray.put(jsonObject);
}
......@@ -648,18 +594,13 @@ public class CommunicationLogic extends AbstractLogic {
shopMemberMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(shopMember.profileUrl));
shopMemberMap.put(ABookCommConstants.KEY.CHECKED, "");
shopMemberMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, chatGroupDao.getUserGroupPathList(shopMember.shopMemberId));
if (StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate)) {
shopMemberMap.put(ABookCommConstants.KEY.IS_FAVORITE, false);
} else {
shopMemberMap.put(ABookCommConstants.KEY.IS_FAVORITE, true);
}
shopMemberMap.put(ABookCommConstants.KEY.IS_FAVORITE, !StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate));
JSONObject jsonObject = new JSONObject(shopMemberMap);
shopMemberJSONArray.put(jsonObject);
}
groupSearchData.put(ABookCommConstants.KEY.GROUP_USER_LIST,shopMemberJSONArray);
String groupSearchDataStr = groupSearchData.toString();
return groupSearchDataStr;
return groupSearchData.toString();
}
public String getGroupSearchDataForAddUser(Integer groupId, Integer roomId) {
......@@ -671,12 +612,7 @@ public class CommunicationLogic extends AbstractLogic {
ChatGroupDto myGroup = chatGroupDao.getMyGroups().get(0);
ChatGroupDto rootGroup = chatGroupDao.getRootGroup();
Integer targetGroupId;
if (groupId == 0) {
targetGroupId = rootGroup.groupId;
} else {
targetGroupId = groupId;
}
Integer targetGroupId = groupId == 0 ? rootGroup.groupId : groupId;
ChatGroupDto parentGroup = chatGroupDao.getParentGroup(targetGroupId);
if (parentGroup != null) {
......@@ -704,11 +640,7 @@ public class CommunicationLogic extends AbstractLogic {
Map<String, Object> groupTreeMap = new HashMap<String, Object>();
groupTreeMap.put(ABookCommConstants.KEY.GROUP_NAME, group.groupName);
groupTreeMap.put(ABookCommConstants.KEY.GROUP_ID, group.groupId);
if (StringUtil.isNullOrEmpty(group.favoriteRegisterDate)) {
groupTreeMap.put(ABookCommConstants.KEY.IS_FAVORITE, false);
} else {
groupTreeMap.put(ABookCommConstants.KEY.IS_FAVORITE, true);
}
groupTreeMap.put(ABookCommConstants.KEY.IS_FAVORITE, !StringUtil.isNullOrEmpty(group.favoriteRegisterDate));
JSONObject jsonObject = new JSONObject(groupTreeMap);
childGroupJSONArray.put(jsonObject);
}
......@@ -724,18 +656,13 @@ public class CommunicationLogic extends AbstractLogic {
shopMemberMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(shopMember.profileUrl));
shopMemberMap.put(ABookCommConstants.KEY.CHECKED, "");
shopMemberMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, chatGroupDao.getUserGroupPathList(shopMember.shopMemberId));
if (StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate)) {
shopMemberMap.put(ABookCommConstants.KEY.IS_FAVORITE, false);
} else {
shopMemberMap.put(ABookCommConstants.KEY.IS_FAVORITE, true);
}
shopMemberMap.put(ABookCommConstants.KEY.IS_FAVORITE, !StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate));
JSONObject jsonObject = new JSONObject(shopMemberMap);
shopMemberJSONArray.put(jsonObject);
}
groupSearchData.put(ABookCommConstants.KEY.GROUP_USER_LIST,shopMemberJSONArray);
String groupSearchDataStr = groupSearchData.toString();
return groupSearchDataStr;
return groupSearchData.toString();
}
public void insertChatRoomList(List<ChatRoomDto> roomList) {
......@@ -766,10 +693,6 @@ public class CommunicationLogic extends AbstractLogic {
chatRoomDao.insertChatRoomUsers(userIdList, roomId);
}
public void insertChatMessage(ChatMessageDto chatMessageDto) {
chatMessageDao.insertChatMessage(chatMessageDto);
}
public void updateChatRoomName(String roomName, Integer roomId) {
chatRoomDao.updateChatRoomName(roomName, roomId);
}
......@@ -789,22 +712,16 @@ public class CommunicationLogic extends AbstractLogic {
ShopMemberDto myInfo = shopMemberDao.getMyInfo();
List<ShopMemberDto> insertList = new ArrayList<ShopMemberDto>();
List<ShopMemberDto> deleteList = new ArrayList<ShopMemberDto>();
for (ShopMemberDto shopMemberDto : shopMemberDtoList) {
//if (ABookCommConstants.FLAG.DEL_FLAG.EXIST.equals(shopMemberDto.delFlg)) {
if (myInfo.shopMemberId.equals(shopMemberDto.shopMemberId)) {
shopMemberDto.selfFlg = 1;
} else {
shopMemberDto.selfFlg = 0;
}
insertList.add(shopMemberDto);
//} else {
// deleteList.add(shopMemberDto);
//}
}
shopMemberDao.insertShopMember(insertList);
//shopMemberDao.deleteShopMemberByList(deleteList);
}
......@@ -884,12 +801,7 @@ public class CommunicationLogic extends AbstractLogic {
}
public ShopMemberDto getMyShopMemberDto() {
ShopMemberDto myInfo = shopMemberDao.getMyInfo();
return myInfo;
}
public void deleteChatRoomList() {
chatRoomDao.deleteChatRoom();
return shopMemberDao.getMyInfo();
}
public void insertMyInfo(ShopMemberDto shopMemberDto) {
......@@ -940,13 +852,6 @@ public class CommunicationLogic extends AbstractLogic {
archiveDao.deleteArchiveAllData();
}
public void initChatData() {
chatGroupDao.deleteChatGroup();
chatMessageDao.deleteChatMessage();
shopMemberDao.deleteShopMember();
archiveDao.deleteArchiveAllData();
}
public void roomDisplayOff(Integer roomId, Integer viewFlg) {
chatRoomDao.changeRoomViewFlg(roomId, viewFlg);
}
......@@ -963,7 +868,7 @@ public class CommunicationLogic extends AbstractLogic {
attendUsers.put(jsonObject);
}
return attendUsers.toString();
};
}
public String getProfileUrlPath(String profileUrl) {
if (profileUrl == null) {
......@@ -974,12 +879,11 @@ public class CommunicationLogic extends AbstractLogic {
String filePath = localFilePath + fileName;
File file = new File(filePath);
if (file.exists()) {
String uri = file.toURI().toString();
return uri;
return file.toURI().toString();
} else {
return profileUrl;
}
};
}
public String getFileUrlPath(String fileUrlPath) {
if (!fileUrlPath.contains("fileName=")) {
......@@ -999,7 +903,7 @@ public class CommunicationLogic extends AbstractLogic {
} else {
return fileUrlPath;
}
};
}
public void setPackagePath(String localFilePath) {
this.localFilePath = localFilePath;
......@@ -1097,21 +1001,6 @@ public class CommunicationLogic extends AbstractLogic {
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) {
Map<Integer, ChatGroupDto> map = new HashMap<Integer, ChatGroupDto>();
for (ChatGroupDto group : groupList) {
......
......@@ -1490,9 +1490,11 @@
<string name="msg_destroy_exist_collaboration">進行中の協業が存在します。既存協業を終了し、新しい協業を開始してもよろしいですか</string>
<string name="not_found_camera">利用可能なカメラを見つかりませんでした。</string>
<string name="error_fail_record">レコーディングに失敗しました。管理者にお問い合わせしてください。</string>
<!-- 連続作業 -->
<string name="msg_error_all_process_delete">全削除の送信に失敗しました。</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>
......@@ -1498,4 +1498,8 @@
<string name="not_found_camera">사용 가능한 카메라 기기를 찾을수 없습니다.</string>
<string name="msg_destroy_exist_collaboration">진행중인 협업이 존재합니다. 기존 협업을 종료하고 새로운 협업을 시작 하시겠습니까?</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>
\ No newline at end of file
......@@ -1495,4 +1495,8 @@
<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="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>
......@@ -6,49 +6,14 @@
android:layout_height="match_parent"
android:background="@color/background" >
<!--
<RelativeLayout
android:id="@+id/toolbar_layout"
style="@style/OperationSearchToolBar"
android:layout_height="50dp"
android:layout_width="match_parent">
<TextView
android:id="@+id/title"
style="@style/DialogToolBarTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="@string/chat"
android:textColor="@color/edt_text"
android:textSize="18sp" />
<ImageButton
android:id="@+id/chat_close_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|right"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/ic_operation_close"/>
</RelativeLayout>
-->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="vertical" >
<WebView
android:id="@+id/chatWebview2"
<jp.agentec.abook.abv.ui.home.view.ChatWebView
android:id="@+id/chatWebview"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>
</LinearLayout>
\ No newline at end of file
package jp.agentec.abook.abv.data;
import android.content.Context;
import android.content.SharedPreferences;
import org.json.adf.JSONObject;
import java.util.ArrayList;
import java.util.List;
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.GetFavoriteGroupJSON;
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.MessageInfoListJSON;
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.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.constant.ABookCommConstants;
import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException;
import jp.agentec.abook.abv.bl.data.ABVDataCache;
import jp.agentec.abook.abv.bl.dto.ArchiveDto;
import jp.agentec.abook.abv.bl.dto.ChatMessageDto;
import jp.agentec.abook.abv.bl.dto.ChatRoomDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.CommunicationLogic;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.adf.util.CollectionUtil;
import jp.agentec.adf.util.StringUtil;
public class ChatData {
private Context context;
public String sid;
public String roomName;
public String loginId;
public String shopName;
public Integer shopMemberId;
private boolean isOnline;
public String groupId;
public Long roomId;
public String roomType;
private String strCollaborationType;
private String beforeRoomType;
public Integer joinMeetingId;
private boolean isMobile;
private Integer collaborationJoinFlg = 0;
private String languageCode;
// サーバー情報
private String chatServerUrl;
private String cmsServerUrl;
private int mCollaborationType;
private int mHostRequestFlg = 0;
private CommunicationLogic communicationLogic = AbstractLogic.getLogic(CommunicationLogic.class);
private static ChatData instance = null;
// シングルトン
public static synchronized ChatData getInstance() {
if (instance == null) {
instance = new ChatData();
}
return instance;
}
private ChatData() {
}
public void setContext(Context context) {
this.context = context;
}
public void setSid(String sid) {
this.sid = sid;
}
public String getSid() {
return sid;
}
public void setRoomID(Long roomID) {
this.roomId = roomID;
}
public Long getRoomID() {
return roomId;
}
public void setBeforeRoomType(String beforeRoomType) {
this.beforeRoomType = beforeRoomType;
}
public String getBeforeRoomType() {
return beforeRoomType;
}
public void setCollaborationJoinFlg(Integer collaborationJoinFlg) {
this.collaborationJoinFlg = collaborationJoinFlg;
}
public void setStrCollaborationType(String strCollaborationType) {
this.strCollaborationType = strCollaborationType;
}
public void setLanguageCode(String code) {
languageCode = code;
}
public String getLanguageCode() {
return languageCode;
}
public String getChatServerUrl() {
return chatServerUrl;
}
public void setChatServerUrl(String chatServerUrl) {
this.chatServerUrl = chatServerUrl;
}
public String getCmsServerUrl() {
return cmsServerUrl;
}
public void setCmsServerUrl(String cmsServerUrl) {
this.cmsServerUrl = cmsServerUrl;
}
public void setIsOnline(boolean isOnline) {
this.isOnline = isOnline;
}
public boolean getIsOnline() {
return isOnline;
}
public void setIsMobile(boolean isMobile) {
this.isMobile = isMobile;
}
public void updateMyInfoFromServer() throws NetworkDisconnectedException, AcmsException {
MyInfoJSON resultJson = AcmsClient
.getInstance(ABVEnvironment.getInstance().networkAdapter)
.getMyInfo(sid);
if (resultJson.shopMemberDto != null) {
communicationLogic.insertMyInfo(resultJson.shopMemberDto);
}
}
public void updateUserInfoFromServer(String shopMemberId) throws NetworkDisconnectedException, AcmsException {
MyInfoJSON resultJson = AcmsClient
.getInstance(ABVEnvironment.getInstance().networkAdapter)
.getNameCard(sid, shopMemberId);
communicationLogic.insertShopMember(resultJson.shopMemberDto);
}
public boolean insertFavoriteUser(String shopMemberId) throws NetworkDisconnectedException, AcmsException {
boolean result = AcmsClient
.getInstance(ABVEnvironment.getInstance().networkAdapter)
.insertFavoriteUser(sid,Integer.parseInt(shopMemberId));
if (!result) { return false; }
List<Integer> shopMeberIds = new ArrayList<>();
shopMeberIds.add(Integer.parseInt(shopMemberId));
communicationLogic.updateFavoriteUser(shopMeberIds);
return result;
}
public boolean deleteFavoriteUser(String shopMemberId) throws NetworkDisconnectedException, AcmsException {
boolean result = AcmsClient
.getInstance(ABVEnvironment.getInstance().networkAdapter)
.deleteFavoriteUser(sid, Integer.parseInt(shopMemberId));
if (result) {
List<Integer> deleteFavoriteList = new ArrayList<Integer>();
deleteFavoriteList.add(Integer.parseInt(shopMemberId));
communicationLogic.deleteavoriteUser(deleteFavoriteList);
}
return result;
}
public boolean insertFavoriteGroup(String groupId) throws NetworkDisconnectedException, AcmsException {
boolean result = AcmsClient
.getInstance(ABVEnvironment.getInstance().networkAdapter)
.insertFavoriteGroup(sid, Integer.parseInt(groupId));
return result;
}
public void updateUnreadCount() throws NetworkDisconnectedException, AcmsException {
UnreadCountJSON resultJson = AcmsClient
.getInstance(ABVEnvironment.getInstance().networkAdapter)
.getMessagesUnreadCount(sid, Integer.toString(roomId.intValue()));
communicationLogic.updateUnreadCount(resultJson.chatMessageDtoArrayList, Integer.toString(roomId.intValue()));
}
public void updateMessageFromMessageId(String messageId) throws NetworkDisconnectedException, AcmsException {
MessageInfoListJSON resultJson = AcmsClient
.getInstance(ABVEnvironment.getInstance().networkAdapter)
.getMessages(sid, Integer.toString(roomId.intValue()), messageId, null);
for (ChatMessageDto chatMessageDto : resultJson.chatMessageDtoArrayList) {
chatMessageDto.chatRoomId = roomId.intValue();
}
communicationLogic.insertMessageList(resultJson.chatMessageDtoArrayList);
communicationLogic.insertShopMember(resultJson.shopMemberDtoArrayList);
updateUnreadCount();
}
public void updateRoomList() throws NetworkDisconnectedException, AcmsException {
RoomListJSON resultJson = AcmsClient
.getInstance(ABVEnvironment.getInstance().networkAdapter)
.getRoomList(sid);
communicationLogic.insertChatRoomList(resultJson.roomList);
}
/**
*
* @param changeRoomName
* @throws NetworkDisconnectedException
* @throws AcmsException
*/
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());
}
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);
}
public void updateArchiveList() throws NetworkDisconnectedException, AcmsException {
SharedPreferences pref = context.getSharedPreferences(ABookCommConstants.TAG, Context.MODE_PRIVATE);
String updateDate = pref.getString(ABookCommConstants.KEY.ARCHIVE_UPDATED_DATE, ABookCommConstants.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();
}
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);
}
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());
}
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());
}
public void inviteCollaboration(String inviteUserIds, String collaborationType) throws NetworkDisconnectedException, AcmsException {
AcmsClient.
getInstance(ABVEnvironment.getInstance().networkAdapter).
inviteCollaboration(sid, roomId.intValue(), roomName, inviteUserIds, collaborationType);
}
public void finishCollaboration() throws NetworkDisconnectedException, AcmsException {
AcmsClient.
getInstance(ABVEnvironment.getInstance().networkAdapter).
finishCollaboration(sid, roomId.intValue());
}
public void finishAllCollaboration() throws NetworkDisconnectedException, AcmsException {
AcmsClient.
getInstance(ABVEnvironment.getInstance().networkAdapter).
finishAllCollaboration(sid, roomId.intValue());
}
private void updateFavoriteUser() throws NetworkDisconnectedException, AcmsException {
GetFavoriteUserJSON resultJson = AcmsClient
.getInstance(ABVEnvironment.getInstance().networkAdapter)
.getFavoriteUser(sid);
communicationLogic.updateFavoriteUser(resultJson.favoriteUserIds);
}
public void updateFavoriteGroup() throws NetworkDisconnectedException, AcmsException {
GetFavoriteGroupJSON resultJson = AcmsClient
.getInstance(ABVEnvironment.getInstance().networkAdapter)
.getFavoriteGroup(sid);
communicationLogic.updateFavoriteGroup(resultJson.favoriteGroupIds);
}
public void updateAllGroupInfo() throws NetworkDisconnectedException, AcmsException {
updateGroupInfoFromServer();
}
public void updateFavoriteInfo() throws NetworkDisconnectedException, AcmsException {
updateFavoriteUser();
updateFavoriteGroup();
}
public void updateGroupInfoFromServer() throws NetworkDisconnectedException {
SharedPreferences pref = context.getSharedPreferences(ABookCommConstants.TAG, Context.MODE_PRIVATE);
String lastUpdatedDate = pref.getString(ABookCommConstants.KEY.GROUP_MEMBER_UPDATED_DATE, ABookCommConstants.DEFAULT_CHECKSUM);
try {
GroupListJSON resultJson = AcmsClient
.getInstance(ABVEnvironment.getInstance().networkAdapter)
.getGroupInfo(sid, lastUpdatedDate);
if (CollectionUtil.isNotEmpty(resultJson.groupList)) {
communicationLogic.updateGroup(resultJson.groupList);
SharedPreferences.Editor editor = pref.edit();
editor.putString(ABookCommConstants.KEY.GROUP_MEMBER_UPDATED_DATE, resultJson.lastRequestDate);
editor.commit();
}
} catch (AcmsException e) {
e.printStackTrace();
}
}
public void changeCollaboration(int changeCollaborationType, int meetingId) throws NetworkDisconnectedException, AcmsException {
AcmsClient.
getInstance(ABVEnvironment.getInstance().networkAdapter).
changeCollaboration(sid, roomId.intValue(), changeCollaborationType, meetingId);
}
public void updatePreMessage(String messageId) throws NetworkDisconnectedException, AcmsException {
if (messageId.equals("0")) {
return;
}
updateMessageFromMessageId(messageId);
}
public String getMessageListFromMessageId(String messageId) {
if (messageId.equals("0")) {
return "";
}
return communicationLogic.getMessagesFromMessageId(roomId.intValue(), messageId);
}
public String getCollaborationJoinFlg() {
return this.collaborationJoinFlg.toString();
}
public String getStrCollaborationType() {
return strCollaborationType;
}
public String getToMoveGroupId() {
return groupId;
}
public void setToMoveGroupId(String moveToGroupId) {
groupId = moveToGroupId;
}
public void setHostRequestFlg(int hostRequestFlg) {
mHostRequestFlg = hostRequestFlg;
}
public int getHostRequestFlg() {
return mHostRequestFlg;
}
public String getServerInfo() {
chatServerUrl = ABVEnvironment.getInstance().websocketServerHttpUrl;
chatServerUrl= chatServerUrl.substring(0, chatServerUrl.length() - 3);
cmsServerUrl = ABVEnvironment.getInstance().acmsAddress+ ABVDataCache.getInstance().getUrlPath();
JSONObject jsonObj = new JSONObject();
jsonObj.put(ABookCommConstants.KEY.CHAT_URL, chatServerUrl);
jsonObj.put(ABookCommConstants.KEY.CMS_URL, cmsServerUrl);
jsonObj.put(ABookCommConstants.KEY.IS_ONLINE, isOnline);
return jsonObj.toString();
}
public String getMyUserInfo() {
languageCode = ActivityHandlingHelper.getInstance().getLocaleFileName();
JSONObject jsonObj = new JSONObject();
jsonObj.put(ABookCommConstants.KEY.SID, sid);
jsonObj.put(ABookCommConstants.KEY.LOGIN_ID, loginId);
jsonObj.put(ABookCommConstants.KEY.SHOP_NAME, shopName);
jsonObj.put(ABookCommConstants.KEY.SHOP_MEMBER_ID, shopMemberId);
jsonObj.put(ABookCommConstants.KEY.LANGUAGE_CODE, languageCode);
return jsonObj.toString();
}
public String getRoomInfo() {
JSONObject jsonObj = new JSONObject();
jsonObj.put(ABookCommConstants.KEY.ROOM_ID_UPPERCASE_D, roomId);
jsonObj.put(ABookCommConstants.KEY.ROOM_NAME, roomName);
jsonObj.put(ABookCommConstants.KEY.ROOM_TYPE, roomType);
return jsonObj.toString();
}
public String getDeviceInfo() {
JSONObject jsonObj = new JSONObject();
jsonObj.put(ABookCommConstants.KEY.IS_MOBILE, isMobile);
jsonObj.put(ABookCommConstants.KEY.PLATFORM, ABookCommConstants.PLATFORM_NAME);
return jsonObj.toString();
}
public String getMessageList(String roomId) {
return communicationLogic.getMessages(Integer.parseInt(roomId));
}
public String getFavoriteUsers() {
return communicationLogic.getFavoriteUsers();
}
public String getMyInfo() {
return communicationLogic.getMyInfo();
}
public String getUsersInRoom(String roomId) {
return communicationLogic.getUsersInRoom(Integer.parseInt(roomId));
}
public String getMyGroupUsers() {
return communicationLogic.getMyGroupUsers();
}
public String getMyGroupShopMemberByName(String keyword) {
return communicationLogic.getMyGroupUserByName(keyword);
}
public String getAllGroupShopMemberByName(String shopMemberName) {
return communicationLogic.getAllGroupShopMemberByName(shopMemberName);
}
public String getGroupByName(String keyword) {
return communicationLogic.getGroupByName(keyword);
}
public String getFavoriteGroups() {
return communicationLogic.getFavoriteGroups();
}
public String getGroupInfo(String groupId) {
return communicationLogic.getGroupSearchData(Integer.parseInt(groupId));
}
public String getNameCardData(String shopMemberId) {
return communicationLogic.getNameCardInfo(Integer.parseInt(shopMemberId));
}
public String getFavoriteGroupsList() {
return communicationLogic.getFavoriteGroups();
}
public String getArchiveList() {
return communicationLogic.getAllArchive();
}
public String getArchiveListByName(String keyword) {
return communicationLogic.getArchiveListByName(keyword);
}
public String getUserInfo(String shopMemberId) {
return communicationLogic.getUserInfo(Integer.parseInt(shopMemberId));
}
public String getUserInfoList(String shopMemberIds) {
return communicationLogic.getUserList(shopMemberIds);
}
public String getArchiveDetail(String archiveId) {
return communicationLogic.getArchiveDetail(Integer.parseInt(archiveId));
}
public String getContentList() {
return communicationLogic.getContentList();
}
public String getUserListByLoginId(String loginIdList) {
return communicationLogic.getUserListByLoginId(loginIdList);
}
public String getRoomList(String roomType, String keyword) {
return communicationLogic.getChatRoomList(Integer.parseInt(roomType), keyword);
}
public int getJoinCollaborationType() {
return mCollaborationType;
}
public void setJoinCollaborationType(int collaborationType) {
mCollaborationType = collaborationType;
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
package jp.agentec.abook.abv.ui.home.view;
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Build;
import android.view.View;
import android.webkit.JavascriptInterface;
import android.webkit.WebSettings;
import android.webkit.WebView;
import java.io.File;
import jp.agentec.abook.abv.bl.common.constant.ABookCommConstants;
import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.data.ChatData;
import jp.agentec.abook.abv.ui.home.activity.ChatWebViewActivity;
import jp.agentec.abook.abv.ui.home.activity.OperationRelatedContentActivity;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
public class ChatWebView extends WebView {
private final ChatWebViewActivity chatActivity;
private ChatData chatData;
public ChatWebView(Context context) {
super(context);
chatActivity = (ChatWebViewActivity)context;
}
@SuppressLint("SetJavaScriptEnabled")
public void configue(ChatData chatData) {
setOverScrollMode(View.OVER_SCROLL_NEVER); //オーバースクロールしない。
setVerticalScrollBarEnabled(false); //スクロールバーを消す。
addJavascriptInterface(this, "android");
WebSettings settings = getSettings();
settings.setJavaScriptEnabled(true); //Javascriptを有効にする。
settings.setAppCacheEnabled(true);
settings.setCacheMode(WebSettings.LOAD_NO_CACHE);
settings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
settings.setDomStorageEnabled(true);
settings.setDatabaseEnabled(true);
settings.setMediaPlaybackRequiresUserGesture(false);
settings.setAllowFileAccess(true);
settings.setUseWideViewPort(true);
settings.setAllowContentAccess(true);
settings.setAllowFileAccessFromFileURLs(true);
settings.setSaveFormData(false);
settings.setAllowUniversalAccessFromFileURLs(true);
if (Logger.isDebugEnabled()) {
setWebContentsDebuggingEnabled(true); //デバッグモード(chromeからinspect可)
}
this.chatData = chatData;
}
@JavascriptInterface
public void saveVisitRoomInfo(String roomId, String roomName) {
chatActivity.saveVisitRoomInfo(roomId, roomName);
}
@JavascriptInterface
public void goHome() {
post(new Runnable() {
@Override
public void run() {
chatActivity.backToHome();
}
});
}
@JavascriptInterface
public void openOperationRelatedContent() {
post(new Runnable() {
@Override
public void run() {
chatActivity.showCommonContent();
}
});
}
@JavascriptInterface
public void openCommunication() {
chatActivity.showCommunicationChatMenuDialog();
}
@JavascriptInterface
public void openCommunicationHome() {
post(new Runnable() {
@Override
public void run() {
loadUrl(ABookCommConstants.CHAT_PAGE_URL);
}
});
}
@Override
@JavascriptInterface
public void reload() {
post(new Runnable() {
@Override
public void run() {
ActivityHandlingHelper.getInstance().startChatWebViewActivity();
}
});
}
@JavascriptInterface
public void saveSelectedUserList(String userIdList) {
chatActivity.setSelectedUserIdList(userIdList);
}
@JavascriptInterface
public String getSelectedUserList() {
return chatActivity.getSelectedUserList();
}
@JavascriptInterface
public String getRoomList(String roomType, String keyword) {
return chatData.getRoomList(roomType, keyword);
}
@JavascriptInterface
public void test() {
OperationRelatedContentActivity testact = ActivityHandlingHelper
.getInstance()
.getActivity(OperationRelatedContentActivity.class);
testact.finish();
}
@JavascriptInterface
public void updateRoomList() throws NetworkDisconnectedException, AcmsException {
chatData.updateRoomList();
}
@JavascriptInterface
public void updateMyInfo() throws NetworkDisconnectedException, AcmsException {
chatActivity.updateMyInfo();
}
@JavascriptInterface
public void updateGroupUser() throws NetworkDisconnectedException, AcmsException {
chatActivity.updateGroupUser();
}
@JavascriptInterface
public void createChatRoom(
String roomType,
String userIdList,
String encodedRoomName,
String screenFlg,
boolean isVoice)
throws NetworkDisconnectedException, AcmsException
{
chatActivity.createChatRoom(roomType, userIdList, encodedRoomName, screenFlg, isVoice);
}
@JavascriptInterface
public void changeRoomName(String changeRoomName) throws NetworkDisconnectedException, AcmsException {
chatActivity.changeRoomName(changeRoomName);
}
@JavascriptInterface
public void joinRoom(String joinRoomId, String joinRoomName) {
chatActivity.joinRoom(joinRoomId, joinRoomName);
}
@JavascriptInterface
public void roomDisplayOff() {
chatActivity.roomDisplayOff();
}
@JavascriptInterface
public void inviteUsers(String userIds) throws NetworkDisconnectedException, AcmsException {
chatActivity.inviteUsers(userIds);
}
@JavascriptInterface
public String getRoomType() {
return chatActivity.getRoomType();
}
@JavascriptInterface
public String getBeforeRoomType() {
return chatActivity.getBeforeRoomType();
}
@JavascriptInterface
public void clearBeforeRoomType() {
chatActivity.clearBeforeRoomType();
}
@JavascriptInterface
public void updateMessages(String roomId) throws NetworkDisconnectedException, AcmsException {
chatActivity.updateMessages(roomId);
}
@JavascriptInterface
public String getMessageList(String roomId) {
return chatData.getMessageList(roomId);
}
@JavascriptInterface
public String searchMessages(String keyword, String userList) {
return chatActivity.searchMessages(keyword, userList);
}
@JavascriptInterface
public String getFavoriteUsers() {
return chatData.getFavoriteUsers();
}
@JavascriptInterface
public String getFavoriteUsersNotInRoom() {
return chatActivity.getFavoriteUsersNotInRoom();
}
@JavascriptInterface
public String getMyInfo() {
return chatData.getMyInfo();
}
@JavascriptInterface
public String getUsersInRoom(String roomId) {
return chatData.getUsersInRoom(roomId);
}
@JavascriptInterface
public String getMyGroupUsers() {
return chatData.getMyGroupUsers();
}
@JavascriptInterface
public String getMyGroupUsersNotInRoom() {
return chatActivity.getMyGroupUsersNotInRoom();
}
@JavascriptInterface
public String getMyGroupShopMemberByName(String keyword) {
return chatData.getMyGroupShopMemberByName(keyword);
}
@JavascriptInterface
public String getMyGroupShopMemberNotInRoomByName(String keywords) {
return chatActivity.getMyGroupShopMemberNotInRoomByName(keywords);
}
@JavascriptInterface
public String getAllGroupShopMemberByName(String shopMemberName) {
return chatData.getAllGroupShopMemberByName(shopMemberName);
}
@JavascriptInterface
public String getAllGroupShopMemberNotInRoomByName(String keywords) {
return chatActivity.getAllGroupShopMemberNotInRoomByName(keywords);
}
@JavascriptInterface
public String getGroupByName(String keyword) {
return chatData.getGroupByName(keyword);
}
@JavascriptInterface
public String getFavoriteGroups() {
return chatData.getFavoriteGroups();
}
@JavascriptInterface
public void updateUserInfo(String shopMemberId) throws NetworkDisconnectedException, AcmsException {
chatActivity.updateUserInfo(shopMemberId);
}
@JavascriptInterface
public String getGroupInfo(String groupId) {
return chatData.getGroupInfo(groupId);
}
@JavascriptInterface
public String getGroupInfoForAddUser(String groupId) {
return chatActivity.getGroupInfoForAddUser(groupId);
}
@JavascriptInterface
public String getNameCardData(String shopMemberId) {
return chatData.getNameCardData(shopMemberId);
}
@JavascriptInterface
public String getFavoriteGroupsList() {
return chatData.getFavoriteGroupsList();
}
@JavascriptInterface
public boolean addFavoriteUser(String shopMemberId) throws AcmsException {
return chatActivity.addFavoriteUser(shopMemberId);
}
@JavascriptInterface
public boolean removeFavoriteUser(String shopMemberId) throws AcmsException {
return chatActivity.removeFavoriteUser(shopMemberId);
}
@JavascriptInterface
public boolean addFavoriteGroup(String groupId) throws AcmsException {
return chatActivity.addFavoriteGroup(groupId);
}
@JavascriptInterface
public boolean removeFavoriteGroup(String groupId) throws AcmsException {
return chatActivity.removeFavoriteGroup(groupId);
}
@JavascriptInterface
public void updateFavorite() throws NetworkDisconnectedException, AcmsException {
chatActivity.updateFavorite();
}
@JavascriptInterface
public void updateArchiveList() throws NetworkDisconnectedException, AcmsException {
chatData.updateArchiveList();
}
@JavascriptInterface
public String getArchiveList() {
return chatData.getArchiveList();
}
@JavascriptInterface
public String getArchiveListByName(String keyword) {
return chatData.getArchiveListByName(keyword);
}
@JavascriptInterface
public String getUserInfo(String shopMemberId) {
return chatData.getUserInfo(shopMemberId);
}
@JavascriptInterface
public String getUserInfoList(String shopMemberIds) {
return chatData.getUserInfoList(shopMemberIds);
}
@JavascriptInterface
public String getArchiveDetail(String archiveId) {
return chatData.getArchiveDetail(archiveId);
}
@JavascriptInterface
public void updateArchiveDetail(String archiveId) throws NetworkDisconnectedException, AcmsException {
chatData.updateArchiveDetail(archiveId);
}
@JavascriptInterface
public void joinCollaboration(String collaborationType, String meetingId)
throws NetworkDisconnectedException, AcmsException
{
chatActivity.joinCollaboration(collaborationType, meetingId);
}
@JavascriptInterface
public void joinChangedCollaboration(String collaborationType, String meetingId)
throws NetworkDisconnectedException, AcmsException
{
chatData.joinChangedCollaboration(collaborationType, meetingId);
}
@JavascriptInterface
public void inviteCollaboration(String inviteUserIds, String collaborationType)
throws NetworkDisconnectedException, AcmsException
{
chatData.inviteCollaboration(inviteUserIds, collaborationType);
}
@JavascriptInterface
public void startCollaboration(String collaborationType) {
chatActivity.startCollaboration(collaborationType);
}
@JavascriptInterface
public void finishCollaboration() throws NetworkDisconnectedException, AcmsException {
chatData.finishCollaboration();
}
@JavascriptInterface
public void finishAllCollaboration() throws NetworkDisconnectedException, AcmsException {
chatData.finishAllCollaboration();
}
@JavascriptInterface
public String getCollaborationJoinFlg() {
return chatData.getCollaborationJoinFlg();
}
@JavascriptInterface
public String getCollaborationType() {
return chatData.getStrCollaborationType();
}
@JavascriptInterface
public String getToMoveGroupId() {
return chatData.getToMoveGroupId();
}
@JavascriptInterface
public void setToMoveGroupId(String moveToGroupId) {
chatData.setToMoveGroupId(moveToGroupId);
}
@JavascriptInterface
public String getContentList() {
return chatData.getContentList();
}
@JavascriptInterface
public String getUserListByLoginId(String loginIdList) {
return chatData.getUserListByLoginId(loginIdList);
}
@JavascriptInterface
public int createContentView() {
return chatActivity.createContentView();
}
@JavascriptInterface
public void startContentView() throws InterruptedException {
chatActivity.startContentView();
}
@JavascriptInterface
public void joinMeetingRoom(int newMeetingId) throws InterruptedException {
chatActivity.joinMeetingRoom(newMeetingId);
}
@JavascriptInterface
public void startPIPMode() {
chatActivity.startPIPMode();
}
@JavascriptInterface
public void exitPIPmode() {
chatActivity.exitPIPmode();
}
@JavascriptInterface
public void exitMeetingRoom() {
chatActivity.exitMeetingRoom();
}
@JavascriptInterface
public int getJoinCollaborationType() {
return chatData.getJoinCollaborationType();
}
@JavascriptInterface
public void setJoinCollaborationType(int collaborationType) {
chatData.setJoinCollaborationType(collaborationType);
}
@JavascriptInterface
public void changeCollaboration(int changeCollaborationType, int meetingId)
throws NetworkDisconnectedException, AcmsException
{
chatData.changeCollaboration(changeCollaborationType, meetingId);
}
@JavascriptInterface
public int getAndroidVersion() {
return Build.VERSION.SDK_INT;
}
@JavascriptInterface
public void removeEncodedVideo(String filePath) {
File encodedVideo = new File(filePath);
if (encodedVideo.exists()) {
encodedVideo.delete();
}
}
@JavascriptInterface
public void setHostRequestFlg(int hostRequestFlg) {
chatData.setHostRequestFlg(hostRequestFlg);
}
@JavascriptInterface
public int getHostRequestFlg() {
return chatData.getHostRequestFlg();
}
@JavascriptInterface
public void finishPIP() {
chatActivity.finishPIP();
}
@JavascriptInterface
public void setExitHostAlert() {
chatActivity.setExitHostAlert();
}
@JavascriptInterface
public boolean getExitHostAlert() {
return chatActivity.getExitHostAlert();
}
@JavascriptInterface
public void updatePreMessage(String messageId)
throws NetworkDisconnectedException, AcmsException
{
chatData.updatePreMessage(messageId);
}
@JavascriptInterface
public String getMessageListFromMessageId(String messageId) {
return chatData.getMessageListFromMessageId(messageId);
}
@JavascriptInterface
public String getDeviceInfo() {
return chatData.getDeviceInfo();
}
@JavascriptInterface
public String getServerInfo() {
return chatData.getServerInfo();
}
@JavascriptInterface
public String getMyUserInfo() {
return chatData.getMyUserInfo();
}
@JavascriptInterface
public String getRoomInfo() {
return chatData.getRoomInfo();
}
public void loadChatViewUrl(final String urlString) {
post(new Runnable() {
@Override
public void run() {
loadUrl(urlString);
}
});
}
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;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.provider.MediaStore;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.LinearLayout;
......@@ -16,45 +10,11 @@ import android.widget.ProgressBar;
import java.io.File;
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.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.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.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.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 {
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