Commit 9cbda6fd by Lee Munkyeong

Merge branch 'features/1.4.201' of…

Merge branch 'features/1.4.201' of https://gitlab.agentec.jp/abook_android/abook_check into features/1.4.100_develop_mk

# Conflicts:
#	ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVAuthenticatedActivity.java
parents f926f436 47084337
...@@ -48,9 +48,6 @@ public class ChatPushDataJSON extends AcmsCommonJSON { ...@@ -48,9 +48,6 @@ public class ChatPushDataJSON extends AcmsCommonJSON {
} }
PushMessageDto pushMessageDto = new PushMessageDto(); PushMessageDto pushMessageDto = new PushMessageDto();
String tempDate = DateTimeUtil.toString(DateTimeUtil.toDate(pushMessagetJsonArray.getJSONObject(k).getString(PushSendDate), DateTimeFormat.yyyyMMddHHmmss_hyphen), DateTimeFormat.yyyyMMddHHmmssSSS_none); String tempDate = DateTimeUtil.toString(DateTimeUtil.toDate(pushMessagetJsonArray.getJSONObject(k).getString(PushSendDate), DateTimeFormat.yyyyMMddHHmmss_hyphen), DateTimeFormat.yyyyMMddHHmmssSSS_none);
Logger.d("messageId","messageId : " + pushMessagetJsonArray.getJSONObject(k).getString(PushSendDate));
Logger.d("oerationId","oerationId : " + pushMessagetJsonArray.getJSONObject(k).getString(PushSendDate)+1);
Logger.d("date","date : " + tempDate);
pushMessageDto.pushMessageId = Long.valueOf(tempDate); pushMessageDto.pushMessageId = Long.valueOf(tempDate);
pushMessageDto.operationId = Long.valueOf(tempDate+1); pushMessageDto.operationId = Long.valueOf(tempDate+1);
pushMessageDto.pushSendLoginId = pushMessagetJsonArray.getJSONObject(k).getString(PushSendLoginId); pushMessageDto.pushSendLoginId = pushMessagetJsonArray.getJSONObject(k).getString(PushSendLoginId);
......
...@@ -93,6 +93,16 @@ public interface ABookCommConstants { ...@@ -93,6 +93,16 @@ public interface ABookCommConstants {
String FILE = "file"; String FILE = "file";
String COLLABORATION = "collaboration"; 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 { interface FLAG {
...@@ -149,5 +159,60 @@ public interface ABookCommConstants { ...@@ -149,5 +159,60 @@ public interface ABookCommConstants {
Integer MESSAGE_PAGING_SIZE = 100; Integer MESSAGE_PAGING_SIZE = 100;
} }
interface COLLABORATION {
interface INVITE_COLLABORATION {
String EN = "inviteCollaboration";
String JP = "\u5354\u696d";
String KR = "\ud611\uc5c5";
}
interface COLLABORATION_AUDIO {
String EN = "audio collaboration";
String JP = "通話協業";
String KR = "통화협업";
}
interface COLLABORATION_CAMERA {
String EN = "image collaboration";
String JP = "写真協業";
String KR = "사진협업";
}
interface COLLABORATION_VIDEO {
String EN = "video collaboration";
String JP = "動画協業";
String KR = "영상협업";
}
interface COLLABORATION_DOCUMENT {
String EN = "document collaboration";
String JP = "文書協業";
String KR = "문서협업";
}
interface COLLABORATION_BOARD {
String EN = "board collaboration";
String JP = "ボード協業";
String KR = "보드협업";
}
}
String FILE_SAVE_PATH = "/data/user/0/jp.co.agentec.abookplus.check/files/"; 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 ARCHIVE_URL = "file:///android_asset/chat/public_new/archive.html";
String ARCHIVE_DETAIL_URL = "file:///android_asset/chat/public_new/archive_detail.html";
String CONTACT_URL = "file:///android_asset/chat/public_new/contact.html";
String COLLABORATION_PAGE_URL = "file:///android_asset/chat/public_new/collaboration.html";
String DEFAULT_CHECKSUM = "0000000000";
String PLATFORM_NAME = "android";
String CHAT_MESSAGE_SEPERATOR = "<::split>";
int PUSH_MESSAGE_DLG_REQUEST_CODE = 200;
interface PUSH_MESSAGE_DLG_RESULT {
int OK = 0;
int CANCEL = 1;
}
// ABookCheckで、onActivityResultのリクエストコードとして使用されている
int ABOOK_CHECK_TASK_IMAGE = 103;
int ABOOK_CHECK_TASK_VIDEO = 104;
int ABOOK_CHECK_SELECT_SCENE = 105;
} }
...@@ -68,9 +68,9 @@ public class ChatGroupDao extends AbstractCommunicationDao { ...@@ -68,9 +68,9 @@ public class ChatGroupDao extends AbstractCommunicationDao {
sql.append(" ELSE mygroup.group_name "); sql.append(" ELSE mygroup.group_name ");
sql.append(" END AS group_path_list "); sql.append(" END AS group_path_list ");
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);
} }
...@@ -82,11 +82,11 @@ public class ChatGroupDao extends AbstractCommunicationDao { ...@@ -82,11 +82,11 @@ public class ChatGroupDao extends AbstractCommunicationDao {
sql.append(" ELSE usergroup.group_name "); sql.append(" ELSE usergroup.group_name ");
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 ");
sql.append(" WHERE sm.shop_member_id = ? ) "); sql.append(" WHERE sm.shop_member_id = ? ) ");
return rawQueryGetDtoList(sql.toString(), new String[] { "" + shopMemberId}, ChatGroupDto.class); return rawQueryGetDtoList(sql.toString(), new String[] { "" + shopMemberId}, ChatGroupDto.class);
} }
...@@ -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();
} }
......
...@@ -10,11 +10,8 @@ import java.util.HashMap; ...@@ -10,11 +10,8 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors;
import jp.agentec.abook.abv.bl.common.constant.ABookCommConstants; import jp.agentec.abook.abv.bl.common.constant.ABookCommConstants;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.common.util.JsonUtil;
import jp.agentec.abook.abv.bl.data.dao.AbstractCommunicationDao; import jp.agentec.abook.abv.bl.data.dao.AbstractCommunicationDao;
import jp.agentec.abook.abv.bl.data.dao.AbstractDao; import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
import jp.agentec.abook.abv.bl.data.dao.ArchiveDao; import jp.agentec.abook.abv.bl.data.dao.ArchiveDao;
...@@ -24,13 +21,11 @@ import jp.agentec.abook.abv.bl.data.dao.ChatRoomDao; ...@@ -24,13 +21,11 @@ import jp.agentec.abook.abv.bl.data.dao.ChatRoomDao;
import jp.agentec.abook.abv.bl.data.dao.ContentDao; import jp.agentec.abook.abv.bl.data.dao.ContentDao;
import jp.agentec.abook.abv.bl.data.dao.ShopMemberDao; import jp.agentec.abook.abv.bl.data.dao.ShopMemberDao;
import jp.agentec.abook.abv.bl.dto.ArchiveDto; import jp.agentec.abook.abv.bl.dto.ArchiveDto;
import jp.agentec.abook.abv.bl.dto.ChatGroupDto;
import jp.agentec.abook.abv.bl.dto.ChatMessageDto; import jp.agentec.abook.abv.bl.dto.ChatMessageDto;
import jp.agentec.abook.abv.bl.dto.ChatRoomDto; import jp.agentec.abook.abv.bl.dto.ChatRoomDto;
import jp.agentec.abook.abv.bl.dto.ChatGroupDto;
import jp.agentec.abook.abv.bl.dto.ContentDto; import jp.agentec.abook.abv.bl.dto.ContentDto;
import jp.agentec.abook.abv.bl.dto.ShopMemberDto; import jp.agentec.abook.abv.bl.dto.ShopMemberDto;
import jp.agentec.adf.util.ArrayUtil;
import jp.agentec.adf.util.CollectionUtil;
import jp.agentec.adf.util.DateTimeUtil; import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.StringUtil; import jp.agentec.adf.util.StringUtil;
...@@ -40,14 +35,14 @@ import jp.agentec.adf.util.StringUtil; ...@@ -40,14 +35,14 @@ import jp.agentec.adf.util.StringUtil;
public class CommunicationLogic extends AbstractLogic { public class CommunicationLogic extends AbstractLogic {
private static final String TAG = "CommunicationLogic"; private static final String TAG = "CommunicationLogic";
private ChatRoomDao chatRoomDao = AbstractCommunicationDao.getDao(ChatRoomDao.class); private final ChatRoomDao chatRoomDao = AbstractCommunicationDao.getDao(ChatRoomDao.class);
private ChatMessageDao chatMessageDao = AbstractCommunicationDao.getDao(ChatMessageDao.class); private final ChatMessageDao chatMessageDao = AbstractCommunicationDao.getDao(ChatMessageDao.class);
private ShopMemberDao shopMemberDao = AbstractCommunicationDao.getDao(ShopMemberDao.class); private final ShopMemberDao shopMemberDao = AbstractCommunicationDao.getDao(ShopMemberDao.class);
private ChatGroupDao chatGroupDao = AbstractCommunicationDao.getDao(ChatGroupDao.class); private final ChatGroupDao chatGroupDao = AbstractCommunicationDao.getDao(ChatGroupDao.class);
private ContentDao contentDao = AbstractDao.getDao(ContentDao.class); private final ContentDao contentDao = AbstractDao.getDao(ContentDao.class);
private String localFilePath; private String localFilePath;
private ArchiveDao archiveDao = AbstractCommunicationDao.getDao(ArchiveDao.class); private final ArchiveDao archiveDao = AbstractCommunicationDao.getDao(ArchiveDao.class);
/** /**
* {@link CommunicationLogic} クラスのインスタンスを初期化します。 * {@link CommunicationLogic} クラスのインスタンスを初期化します。
...@@ -100,8 +95,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -100,8 +95,7 @@ public class CommunicationLogic extends AbstractLogic {
JSONObject jsonObject = new JSONObject(chatRoomMap); JSONObject jsonObject = new JSONObject(chatRoomMap);
resultJsonArray.put(jsonObject); resultJsonArray.put(jsonObject);
} }
String roomListToStr = resultJsonArray.toString(); return resultJsonArray.toString();
return roomListToStr;
} }
public String getUsersInRoom(Integer roomId) { public String getUsersInRoom(Integer roomId) {
...@@ -115,8 +109,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -115,8 +109,7 @@ public class CommunicationLogic extends AbstractLogic {
JSONObject jsonObject = new JSONObject(userMap); JSONObject jsonObject = new JSONObject(userMap);
attendUsers.put(jsonObject); attendUsers.put(jsonObject);
} }
String attendUsersStr = attendUsers.toString(); return attendUsers.toString();
return attendUsersStr;
} }
public String getMessages(Integer roomId) { public String getMessages(Integer roomId) {
...@@ -142,8 +135,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -142,8 +135,7 @@ public class CommunicationLogic extends AbstractLogic {
JSONObject jsonObject = new JSONObject(chatMessageMap); JSONObject jsonObject = new JSONObject(chatMessageMap);
resultJsonArray.put(jsonObject); resultJsonArray.put(jsonObject);
} }
String messageListStr = resultJsonArray.toString(); return resultJsonArray.toString();
return messageListStr;
} }
public String getMessagesFromMessageId(Integer roomId, String messageId) { public String getMessagesFromMessageId(Integer roomId, String messageId) {
...@@ -170,8 +162,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -170,8 +162,7 @@ public class CommunicationLogic extends AbstractLogic {
JSONObject jsonObject = new JSONObject(chatMessageMap); JSONObject jsonObject = new JSONObject(chatMessageMap);
resultJsonArray.put(jsonObject); resultJsonArray.put(jsonObject);
} }
String messageListStr = resultJsonArray.toString(); return resultJsonArray.toString();
return messageListStr;
} }
public String searMessages(Integer roomId, String keyword, String userList) { public String searMessages(Integer roomId, String keyword, String userList) {
...@@ -197,8 +188,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -197,8 +188,7 @@ public class CommunicationLogic extends AbstractLogic {
JSONObject jsonObject = new JSONObject(chatMessageMap); JSONObject jsonObject = new JSONObject(chatMessageMap);
resultJsonArray.put(jsonObject); resultJsonArray.put(jsonObject);
} }
String messageListStr = resultJsonArray.toString(); return resultJsonArray.toString();
return messageListStr;
} }
public String getNameCardInfo(Integer shopMemberId) { public String getNameCardInfo(Integer shopMemberId) {
...@@ -223,7 +213,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -223,7 +213,7 @@ public class CommunicationLogic extends AbstractLogic {
resultJson.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, shopMemberDto.shopMemberName); resultJson.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, shopMemberDto.shopMemberName);
resultJson.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(shopMemberDto.profileUrl)); resultJson.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(shopMemberDto.profileUrl));
resultJson.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupPathJsonArray); resultJson.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupPathJsonArray);
boolean hasRegisteredDate = StringUtil.isNullOrEmpty(shopMemberDto.favoriteRegisterDate) == false; boolean hasRegisteredDate = !StringUtil.isNullOrEmpty(shopMemberDto.favoriteRegisterDate);
resultJson.put(ABookCommConstants.KEY.IS_FAVORITE, hasRegisteredDate); resultJson.put(ABookCommConstants.KEY.IS_FAVORITE, hasRegisteredDate);
return resultJson.toString(); return resultJson.toString();
...@@ -237,8 +227,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -237,8 +227,7 @@ public class CommunicationLogic extends AbstractLogic {
myInfoJson.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, myInfo.shopMemberName); myInfoJson.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, myInfo.shopMemberName);
myInfoJson.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(myInfo.profileUrl)); myInfoJson.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(myInfo.profileUrl));
myInfoJson.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupPathList); myInfoJson.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupPathList);
String myInfoStr = myInfoJson.toString(); return myInfoJson.toString();
return myInfoStr;
} }
public String getUserListByLoginId(String loginIdList) { public String getUserListByLoginId(String loginIdList) {
...@@ -259,8 +248,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -259,8 +248,7 @@ public class CommunicationLogic extends AbstractLogic {
joinedMemberArray.put(myInfoJson); joinedMemberArray.put(myInfoJson);
} }
String myInfoStr = joinedMemberArray.toString(); return joinedMemberArray.toString();
return myInfoStr;
} }
public String getMyGroupUsers() { public String getMyGroupUsers() {
...@@ -279,19 +267,14 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -279,19 +267,14 @@ public class CommunicationLogic extends AbstractLogic {
myGroupUserMap.put(ABookCommConstants.KEY.CHECKED, ""); myGroupUserMap.put(ABookCommConstants.KEY.CHECKED, "");
myGroupUserMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(groupUser.profileUrl)); myGroupUserMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(groupUser.profileUrl));
myGroupUserMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupUser); myGroupUserMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupUser);
if (StringUtil.isNullOrEmpty(groupUser.favoriteRegisterDate)) { myGroupUserMap.put(ABookCommConstants.KEY.IS_FAVORITE, !StringUtil.isNullOrEmpty(groupUser.favoriteRegisterDate));
myGroupUserMap.put(ABookCommConstants.KEY.IS_FAVORITE, false);
} else {
myGroupUserMap.put(ABookCommConstants.KEY.IS_FAVORITE, true);
}
JSONObject jsonObject = new JSONObject(myGroupUserMap); JSONObject jsonObject = new JSONObject(myGroupUserMap);
groupUserArray.put(jsonObject); groupUserArray.put(jsonObject);
} }
groupUserJson.put(ABookCommConstants.KEY.GROUP_USER_LIST, groupUserArray); groupUserJson.put(ABookCommConstants.KEY.GROUP_USER_LIST, groupUserArray);
myGroupUsersJson.put(groupUserJson); myGroupUsersJson.put(groupUserJson);
} }
String myInfoStr = myGroupUsersJson.toString(); return myGroupUsersJson.toString();
return myInfoStr;
} }
public String getMyGroupUsersNotInRoom(Integer roomId) { public String getMyGroupUsersNotInRoom(Integer roomId) {
...@@ -310,19 +293,14 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -310,19 +293,14 @@ public class CommunicationLogic extends AbstractLogic {
myGroupUserMap.put(ABookCommConstants.KEY.CHECKED, ""); myGroupUserMap.put(ABookCommConstants.KEY.CHECKED, "");
myGroupUserMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(groupUser.profileUrl)); myGroupUserMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(groupUser.profileUrl));
myGroupUserMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupUser); myGroupUserMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupUser);
if (StringUtil.isNullOrEmpty(groupUser.favoriteRegisterDate)) { myGroupUserMap.put(ABookCommConstants.KEY.IS_FAVORITE, !StringUtil.isNullOrEmpty(groupUser.favoriteRegisterDate));
myGroupUserMap.put(ABookCommConstants.KEY.IS_FAVORITE, false);
} else {
myGroupUserMap.put(ABookCommConstants.KEY.IS_FAVORITE, true);
}
JSONObject jsonObject = new JSONObject(myGroupUserMap); JSONObject jsonObject = new JSONObject(myGroupUserMap);
groupUserArray.put(jsonObject); groupUserArray.put(jsonObject);
} }
groupUserJson.put(ABookCommConstants.KEY.GROUP_USER_LIST, groupUserArray); groupUserJson.put(ABookCommConstants.KEY.GROUP_USER_LIST, groupUserArray);
myGroupUsersJson.put(groupUserJson); myGroupUsersJson.put(groupUserJson);
} }
String myInfoStr = myGroupUsersJson.toString(); return myGroupUsersJson.toString();
return myInfoStr;
} }
public String getMyGroupUserByName(String keyword) { public String getMyGroupUserByName(String keyword) {
...@@ -346,17 +324,12 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -346,17 +324,12 @@ public class CommunicationLogic extends AbstractLogic {
userMap.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, shopMember.shopMemberName); userMap.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, shopMember.shopMemberName);
userMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(shopMember.profileUrl)); userMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(shopMember.profileUrl));
userMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupPathArray); userMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupPathArray);
if (StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate)) { userMap.put(ABookCommConstants.KEY.IS_FAVORITE, !StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate));
userMap.put(ABookCommConstants.KEY.IS_FAVORITE, false);
} else {
userMap.put(ABookCommConstants.KEY.IS_FAVORITE, true);
}
JSONObject jsonObject = new JSONObject(userMap); JSONObject jsonObject = new JSONObject(userMap);
resultJsonArray.put(jsonObject); resultJsonArray.put(jsonObject);
} }
String searchUserStr = resultJsonArray.toString(); return resultJsonArray.toString();
return searchUserStr;
} }
public String getMyGroupUserNotInRoomByName(String keywords, Integer roomId) { public String getMyGroupUserNotInRoomByName(String keywords, Integer roomId) {
...@@ -380,17 +353,12 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -380,17 +353,12 @@ public class CommunicationLogic extends AbstractLogic {
userMap.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, shopMember.shopMemberName); userMap.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, shopMember.shopMemberName);
userMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(shopMember.profileUrl)); userMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(shopMember.profileUrl));
userMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupPathArray); userMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupPathArray);
if (StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate)) { userMap.put(ABookCommConstants.KEY.IS_FAVORITE, !StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate));
userMap.put(ABookCommConstants.KEY.IS_FAVORITE, false);
} else {
userMap.put(ABookCommConstants.KEY.IS_FAVORITE, true);
}
JSONObject jsonObject = new JSONObject(userMap); JSONObject jsonObject = new JSONObject(userMap);
resultJsonArray.put(jsonObject); resultJsonArray.put(jsonObject);
} }
String searchUserStr = resultJsonArray.toString(); return resultJsonArray.toString();
return searchUserStr;
} }
public String getAllGroupShopMemberByName(String keyword) { public String getAllGroupShopMemberByName(String keyword) {
...@@ -413,17 +381,12 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -413,17 +381,12 @@ public class CommunicationLogic extends AbstractLogic {
userMap.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, shopMember.shopMemberName); userMap.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, shopMember.shopMemberName);
userMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(shopMember.profileUrl)); userMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(shopMember.profileUrl));
userMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupPathArray); userMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupPathArray);
if (StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate)) { userMap.put(ABookCommConstants.KEY.IS_FAVORITE, !StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate));
userMap.put(ABookCommConstants.KEY.IS_FAVORITE, false);
} else {
userMap.put(ABookCommConstants.KEY.IS_FAVORITE, true);
}
JSONObject jsonObject = new JSONObject(userMap); JSONObject jsonObject = new JSONObject(userMap);
resultJsonArray.put(jsonObject); resultJsonArray.put(jsonObject);
} }
String searchUserStr = resultJsonArray.toString(); return resultJsonArray.toString();
return searchUserStr;
} }
public String getAllGroupShopMemberNotInRoomByName(String keywords, Integer roomId) { public String getAllGroupShopMemberNotInRoomByName(String keywords, Integer roomId) {
...@@ -448,17 +411,12 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -448,17 +411,12 @@ public class CommunicationLogic extends AbstractLogic {
userMap.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, shopMember.shopMemberName); userMap.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, shopMember.shopMemberName);
userMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(shopMember.profileUrl)); userMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(shopMember.profileUrl));
userMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupPathArray); userMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, groupPathArray);
if (StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate)) { userMap.put(ABookCommConstants.KEY.IS_FAVORITE, !StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate));
userMap.put(ABookCommConstants.KEY.IS_FAVORITE, false);
} else {
userMap.put(ABookCommConstants.KEY.IS_FAVORITE, true);
}
JSONObject jsonObject = new JSONObject(userMap); JSONObject jsonObject = new JSONObject(userMap);
resultJsonArray.put(jsonObject); resultJsonArray.put(jsonObject);
} }
String searchUserStr = resultJsonArray.toString(); return resultJsonArray.toString();
return searchUserStr;
} }
public String getGroupByName(String keyword) { public String getGroupByName(String keyword) {
...@@ -470,29 +428,24 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -470,29 +428,24 @@ public class CommunicationLogic extends AbstractLogic {
Map<String, Object> groupMap = new HashMap<String, Object>(); Map<String, Object> groupMap = new HashMap<String, Object>();
groupMap.put(ABookCommConstants.KEY.GROUP_NAME, group.groupName); groupMap.put(ABookCommConstants.KEY.GROUP_NAME, group.groupName);
groupMap.put(ABookCommConstants.KEY.GROUP_ID, group.groupId); groupMap.put(ABookCommConstants.KEY.GROUP_ID, group.groupId);
if (StringUtil.isNullOrEmpty(group.favoriteRegisterDate)) { groupMap.put(ABookCommConstants.KEY.IS_FAVORITE, !StringUtil.isNullOrEmpty(group.favoriteRegisterDate));
groupMap.put(ABookCommConstants.KEY.IS_FAVORITE, false);
} else {
groupMap.put(ABookCommConstants.KEY.IS_FAVORITE, true);
}
JSONObject jsonObject = new JSONObject(groupMap); JSONObject jsonObject = new JSONObject(groupMap);
resultJsonArray.put(jsonObject); resultJsonArray.put(jsonObject);
} }
String groupsStr = resultJsonArray.toString(); return resultJsonArray.toString();
return groupsStr;
} }
public String getMyGroupIds() { public String getMyGroupIds() {
List<ChatGroupDto> myGroupList = chatGroupDao.getMyGroups(); List<ChatGroupDto> myGroupList = chatGroupDao.getMyGroups();
String groupIds = ""; StringBuilder groupIds = new StringBuilder();
for (ChatGroupDto myGroup : myGroupList) { for (ChatGroupDto myGroup : myGroupList) {
if (!groupIds.equals("")) { if (!groupIds.toString().equals("")) {
groupIds = groupIds + ","; groupIds.append(",");
} }
groupIds = groupIds + myGroup.groupId; groupIds.append(myGroup.groupId);
} }
return groupIds; return groupIds.toString();
} }
public List<ChatGroupDto> getAllGroup() { public List<ChatGroupDto> getAllGroup() {
...@@ -528,8 +481,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -528,8 +481,7 @@ public class CommunicationLogic extends AbstractLogic {
resultJsonArray.put(jsonObject); resultJsonArray.put(jsonObject);
} }
String favoriteUsersStr = resultJsonArray.toString(); return resultJsonArray.toString();
return favoriteUsersStr;
} }
public String getFavoriteUsersNotInRoom(Integer roomId) { public String getFavoriteUsersNotInRoom(Integer roomId) {
...@@ -558,8 +510,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -558,8 +510,7 @@ public class CommunicationLogic extends AbstractLogic {
resultJsonArray.put(jsonObject); resultJsonArray.put(jsonObject);
} }
String favoriteUsersStr = resultJsonArray.toString(); return resultJsonArray.toString();
return favoriteUsersStr;
} }
public String getFavoriteGroups() { public String getFavoriteGroups() {
...@@ -576,8 +527,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -576,8 +527,7 @@ public class CommunicationLogic extends AbstractLogic {
resultJsonArray.put(jsonObject); resultJsonArray.put(jsonObject);
} }
String favoriteGroupsStr = resultJsonArray.toString(); return resultJsonArray.toString();
return favoriteGroupsStr;
} }
public Integer getFavoriteCount() { public Integer getFavoriteCount() {
...@@ -628,11 +578,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -628,11 +578,7 @@ public class CommunicationLogic extends AbstractLogic {
Map<String, Object> groupTreeMap = new HashMap<String, Object>(); Map<String, Object> groupTreeMap = new HashMap<String, Object>();
groupTreeMap.put(ABookCommConstants.KEY.GROUP_NAME, group.groupName); groupTreeMap.put(ABookCommConstants.KEY.GROUP_NAME, group.groupName);
groupTreeMap.put(ABookCommConstants.KEY.GROUP_ID, group.groupId); groupTreeMap.put(ABookCommConstants.KEY.GROUP_ID, group.groupId);
if (StringUtil.isNullOrEmpty(group.favoriteRegisterDate)) { groupTreeMap.put(ABookCommConstants.KEY.IS_FAVORITE, !StringUtil.isNullOrEmpty(group.favoriteRegisterDate));
groupTreeMap.put(ABookCommConstants.KEY.IS_FAVORITE, false);
} else {
groupTreeMap.put(ABookCommConstants.KEY.IS_FAVORITE, true);
}
JSONObject jsonObject = new JSONObject(groupTreeMap); JSONObject jsonObject = new JSONObject(groupTreeMap);
childGroupJSONArray.put(jsonObject); childGroupJSONArray.put(jsonObject);
} }
...@@ -648,18 +594,13 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -648,18 +594,13 @@ public class CommunicationLogic extends AbstractLogic {
shopMemberMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(shopMember.profileUrl)); shopMemberMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(shopMember.profileUrl));
shopMemberMap.put(ABookCommConstants.KEY.CHECKED, ""); shopMemberMap.put(ABookCommConstants.KEY.CHECKED, "");
shopMemberMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, chatGroupDao.getUserGroupPathList(shopMember.shopMemberId)); shopMemberMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, chatGroupDao.getUserGroupPathList(shopMember.shopMemberId));
if (StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate)) { shopMemberMap.put(ABookCommConstants.KEY.IS_FAVORITE, !StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate));
shopMemberMap.put(ABookCommConstants.KEY.IS_FAVORITE, false);
} else {
shopMemberMap.put(ABookCommConstants.KEY.IS_FAVORITE, true);
}
JSONObject jsonObject = new JSONObject(shopMemberMap); JSONObject jsonObject = new JSONObject(shopMemberMap);
shopMemberJSONArray.put(jsonObject); shopMemberJSONArray.put(jsonObject);
} }
groupSearchData.put(ABookCommConstants.KEY.GROUP_USER_LIST,shopMemberJSONArray); groupSearchData.put(ABookCommConstants.KEY.GROUP_USER_LIST,shopMemberJSONArray);
String groupSearchDataStr = groupSearchData.toString(); return groupSearchData.toString();
return groupSearchDataStr;
} }
public String getGroupSearchDataForAddUser(Integer groupId, Integer roomId) { public String getGroupSearchDataForAddUser(Integer groupId, Integer roomId) {
...@@ -671,12 +612,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -671,12 +612,7 @@ public class CommunicationLogic extends AbstractLogic {
ChatGroupDto myGroup = chatGroupDao.getMyGroups().get(0); ChatGroupDto myGroup = chatGroupDao.getMyGroups().get(0);
ChatGroupDto rootGroup = chatGroupDao.getRootGroup(); ChatGroupDto rootGroup = chatGroupDao.getRootGroup();
Integer targetGroupId; Integer targetGroupId = groupId == 0 ? rootGroup.groupId : groupId;
if (groupId == 0) {
targetGroupId = rootGroup.groupId;
} else {
targetGroupId = groupId;
}
ChatGroupDto parentGroup = chatGroupDao.getParentGroup(targetGroupId); ChatGroupDto parentGroup = chatGroupDao.getParentGroup(targetGroupId);
if (parentGroup != null) { if (parentGroup != null) {
...@@ -704,11 +640,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -704,11 +640,7 @@ public class CommunicationLogic extends AbstractLogic {
Map<String, Object> groupTreeMap = new HashMap<String, Object>(); Map<String, Object> groupTreeMap = new HashMap<String, Object>();
groupTreeMap.put(ABookCommConstants.KEY.GROUP_NAME, group.groupName); groupTreeMap.put(ABookCommConstants.KEY.GROUP_NAME, group.groupName);
groupTreeMap.put(ABookCommConstants.KEY.GROUP_ID, group.groupId); groupTreeMap.put(ABookCommConstants.KEY.GROUP_ID, group.groupId);
if (StringUtil.isNullOrEmpty(group.favoriteRegisterDate)) { groupTreeMap.put(ABookCommConstants.KEY.IS_FAVORITE, !StringUtil.isNullOrEmpty(group.favoriteRegisterDate));
groupTreeMap.put(ABookCommConstants.KEY.IS_FAVORITE, false);
} else {
groupTreeMap.put(ABookCommConstants.KEY.IS_FAVORITE, true);
}
JSONObject jsonObject = new JSONObject(groupTreeMap); JSONObject jsonObject = new JSONObject(groupTreeMap);
childGroupJSONArray.put(jsonObject); childGroupJSONArray.put(jsonObject);
} }
...@@ -724,18 +656,13 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -724,18 +656,13 @@ public class CommunicationLogic extends AbstractLogic {
shopMemberMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(shopMember.profileUrl)); shopMemberMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(shopMember.profileUrl));
shopMemberMap.put(ABookCommConstants.KEY.CHECKED, ""); shopMemberMap.put(ABookCommConstants.KEY.CHECKED, "");
shopMemberMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, chatGroupDao.getUserGroupPathList(shopMember.shopMemberId)); shopMemberMap.put(ABookCommConstants.KEY.GROUP_PATH_LIST, chatGroupDao.getUserGroupPathList(shopMember.shopMemberId));
if (StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate)) { shopMemberMap.put(ABookCommConstants.KEY.IS_FAVORITE, !StringUtil.isNullOrEmpty(shopMember.favoriteRegisterDate));
shopMemberMap.put(ABookCommConstants.KEY.IS_FAVORITE, false);
} else {
shopMemberMap.put(ABookCommConstants.KEY.IS_FAVORITE, true);
}
JSONObject jsonObject = new JSONObject(shopMemberMap); JSONObject jsonObject = new JSONObject(shopMemberMap);
shopMemberJSONArray.put(jsonObject); shopMemberJSONArray.put(jsonObject);
} }
groupSearchData.put(ABookCommConstants.KEY.GROUP_USER_LIST,shopMemberJSONArray); groupSearchData.put(ABookCommConstants.KEY.GROUP_USER_LIST,shopMemberJSONArray);
String groupSearchDataStr = groupSearchData.toString(); return groupSearchData.toString();
return groupSearchDataStr;
} }
public void insertChatRoomList(List<ChatRoomDto> roomList) { public void insertChatRoomList(List<ChatRoomDto> roomList) {
...@@ -766,10 +693,6 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -766,10 +693,6 @@ public class CommunicationLogic extends AbstractLogic {
chatRoomDao.insertChatRoomUsers(userIdList, roomId); chatRoomDao.insertChatRoomUsers(userIdList, roomId);
} }
public void insertChatMessage(ChatMessageDto chatMessageDto) {
chatMessageDao.insertChatMessage(chatMessageDto);
}
public void updateChatRoomName(String roomName, Integer roomId) { public void updateChatRoomName(String roomName, Integer roomId) {
chatRoomDao.updateChatRoomName(roomName, roomId); chatRoomDao.updateChatRoomName(roomName, roomId);
} }
...@@ -789,22 +712,16 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -789,22 +712,16 @@ public class CommunicationLogic extends AbstractLogic {
ShopMemberDto myInfo = shopMemberDao.getMyInfo(); ShopMemberDto myInfo = shopMemberDao.getMyInfo();
List<ShopMemberDto> insertList = new ArrayList<ShopMemberDto>(); List<ShopMemberDto> insertList = new ArrayList<ShopMemberDto>();
List<ShopMemberDto> deleteList = new ArrayList<ShopMemberDto>();
for (ShopMemberDto shopMemberDto : shopMemberDtoList) { for (ShopMemberDto shopMemberDto : shopMemberDtoList) {
//if (ABookCommConstants.FLAG.DEL_FLAG.EXIST.equals(shopMemberDto.delFlg)) {
if (myInfo.shopMemberId.equals(shopMemberDto.shopMemberId)) { if (myInfo.shopMemberId.equals(shopMemberDto.shopMemberId)) {
shopMemberDto.selfFlg = 1; shopMemberDto.selfFlg = 1;
} else { } else {
shopMemberDto.selfFlg = 0; shopMemberDto.selfFlg = 0;
} }
insertList.add(shopMemberDto); insertList.add(shopMemberDto);
//} else {
// deleteList.add(shopMemberDto);
//}
} }
shopMemberDao.insertShopMember(insertList); shopMemberDao.insertShopMember(insertList);
//shopMemberDao.deleteShopMemberByList(deleteList);
} }
...@@ -884,12 +801,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -884,12 +801,7 @@ public class CommunicationLogic extends AbstractLogic {
} }
public ShopMemberDto getMyShopMemberDto() { public ShopMemberDto getMyShopMemberDto() {
ShopMemberDto myInfo = shopMemberDao.getMyInfo(); return shopMemberDao.getMyInfo();
return myInfo;
}
public void deleteChatRoomList() {
chatRoomDao.deleteChatRoom();
} }
public void insertMyInfo(ShopMemberDto shopMemberDto) { public void insertMyInfo(ShopMemberDto shopMemberDto) {
...@@ -940,13 +852,6 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -940,13 +852,6 @@ public class CommunicationLogic extends AbstractLogic {
archiveDao.deleteArchiveAllData(); archiveDao.deleteArchiveAllData();
} }
public void initChatData() {
chatGroupDao.deleteChatGroup();
chatMessageDao.deleteChatMessage();
shopMemberDao.deleteShopMember();
archiveDao.deleteArchiveAllData();
}
public void roomDisplayOff(Integer roomId, Integer viewFlg) { public void roomDisplayOff(Integer roomId, Integer viewFlg) {
chatRoomDao.changeRoomViewFlg(roomId, viewFlg); chatRoomDao.changeRoomViewFlg(roomId, viewFlg);
} }
...@@ -963,7 +868,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -963,7 +868,7 @@ public class CommunicationLogic extends AbstractLogic {
attendUsers.put(jsonObject); attendUsers.put(jsonObject);
} }
return attendUsers.toString(); return attendUsers.toString();
}; }
public String getProfileUrlPath(String profileUrl) { public String getProfileUrlPath(String profileUrl) {
if (profileUrl == null) { if (profileUrl == null) {
...@@ -974,12 +879,11 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -974,12 +879,11 @@ public class CommunicationLogic extends AbstractLogic {
String filePath = localFilePath + fileName; String filePath = localFilePath + fileName;
File file = new File(filePath); File file = new File(filePath);
if (file.exists()) { if (file.exists()) {
String uri = file.toURI().toString(); return file.toURI().toString();
return uri;
} else { } else {
return profileUrl; return profileUrl;
} }
}; }
public String getFileUrlPath(String fileUrlPath) { public String getFileUrlPath(String fileUrlPath) {
if (!fileUrlPath.contains("fileName=")) { if (!fileUrlPath.contains("fileName=")) {
...@@ -999,7 +903,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -999,7 +903,7 @@ public class CommunicationLogic extends AbstractLogic {
} else { } else {
return fileUrlPath; return fileUrlPath;
} }
}; }
public void setPackagePath(String localFilePath) { public void setPackagePath(String localFilePath) {
this.localFilePath = localFilePath; this.localFilePath = localFilePath;
...@@ -1097,21 +1001,6 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -1097,21 +1001,6 @@ public class CommunicationLogic extends AbstractLogic {
return resultJsonArray.toString(); return resultJsonArray.toString();
} }
public String getCollaborationMemberList(Integer collaborationDetailId) {
List<ShopMemberDto> shopMemberDtoListDtoList = shopMemberDao.getCollaborationMemberList(collaborationDetailId);
JSONArray resultJsonArray = new JSONArray();
for (ShopMemberDto dto : shopMemberDtoListDtoList) {
Map<String, Object> userMap = new HashMap<String, Object>();
userMap.put(ABookCommConstants.KEY.SHOP_MEMBER_ID, dto.shopMemberId);
userMap.put(ABookCommConstants.KEY.LOGIN_ID, dto.loginId);
userMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(dto.profileUrl));
userMap.put(ABookCommConstants.KEY.SHOP_MEMBER_NAME, dto.shopMemberName);
JSONObject jsonObject = new JSONObject(userMap);
resultJsonArray.put(jsonObject);
}
return resultJsonArray.toString();
}
public Map<Integer, ChatGroupDto> convertGroupListToMap(List<ChatGroupDto> groupList) { public Map<Integer, ChatGroupDto> convertGroupListToMap(List<ChatGroupDto> groupList) {
Map<Integer, ChatGroupDto> map = new HashMap<Integer, ChatGroupDto>(); Map<Integer, ChatGroupDto> map = new HashMap<Integer, ChatGroupDto>();
for (ChatGroupDto group : groupList) { for (ChatGroupDto group : groupList) {
...@@ -1123,4 +1012,43 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -1123,4 +1012,43 @@ public class CommunicationLogic extends AbstractLogic {
public void updateUnreadCount(List<ChatMessageDto> messageList, String roomId) { public void updateUnreadCount(List<ChatMessageDto> messageList, String roomId) {
chatMessageDao.updatUnreadCount(messageList, roomId); chatMessageDao.updatUnreadCount(messageList, roomId);
} }
/**
* 協業招待メッセージからCollaborationTypeを取得
* @param message プッシュメッセージ
* @return 協業タイプ
*/
public String getCollaborationType(String message) {
try {
if (message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_AUDIO.EN) ||
message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_AUDIO.JP) ||
message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_AUDIO.KR)
) {
return String.valueOf(ABookCommConstants.FLAG.COLLABORATION_TYPE.AUDIO);
}else if (message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_CAMERA.EN) ||
message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_CAMERA.JP) ||
message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_CAMERA.KR)
) {
return String.valueOf(ABookCommConstants.FLAG.COLLABORATION_TYPE.CAMERA);
}else if (message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_VIDEO.EN) ||
message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_VIDEO.JP) ||
message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_VIDEO.KR)
) {
return String.valueOf(ABookCommConstants.FLAG.COLLABORATION_TYPE.VIDEO);
}else if (message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_DOCUMENT.EN) ||
message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_DOCUMENT.JP) ||
message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_DOCUMENT.KR)
) {
return String.valueOf(ABookCommConstants.FLAG.COLLABORATION_TYPE.DOCUMENT);
}else if (message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_BOARD.EN) ||
message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_BOARD.JP) ||
message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_BOARD.KR)
) {
return String.valueOf(ABookCommConstants.FLAG.COLLABORATION_TYPE.BOARD);
}
return null;
} catch (Exception e) {
return null;
}
}
} }
...@@ -131,18 +131,15 @@ public class OperationLogic extends AbstractLogic { ...@@ -131,18 +131,15 @@ public class OperationLogic extends AbstractLogic {
List<OperationDto> serverOperations = json.operationList; List<OperationDto> serverOperations = json.operationList;
//サーバーからチャットプシュデータを取得 //サーバーからチャットプシュデータを取得
/*if (ABVDataCache.getInstance().serviceOption.isChat()) { if (ABVDataCache.getInstance().serviceOption.isChat()) {
ChatPushDataJSON chatPushJson = AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).getChatPushList(param); ChatPushDataJSON chatPushJson = AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).getChatPushList(param);
for ( PushMessageDto dto : chatPushJson.pushMessageList) { for (PushMessageDto dto : chatPushJson.pushMessageList) {
PushMessageDto dtoTemp = mPushMessageDao.selectChat(dto.pushMessageId, dto.operationId, dto.pushSendDate); PushMessageDto dtoTemp = mPushMessageDao.selectChat(dto.pushMessageId, dto.operationId, dto.pushSendDate);
if (dtoTemp == null) { if (dtoTemp == null) {
mPushMessageDao.insert(dto); mPushMessageDao.insert(dto);
} }
} }
}*/ }
for (OperationDto serverOperationDto : serverOperations) { for (OperationDto serverOperationDto : serverOperations) {
// 登録フラグ // 登録フラグ
...@@ -295,6 +292,16 @@ public class OperationLogic extends AbstractLogic { ...@@ -295,6 +292,16 @@ public class OperationLogic extends AbstractLogic {
OperationListJSON json = AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).getOperationList(param); OperationListJSON json = AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).getOperationList(param);
List<OperationDto> serverOperations = json.operationList; List<OperationDto> serverOperations = json.operationList;
//サーバーからチャットプシュデータを取得
if (ABVDataCache.getInstance().serviceOption.isChat()) {
ChatPushDataJSON chatPushJson = AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).getChatPushList(param);
for (PushMessageDto dto : chatPushJson.pushMessageList) {
PushMessageDto dtoTemp = mPushMessageDao.selectChat(dto.pushMessageId, dto.operationId, dto.pushSendDate);
if (dtoTemp == null) {
mPushMessageDao.insert(dto);
}
}
}
for (OperationDto serverOperationDto : serverOperations) { for (OperationDto serverOperationDto : serverOperations) {
// 登録フラグ // 登録フラグ
boolean insertFlg = true; boolean insertFlg = true;
......
...@@ -251,9 +251,11 @@ ...@@ -251,9 +251,11 @@
android:theme="@style/Theme.AppCompat.Light.NoActionBar.FullScreen" > android:theme="@style/Theme.AppCompat.Light.NoActionBar.FullScreen" >
</activity> </activity>
<activity android:name="jp.agentec.abook.abv.ui.home.activity.ChatWebViewActivity" android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation" <activity android:name="jp.agentec.abook.abv.ui.home.activity.ChatWebViewActivity"
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
android:taskAffinity=".ChatWebViewActivity" android:taskAffinity=".ChatWebViewActivity"
android:resizeableActivity="true" android:resizeableActivity="true"
android:excludeFromRecents="true"
android:supportsPictureInPicture="true"/> android:supportsPictureInPicture="true"/>
</application> </application>
......
Subproject commit 515a1461c829fcc0a8a7aca957d2ce730e317ce0 Subproject commit 9fdd2c5aec99f82c62b83f3c373309f6378435b7
...@@ -17,12 +17,12 @@ dependencies { ...@@ -17,12 +17,12 @@ dependencies {
} }
android { android {
compileSdkVersion 29 compileSdkVersion 30
buildToolsVersion '28.0.3' buildToolsVersion '30.0.2'
defaultConfig { defaultConfig {
minSdkVersion 23 minSdkVersion 23
targetSdkVersion 29 targetSdkVersion 30
multiDexEnabled true multiDexEnabled true
// from gradle.properties // from gradle.properties
......
...@@ -6,12 +6,12 @@ buildscript { ...@@ -6,12 +6,12 @@ buildscript {
apply plugin: 'com.android.library' apply plugin: 'com.android.library'
android { android {
compileSdkVersion 29 compileSdkVersion 30
buildToolsVersion '28.0.3' buildToolsVersion '30.0.2'
defaultConfig { defaultConfig {
minSdkVersion 23 minSdkVersion 23
targetSdkVersion 29 targetSdkVersion 30
//abvEnvironments //abvEnvironments
resValue("string", "acms_address", "${acms_address}") resValue("string", "acms_address", "${acms_address}")
resValue("string", "download_server_address", "${download_server_address}") resValue("string", "download_server_address", "${download_server_address}")
......
...@@ -1491,9 +1491,17 @@ ...@@ -1491,9 +1491,17 @@
<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="chat_open_fail_meeting_connected">遠隔支援中にはチャットルームは開けません。</string>
<string name="chat_open_fail_collaborattion_connected">協業中にはチャットルームは開けません。</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>
<string name="msg_fail_collaboration_not_action_allow">文書協業中には利用できない機能です。</string>
<string name="msg_fail_collaboration_join_error">協業に参加することができませんでした。</string>
<string name="msg_fail_collaboration_pip_change_host">PIP状態ではホスト変更できません。PIPを解除してください。</string>
</resources> </resources>
...@@ -1499,4 +1499,13 @@ ...@@ -1499,4 +1499,13 @@
<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>
<string name="chat_open_fail_meeting_connected">원격 지원 접속 중에는 채팅방을 열 수 없습니다.</string>
<string name="chat_open_fail_collaborattion_connected">문서협업 접속 중에는 채팅방을 열수 없습니다.</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>
<string name="msg_fail_collaboration_not_action_allow">문서협업 중에는 이용할 수 없는 기능입니다.</string>
<string name="msg_fail_collaboration_join_error">협업에 참여하실수 없습니다.</string>
<string name="msg_fail_collaboration_pip_change_host">PIP 상태에서는 호스트 변경이 불가능합니다. PIP 모드를 해제해 주세요.</string>
</resources> </resources>
\ No newline at end of file
...@@ -1495,4 +1495,13 @@ ...@@ -1495,4 +1495,13 @@
<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>
<string name="chat_open_fail_meeting_connected">Can’t open chat room during distance support. </string>
<string name="chat_open_fail_collaborattion_connected">Chat rooms cannot be opened while the document collaboration is connected.</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>
<string name="msg_fail_collaboration_not_action_allow">This function cannot be used during document collaboration.</string>
<string name="msg_fail_collaboration_join_error">Could not connect to the collaboration.</string>
<string name="msg_fail_collaboration_pip_change_host">Host change is not possible in PIP state. Please turn off picture-in-picture mode.</string>
</resources> </resources>
...@@ -26,12 +26,12 @@ dependencies { ...@@ -26,12 +26,12 @@ dependencies {
} }
android { android {
compileSdkVersion 29 compileSdkVersion 30
buildToolsVersion '28.0.3' buildToolsVersion '30.0.2'
defaultConfig { defaultConfig {
minSdkVersion 23 minSdkVersion 23
targetSdkVersion 29 targetSdkVersion 30
multiDexEnabled true multiDexEnabled true
} }
sourceSets { sourceSets {
......
...@@ -6,49 +6,14 @@ ...@@ -6,49 +6,14 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/background" > 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 <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1" android:layout_weight="1"
android:orientation="vertical" > android:orientation="vertical" >
<WebView <WebView
android:id="@+id/chatWebview2" android:id="@+id/chatWebview"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent" />
</FrameLayout> </FrameLayout>
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -211,6 +211,7 @@ ...@@ -211,6 +211,7 @@
android:background="@drawable/frame" android:background="@drawable/frame"
android:padding="8dp" android:padding="8dp"
android:text="" android:text=""
android:textColor="@android:color/white"
android:textSize="15sp" android:textSize="15sp"
android:visibility="gone" android:visibility="gone"
android:maxLines="1" /> android:maxLines="1" />
......
...@@ -969,7 +969,7 @@ public abstract class PullToRefreshBase<T extends View> extends LinearLayout imp ...@@ -969,7 +969,7 @@ public abstract class PullToRefreshBase<T extends View> extends LinearLayout imp
*/ */
protected final void setHeaderScroll(int value) { protected final void setHeaderScroll(int value) {
if (DEBUG) { if (DEBUG) {
Log.d(LOG_TAG, "setHeaderScroll: " + value); Log.v(LOG_TAG, "setHeaderScroll: " + value);
} }
// Clamp value to with pull scroll range // Clamp value to with pull scroll range
......
package jp.agentec.abook.abv.cl.push; package jp.agentec.abook.abv.cl.push;
import android.app.Activity;
import android.app.Notification; import android.app.Notification;
import android.app.NotificationChannel; import android.app.NotificationChannel;
import android.app.NotificationManager; import android.app.NotificationManager;
import android.app.PendingIntent; import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Build; import android.os.Build;
import android.util.Log;
import com.google.firebase.messaging.FirebaseMessagingService; import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage; import com.google.firebase.messaging.RemoteMessage;
import org.json.adf.JSONException;
import org.json.adf.JSONObject; import org.json.adf.JSONObject;
import java.util.Map; import java.util.Map;
import java.util.Objects;
import jp.agentec.abook.abv.bl.common.constant.ABookCommConstants;
import jp.agentec.abook.abv.bl.common.exception.ABVException; import jp.agentec.abook.abv.bl.common.exception.ABVException;
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.ChatMessageDto;
import jp.agentec.abook.abv.bl.dto.MemberInfoDto; import jp.agentec.abook.abv.bl.dto.MemberInfoDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic; import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.CommunicationLogic;
import jp.agentec.abook.abv.bl.logic.UserAuthenticateLogic; import jp.agentec.abook.abv.bl.logic.UserAuthenticateLogic;
import jp.agentec.abook.abv.cl.util.AppUtil; import jp.agentec.abook.abv.cl.util.AppUtil;
import jp.agentec.abook.abv.launcher.android.R; 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.ShowPushMessageDailogActivity; import jp.agentec.abook.abv.ui.common.activity.ShowPushMessageDailogActivity;
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.home.activity.OperationListActivity;
import jp.agentec.abook.abv.ui.home.activity.OperationRelatedContentActivity;
import jp.agentec.abook.abv.ui.home.activity.SplashScreenActivity; import jp.agentec.abook.abv.ui.home.activity.SplashScreenActivity;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.viewer.activity.AudioPlayActivity;
import jp.agentec.abook.abv.ui.viewer.activity.ContentViewActivity;
import jp.agentec.abook.abv.ui.viewer.activity.HTMLWebViewActivity;
import jp.agentec.abook.abv.ui.viewer.activity.ImageViewActivity;
import jp.agentec.abook.abv.ui.viewer.activity.VideoViewActivity;
import jp.agentec.adf.util.StringUtil; import jp.agentec.adf.util.StringUtil;
public class ABVFcmListenerService extends FirebaseMessagingService { public class ABVFcmListenerService extends FirebaseMessagingService {
private static final String TAG = "ABVFcmListenerService"; private static final String TAG = "ABVFcmListenerService";
private NotificationManager mNotificationManager; private NotificationManager mNotificationManager;
private static int mNotificationConnect = 0; private static int mNotificationConnect = 0;
private final String INVITE_COLLABORATION = "inviteCollaboration<::split>"; private CommunicationLogic communicationLogic = AbstractLogic.getLogic(CommunicationLogic.class);
@Override @Override
public void onCreate() { public void onCreate() {
...@@ -51,146 +64,113 @@ public class ABVFcmListenerService extends FirebaseMessagingService { ...@@ -51,146 +64,113 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
@Override @Override
public void onMessageReceived(RemoteMessage remoteMessage) { public void onMessageReceived(RemoteMessage remoteMessage) {
Map<String, String> msg = remoteMessage.getData(); Map<String, String> messageMap = remoteMessage.getData();
Logger.d(TAG,"onMessageReceived(): msg :"+ msg); Logger.d(TAG,"onMessageReceived(): messageMap :"+ messageMap);
try { try {
UserAuthenticateLogic logic = AbstractLogic.getLogic(UserAuthenticateLogic.class); UserAuthenticateLogic logic = AbstractLogic.getLogic(UserAuthenticateLogic.class);
MemberInfoDto memberInfo = logic.getMemberInfo(); MemberInfoDto memberInfo = logic.getMemberInfo();
if (!StringUtil.isNullOrWhiteSpace(msg.get(AppDefType.PushMessageKey.message)) && this.getResources().getInteger(R.integer.push_message) == 1 && memberInfo != null) { boolean hasMessageBody = !StringUtil.isNullOrWhiteSpace(messageMap.get(AppDefType.PushMessageKey.message));
boolean isPushMessageEnabled = this.getResources().getInteger(R.integer.push_message) == 1;
if (hasMessageBody && isPushMessageEnabled && memberInfo != null) {
// Check pushmessage by chat // Check pushmessage by chat
String tempMsg = msg.get(AppDefType.PushMessageKey.message); String messageBody = messageMap.get(AppDefType.PushMessageKey.message);
String pushMsg = "";
Long roomId = null;
String roomName = ""; String roomName = "";
String pushSendLoginId = "";
long pushSendDate = 0;
Integer insertId = 0;
Integer messageType = 0;
Integer messageId = 0;
String roomType = "";
Log.d(TAG,"tempMsg : "+ tempMsg);
if (tempMsg.indexOf("pushSendLoginId") > 0) {
JSONObject json = new JSONObject(tempMsg);
Object Obj = json.getString("pushSendLoginId");
roomId = json.getLong("roomId");
roomName = json.getString("roomName");
pushSendLoginId = json.getString("pushSendLoginId");
pushSendDate = json.getLong("pushSendDate");
pushMsg = json.getString("message");
if (Objects.requireNonNull(messageBody).indexOf(AppDefType.ChatPushMessageKey.pushSendLoginId) > 0) {
PushMessageJSON json = new PushMessageJSON(messageBody);
roomName = json.getRoomName();
//TODO pushメッセージが到着した際、新着メッセージかルーム招待か判別してDB格納が必要 //TODO pushメッセージが到着した際、新着メッセージかルーム招待か判別してDB格納が必要
//Integer insertId = 0;
//Integer messageType = 0;
//insertId = json.getString("insertId"); //insertId = json.getString("insertId");
//ChatMessageDto chatMessageDto = new ChatMessageDto(); //ChatMessageDto chatMessageDto = new ChatMessageDto();
//chatMessageDto.chatRoomId = //chatMessageDto.chatRoomId =
//chatRoomId shopMemberId messge messageType insertDate //chatRoomId shopMemberId messge messageType insertDate
if (pushMsg.length() > 0) {
tempMsg = pushMsg;
}
if (AppUtil.isAppForground(this)) {
msg.put(AppDefType.PushMessageKey.message, pushMsg);
}
if (pushMsg.contains(INVITE_COLLABORATION)) {
roomType = Integer.toString(json.getInt("roomType"));
String[] inviteMessage = pushMsg.split("<::split>");
tempMsg = getString(R.string.msg_invite_collaboration);
Intent pushMsgDialog = new Intent(ABVFcmListenerService.this, ShowPushMessageDailogActivity.class);
pushMsgDialog.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
pushMsgDialog.putExtra(AppDefType.PushMessageKey.message, tempMsg);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomId, roomId); // Room Id
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomName, roomName); // Room Name
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendLoginId, pushSendLoginId); // sendLoginId
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendDate, pushSendDate);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.collaborationType, inviteMessage[1]);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomType, roomType);
startActivity(pushMsgDialog);
return;
}
} }
if (AppUtil.isAppForground(this)) { if (AppUtil.isAppForground(this)) {
Intent pushMsgDialog = new Intent(ABVFcmListenerService.this, ShowPushMessageDailogActivity.class);
pushMsgDialog.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
pushMsgDialog.putExtra(AppDefType.PushMessageKey.message, tempMsg);
pushMsgDialog.putExtra(AppDefType.PushMessageKey.data, msg.get(AppDefType.PushMessageKey.data));
pushMsgDialog.putExtra(AppDefType.PushMessageKey.operationId, msg.get(AppDefType.PushMessageKey.operationId));
// push message
if (roomName.length() > 0) { if (roomName.length() > 0) {
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomId, roomId); // Room Id showChatRoomPopupMessage(messageMap);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomName, roomName); // Room Name } else {
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendLoginId, pushSendLoginId); // sendLoginId String data = messageMap.get(AppDefType.PushMessageKey.data);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendDate, pushSendDate); String operationID = messageMap.get(AppDefType.PushMessageKey.operationId);
showOperationPopUpMessage(messageBody, data, operationID);
} }
startActivity(pushMsgDialog);
} else { } else {
sendNotification(msg); sendNotification(messageMap);
} }
} }
} catch (ABVException e) { } catch (ABVException e) {
// ignore // ignore
Logger.e(TAG, e.toString()); Logger.e(TAG, e.toString());
} catch (JSONException e) {
Logger.e(TAG, e.toString());
} }
} }
private void sendNotification(Map<String, String> message) { /**
Intent intent = new Intent(); * プッシュメッセージをダイアログ表示する
* @param messageMap 受信したメッセージを格納したMapオブジェクト
// 定期点検用 */
if (message.get(AppDefType.PushMessageKey.operationId) != null) { private void showChatRoomPopupMessage(Map<String, String> messageMap) {
intent.putExtra(AppDefType.PushMessageKey.operationId, message.get(AppDefType.PushMessageKey.operationId)); String messageBody = messageMap.get(AppDefType.PushMessageKey.message);
intent.putExtra(AppDefType.PushMessageKey.message, message.get(AppDefType.PushMessageKey.message)); Logger.d("messageBody = " + messageBody);
} else { PushMessageJSON json;
// Check pushmessage by chat if (StringUtil.isNullOrEmpty(messageBody)) {
try { return;
// チャットプッシュメッセージがある場合
UserAuthenticateLogic logic = AbstractLogic.getLogic(UserAuthenticateLogic.class);
MemberInfoDto memberInfo = logic.getMemberInfo();
if (!StringUtil.isNullOrWhiteSpace(message.get(AppDefType.PushMessageKey.message))) {
String tempMsg = message.get(AppDefType.PushMessageKey.message);
String pushMsg = "";
Long roomId = null;
String roomName = "";
String pushSendLoginId = "";
long pushSendDate = 0;
Log.d(TAG,"tempMsg : "+ tempMsg);
if (tempMsg.indexOf("pushSendLoginId") > 0) {
JSONObject json = new JSONObject(tempMsg);
Object Obj = json.getString("pushSendLoginId");
roomId = json.getLong("roomId");
roomName = json.getString("roomName");
pushSendLoginId = json.getString("pushSendLoginId");
pushSendDate = json.getLong("pushSendDate");
pushMsg = json.getString("message");
message.put(AppDefType.PushMessageKey.message, pushMsg);
// push message
if (roomName.length() > 0) {
intent.putExtra(AppDefType.ChatPushMessageKey.roomId, roomId); // Room Id
intent.putExtra(AppDefType.ChatPushMessageKey.roomName, roomName); // Room Name
intent.putExtra(AppDefType.ChatPushMessageKey.pushSendLoginId, pushSendLoginId); // sendLoginId
intent.putExtra(AppDefType.ChatPushMessageKey.pushSendDate, pushSendDate);
} }
json = new PushMessageJSON(messageBody);
Activity currentActivity = ActivityHandlingHelper.getInstance().getCurrentActivity();
String baseActivityName = currentActivity.getClass().getName();
if (currentActivity.getClass().equals(HTMLWebViewActivity.class) ||
currentActivity.getClass().equals(ContentViewActivity.class) ||
currentActivity.getClass().equals(OperationRelatedContentActivity.class) ||
currentActivity.getClass().equals(OperationListActivity.class) ||
currentActivity.getClass().equals(ImageViewActivity.class) ||
currentActivity.getClass().equals(VideoViewActivity.class) ||
currentActivity.getClass().equals(AudioPlayActivity.class)
){
// 呼び出し元のActivityの名前をmessageMapに追加する
messageMap.put(AppDefType.ChatPushMessageKey.baseActivityName, baseActivityName);
messageMap.put(AppDefType.ChatPushMessageKey.needsDisplayOperationOrOperationRelatedContentScreen, "true");
((ABVAuthenticatedActivity)currentActivity).showChatRoomPopupMessage((Context)currentActivity, messageMap);
} else {
// それ以外のActivityの場合の処理
Intent pushMsgDialog = new Intent(ABVFcmListenerService.this, ShowPushMessageDailogActivity.class);
pushMsgDialog.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
pushMsgDialog.putExtra(AppDefType.PushMessageKey.message, json.getMessage());
pushMsgDialog.putExtra(AppDefType.PushMessageKey.data, json.getData());
pushMsgDialog.putExtra(AppDefType.PushMessageKey.operationId, json.getOperationID());
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomId, json.getRoomId());
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomName, json.getRoomName());
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendLoginId, json.getPushSendLoginId());
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendDate, json.getPushSendDate());
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomType, json.getRoomType());
String collaborationType = communicationLogic.getCollaborationType(json.getMessage());
if (collaborationType != null) {
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.collaborationType, collaborationType);
} }
startActivity(pushMsgDialog);
} }
} catch (ABVException e) {
// ignore
Logger.e(TAG, e.toString());
} }
private void showOperationPopUpMessage(String textMessage, String data, String operationID) {
Intent pushMsgDialog = new Intent(ABVFcmListenerService.this, ShowPushMessageDailogActivity.class);
pushMsgDialog.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
pushMsgDialog.putExtra(AppDefType.PushMessageKey.message, textMessage);
pushMsgDialog.putExtra(AppDefType.PushMessageKey.data, data);
pushMsgDialog.putExtra(AppDefType.PushMessageKey.operationId, operationID);
startActivity(pushMsgDialog);
} }
intent.setClassName(getApplicationContext(), SplashScreenActivity.class.getName()); /**
* アプリがバックグラウンドなので通知エリアにアイコン表示する。
* アイコンタップ時の情報を作成する。
*/
private void sendNotification(Map<String, String> message) {
Intent intent = instantiatePushNotificationIntent(message);
Notification notification; Notification notification;
...@@ -205,7 +185,6 @@ public class ABVFcmListenerService extends FirebaseMessagingService { ...@@ -205,7 +185,6 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
mNotificationManager.notify(uniqueId, notification); mNotificationManager.notify(uniqueId, notification);
} }
} else { } else {
//mNotificationManager = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
Notification.Builder nb = getNotificationBuilder(pendingIntent, message); Notification.Builder nb = getNotificationBuilder(pendingIntent, message);
...@@ -229,14 +208,66 @@ public class ABVFcmListenerService extends FirebaseMessagingService { ...@@ -229,14 +208,66 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
} }
} }
Intent instantiatePushNotificationIntent(Map<String, String> message) {
Intent intent = new Intent();
intent.setClassName(getApplicationContext(), SplashScreenActivity.class.getName());
// 定期点検用
if (message.get(AppDefType.PushMessageKey.operationId) != null) {
intent.putExtra(AppDefType.PushMessageKey.operationId, message.get(AppDefType.PushMessageKey.operationId));
intent.putExtra(AppDefType.PushMessageKey.message, message.get(AppDefType.PushMessageKey.message));
return intent;
}
// Check pushmessage by chat
// チャットプッシュメッセージがある場合
if (StringUtil.isNullOrWhiteSpace(message.get(AppDefType.PushMessageKey.message))) {
return intent;
}
String messageBody = message.get(AppDefType.PushMessageKey.message);
if (Objects.requireNonNull(messageBody).indexOf(AppDefType.ChatPushMessageKey.pushSendLoginId) <= 0) {
return intent;
}
JSONObject json = new JSONObject(messageBody);
String textMessage = json.getString(AppDefType.PushMessageKey.message);
String roomType = "";
String roomName = json.getString(AppDefType.ChatPushMessageKey.roomName);
String pushMsg = json.getString(AppDefType.PushMessageKey.message);
message.put(AppDefType.PushMessageKey.message, pushMsg);
if (roomName.length() <= 0) {
return intent;
}
long roomId = json.getLong(AppDefType.ChatPushMessageKey.roomId);
long pushSendDate = json.getLong(AppDefType.ChatPushMessageKey.pushSendDate);
String pushSendLoginId = json.getString(AppDefType.ChatPushMessageKey.pushSendLoginId);
String collaobrationInvitedMessage = textMessage;
intent.putExtra(AppDefType.PushMessageKey.message, collaobrationInvitedMessage);
intent.putExtra(AppDefType.ChatPushMessageKey.roomId, roomId);
intent.putExtra(AppDefType.ChatPushMessageKey.roomName, roomName);
intent.putExtra(AppDefType.ChatPushMessageKey.pushSendLoginId, pushSendLoginId);
intent.putExtra(AppDefType.ChatPushMessageKey.pushSendDate, pushSendDate);
intent.putExtra(AppDefType.ChatPushMessageKey.roomType, roomType);
String collaborationType = communicationLogic.getCollaborationType(textMessage);
if (collaborationType != null) {
intent.putExtra(AppDefType.ChatPushMessageKey.collaborationType, collaborationType);
}
return intent;
}
private Notification.Builder getNotificationBuilder(PendingIntent pendingIntent, Map<String, String> message) { private Notification.Builder getNotificationBuilder(PendingIntent pendingIntent, Map<String, String> message) {
String txtMessage = message.get(AppDefType.PushMessageKey.message);
return new Notification.Builder(this) return new Notification.Builder(this)
.setDefaults(Notification.DEFAULT_ALL) .setDefaults(Notification.DEFAULT_ALL)
.setSmallIcon(R.drawable.icon) .setSmallIcon(R.drawable.icon)
.setWhen(System.currentTimeMillis()) .setWhen(System.currentTimeMillis())
.setAutoCancel(true) .setAutoCancel(true)
.setContentTitle(getString(R.string.app_name)) .setContentTitle(getString(R.string.app_name))
.setContentText(message.get(AppDefType.PushMessageKey.message)) .setContentText(txtMessage)
.setContentIntent(pendingIntent); .setContentIntent(pendingIntent);
} }
...@@ -248,5 +279,4 @@ public class ABVFcmListenerService extends FirebaseMessagingService { ...@@ -248,5 +279,4 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
return downloadUrl; return downloadUrl;
} }
} }
package jp.agentec.abook.abv.cl.push;
import android.content.Intent;
import org.json.adf.JSONObject;
import jp.agentec.abook.abv.bl.common.constant.ABookCommConstants;
import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.adf.util.StringUtil;
/**
* プッシュメッセージをJSONにしたクラス
* 既存のデータのキーは、AppDefType.PushMessageKey
* チャットで追加されたデータのキーは、AppDefType.ChatPushMessageKey
*/
public class PushMessageJSON {
private JSONObject jsonObject;
public PushMessageJSON(String jsonText) {
jsonObject = new JSONObject(jsonText);
}
// プッシュメッセージデータ
public String getMessage() {
return jsonObject.getString(AppDefType.PushMessageKey.message);
}
public String getData() {
try {
return jsonObject.getString(AppDefType.PushMessageKey.data);
} catch (Exception e) {
return "";
}
}
public String getOperationID() {
try {
return jsonObject.getString(AppDefType.PushMessageKey.operationId);
} catch (Exception e) {
return "";
}
}
// ここからチャットデータ
public String getRoomName() {
try {
return jsonObject.getString(AppDefType.ChatPushMessageKey.roomName);
} catch (Exception e){
return "";
}
}
public Long getRoomId() {
try {
return jsonObject.getLong(AppDefType.ChatPushMessageKey.roomId);
} catch (Exception e){
return new Long(0);
}
}
public String getRoomType() {
try {
// int roomType = jsonObject.getInt(AppDefType.ChatPushMessageKey.roomType);
// return Integer.toString(roomType);
return "";
} catch (Exception e){
return "";
}
}
public String getPushSendLoginId() {
try {
return jsonObject.getString(AppDefType.ChatPushMessageKey.pushSendLoginId);
} catch (Exception e) {
return "";
}
}
public long getPushSendDate() {
try {
return jsonObject.getLong(AppDefType.ChatPushMessageKey.pushSendDate);
} catch (Exception e) {
return 0;
}
}
}
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 {
try {
AcmsClient
.getInstance(ABVEnvironment.getInstance().networkAdapter)
.finishAllCollaboration(sid, roomId.intValue());
} catch (AcmsException e) {
e.printStackTrace();
}
}
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;
}
}
...@@ -50,6 +50,8 @@ public class ABVUIDataCache { ...@@ -50,6 +50,8 @@ public class ABVUIDataCache {
*/ */
public String visibleActivityName = null; public String visibleActivityName = null;
//チャット用プッシュメッセージからの作業一覧なのか判断フラグ
public boolean isChatPushMessageOpenOperationList = false;
public ABVUIDataCache(Context context) { public ABVUIDataCache(Context context) {
this.context = context; this.context = context;
......
package jp.agentec.abook.abv.ui.common.activity; package jp.agentec.abook.abv.ui.common.activity;
import android.app.Activity;
import android.app.Dialog; import android.app.Dialog;
import android.app.ProgressDialog; import android.app.ProgressDialog;
import android.content.ActivityNotFoundException; import android.content.ActivityNotFoundException;
...@@ -38,6 +39,7 @@ import java.nio.charset.StandardCharsets; ...@@ -38,6 +39,7 @@ import java.nio.charset.StandardCharsets;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
...@@ -52,6 +54,7 @@ import jp.agentec.abook.abv.bl.common.Callback; ...@@ -52,6 +54,7 @@ import jp.agentec.abook.abv.bl.common.Callback;
import jp.agentec.abook.abv.bl.common.CommonExecutor; import jp.agentec.abook.abv.bl.common.CommonExecutor;
import jp.agentec.abook.abv.bl.common.Constant; import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.Constant.AlertMessageLevel; import jp.agentec.abook.abv.bl.common.Constant.AlertMessageLevel;
import jp.agentec.abook.abv.bl.common.constant.ABookCommConstants;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys; import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.exception.ABVException; import jp.agentec.abook.abv.bl.common.exception.ABVException;
import jp.agentec.abook.abv.bl.common.exception.ABVExceptionCode; import jp.agentec.abook.abv.bl.common.exception.ABVExceptionCode;
...@@ -81,6 +84,7 @@ import jp.agentec.abook.abv.bl.dto.TaskDto; ...@@ -81,6 +84,7 @@ import jp.agentec.abook.abv.bl.dto.TaskDto;
import jp.agentec.abook.abv.bl.dto.TaskReportDto; import jp.agentec.abook.abv.bl.dto.TaskReportDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic; import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.BookmarkLogic; import jp.agentec.abook.abv.bl.logic.BookmarkLogic;
import jp.agentec.abook.abv.bl.logic.CommunicationLogic;
import jp.agentec.abook.abv.bl.logic.ContractLogic; import jp.agentec.abook.abv.bl.logic.ContractLogic;
import jp.agentec.abook.abv.bl.logic.MemoLogic; import jp.agentec.abook.abv.bl.logic.MemoLogic;
import jp.agentec.abook.abv.bl.logic.OperationGroupMasterLogic; import jp.agentec.abook.abv.bl.logic.OperationGroupMasterLogic;
...@@ -88,6 +92,7 @@ import jp.agentec.abook.abv.bl.logic.OperationLogic; ...@@ -88,6 +92,7 @@ import jp.agentec.abook.abv.bl.logic.OperationLogic;
import jp.agentec.abook.abv.bl.logic.PushMessageLogic; import jp.agentec.abook.abv.bl.logic.PushMessageLogic;
import jp.agentec.abook.abv.bl.logic.UserAuthenticateLogic; import jp.agentec.abook.abv.bl.logic.UserAuthenticateLogic;
import jp.agentec.abook.abv.cl.helper.ABVUncaughtExceptionHandler; import jp.agentec.abook.abv.cl.helper.ABVUncaughtExceptionHandler;
import jp.agentec.abook.abv.cl.push.PushMessageJSON;
import jp.agentec.abook.abv.cl.util.PreferenceUtil; import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.cl.util.StorageUtil; import jp.agentec.abook.abv.cl.util.StorageUtil;
import jp.agentec.abook.abv.launcher.android.ABVApplication; import jp.agentec.abook.abv.launcher.android.ABVApplication;
...@@ -108,9 +113,11 @@ import jp.agentec.abook.abv.ui.common.util.KeyboardUtils; ...@@ -108,9 +113,11 @@ import jp.agentec.abook.abv.ui.common.util.KeyboardUtils;
import jp.agentec.abook.abv.ui.common.util.PatternStringUtil; import jp.agentec.abook.abv.ui.common.util.PatternStringUtil;
import jp.agentec.abook.abv.ui.common.view.ABVBatchSyncView; import jp.agentec.abook.abv.ui.common.view.ABVBatchSyncView;
import jp.agentec.abook.abv.ui.common.vo.Size; import jp.agentec.abook.abv.ui.common.vo.Size;
import jp.agentec.abook.abv.ui.home.activity.ChatWebViewActivity;
import jp.agentec.abook.abv.ui.home.activity.HelpActivity; import jp.agentec.abook.abv.ui.home.activity.HelpActivity;
import jp.agentec.abook.abv.ui.home.activity.LoginActivity; import jp.agentec.abook.abv.ui.home.activity.LoginActivity;
import jp.agentec.abook.abv.ui.home.activity.OperationListActivity; import jp.agentec.abook.abv.ui.home.activity.OperationListActivity;
import jp.agentec.abook.abv.ui.home.activity.OperationRelatedContentActivity;
import jp.agentec.abook.abv.ui.home.adapter.FixPushMessageAdapter; import jp.agentec.abook.abv.ui.home.adapter.FixPushMessageAdapter;
import jp.agentec.abook.abv.ui.home.adapter.OperationSelectAdapter; import jp.agentec.abook.abv.ui.home.adapter.OperationSelectAdapter;
import jp.agentec.abook.abv.ui.home.adapter.PushMessageListAdapter; import jp.agentec.abook.abv.ui.home.adapter.PushMessageListAdapter;
...@@ -135,6 +142,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -135,6 +142,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
protected BookmarkLogic bookmarkLogic = AbstractLogic.getLogic(BookmarkLogic.class); protected BookmarkLogic bookmarkLogic = AbstractLogic.getLogic(BookmarkLogic.class);
protected ContentDownloader contentDownloader = ContentDownloader.getInstance(); protected ContentDownloader contentDownloader = ContentDownloader.getInstance();
protected ContentRefresher contentRefresher = ContentRefresher.getInstance(); protected ContentRefresher contentRefresher = ContentRefresher.getInstance();
private final CommunicationLogic communicationLogic = AbstractLogic.getLogic(CommunicationLogic.class);
private ExecutorService initilizeExecutor = Executors.newFixedThreadPool(2); // DL後の初期化専用 private ExecutorService initilizeExecutor = Executors.newFixedThreadPool(2); // DL後の初期化専用
...@@ -187,6 +195,10 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -187,6 +195,10 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
int PAYMENT = 3; int PAYMENT = 3;
} }
// 遷移元のアクティビティ名
// PushMessage受信時に直接ChatRoomへ行かずに、ひとつまえのActivityに戻る為に使用する。
public String baseActivityName;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
...@@ -837,6 +849,10 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -837,6 +849,10 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
* コミュニケーションメニューダイアログ * コミュニケーションメニューダイアログ
*/ */
public void showCommunicationMenuDialog() { public void showCommunicationMenuDialog() {
if (mCommunicationMenuDialog != null) {
// すでに作成されている場合はなにもしない
return;
}
mCommunicationMenuDialog = new Dialog(this); mCommunicationMenuDialog = new Dialog(this);
mCommunicationMenuDialog.requestWindowFeature(Window.FEATURE_NO_TITLE); mCommunicationMenuDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
mCommunicationMenuDialog.setCanceledOnTouchOutside(false); mCommunicationMenuDialog.setCanceledOnTouchOutside(false);
...@@ -865,7 +881,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -865,7 +881,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
@Override @Override
public void onClick(View view) { public void onClick(View view) {
ActivityHandlingHelper.getInstance().startMeetingActivity(); ActivityHandlingHelper.getInstance().startMeetingActivity();
mCommunicationMenuDialog.dismiss(); finishCommunicationMenuDialog();
} }
}); });
...@@ -874,7 +890,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -874,7 +890,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
@Override @Override
public void onClick(View view) { public void onClick(View view) {
showOperationSelectDialog(); showOperationSelectDialog();
mCommunicationMenuDialog.dismiss(); finishCommunicationMenuDialog();
} }
}); });
...@@ -883,18 +899,26 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -883,18 +899,26 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
@Override @Override
public void onClick(View view) { public void onClick(View view) {
showPushMessageListDialog(); showPushMessageListDialog();
mCommunicationMenuDialog.dismiss(); finishCommunicationMenuDialog();
} }
}); });
// chat // chat
LinearLayout ll_menuItem_chat = (LinearLayout)mCommunicationMenuDialog.findViewById(R.id.ll_item_chat); LinearLayout ll_menuItem_chat = (LinearLayout)mCommunicationMenuDialog.findViewById(R.id.ll_item_chat);
if (ABVDataCache.getInstance().serviceOption.isChat()) { if (ABVDataCache.getInstance().serviceOption.isChat()) {
final Activity baseActivity = this;
ll_menuItem_chat.setOnClickListener(new View.OnClickListener() { ll_menuItem_chat.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
ActivityHandlingHelper.getInstance().startChatWebViewActivity(); // 戻り先
mCommunicationMenuDialog.dismiss(); String targetActivityName;
if (baseActivity instanceof OperationListActivity) {
targetActivityName = OperationListActivity.class.getName();
} else {
targetActivityName = OperationRelatedContentActivity.class.getName();
}
ActivityHandlingHelper.getInstance().startChatWebViewActivity(new Long(0),"", ChatWebViewActivity.class.getName(), targetActivityName);
finishCommunicationMenuDialog();
} }
}); });
} else { } else {
...@@ -904,13 +928,23 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -904,13 +928,23 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
mCommunicationMenuDialog.findViewById(R.id.close_btn).setOnClickListener(new View.OnClickListener() { mCommunicationMenuDialog.findViewById(R.id.close_btn).setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
mCommunicationMenuDialog.dismiss(); finishCommunicationMenuDialog();
} }
}); });
mCommunicationMenuDialog.show(); mCommunicationMenuDialog.show();
} }
/**
* コミュニケーションダイアログ閉じる
*/
private void finishCommunicationMenuDialog() {
if (mCommunicationMenuDialog != null) {
mCommunicationMenuDialog.dismiss();
mCommunicationMenuDialog = null;
}
}
private void showOperationSelectDialog() { private void showOperationSelectDialog() {
OperationDao operationDao = AbstractDao.getDao(OperationDao.class); OperationDao operationDao = AbstractDao.getDao(OperationDao.class);
mOperationSelectDialog = new Dialog(this); mOperationSelectDialog = new Dialog(this);
...@@ -965,10 +999,10 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -965,10 +999,10 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
@Override @Override
public void onDetailView(final PushMessageDto dto) { public void onDetailView(final PushMessageDto dto) {
if(dto.roomName != null && dto.roomId != 0) if(dto.roomName != null && dto.roomId != 0) {
{
pushMessageLogic.updateReadingFlg(dto.pushMessageId); pushMessageLogic.updateReadingFlg(dto.pushMessageId);
ActivityHandlingHelper.getInstance().startChatWebViewActivityWithPushMessage(dto); String collaborationType = communicationLogic.getCollaborationType(dto.pushMessage);
ActivityHandlingHelper.getInstance().startChatWebViewActivityWithPushMessage(dto, collaborationType);
mPushMessageListDialog.dismiss(); mPushMessageListDialog.dismiss();
} else { } else {
showPushMessageDetailView(dto); showPushMessageDetailView(dto);
...@@ -1267,7 +1301,13 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -1267,7 +1301,13 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
return existUnreadFlg; return existUnreadFlg;
} }
/**
* 作業データ更新処理
* @param operationId 作業ID
* @param reportType 作業タイプ
* @param buttonEventFlag ボタンイベントフラグ
* @return エラー文言
*/
public String syncOperation(final long operationId, int reportType, boolean buttonEventFlag) { public String syncOperation(final long operationId, int reportType, boolean buttonEventFlag) {
final StringBuilder errorMsg = new StringBuilder(); final StringBuilder errorMsg = new StringBuilder();
Logger.i(TAG, "---sync start"); Logger.i(TAG, "---sync start");
...@@ -1550,7 +1590,39 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -1550,7 +1590,39 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
} }
return false; return false;
} }
/**
* プッシュメッセージがあるので、チャットルームに遷移する。
*/
public boolean goChatRoom(final Intent intent, final String targetActivityName, final String baseActivityName) {
if (!StringUtil.isNullOrEmpty(intent.getStringExtra(AppDefType.ChatPushMessageKey.roomName)) &&
intent.getLongExtra(AppDefType.ChatPushMessageKey.roomId, '0') != 0) {
handler.postDelayed(new Runnable() {
@Override
public void run() {
if (StringUtil.isNullOrEmpty(intent.getStringExtra(AppDefType.ChatPushMessageKey.collaborationType))) {
ActivityHandlingHelper.getInstance().startChatWebViewActivity(
intent.getLongExtra(AppDefType.ChatPushMessageKey.roomId, '0'),
intent.getStringExtra(AppDefType.ChatPushMessageKey.roomName),
targetActivityName,
baseActivityName);
} else {
// roomTypeと、collaborationType が存在する場合は、協業を開始する。
ActivityHandlingHelper.getInstance().startChatWebViewActivityWithCollaboration(
intent.getLongExtra(AppDefType.ChatPushMessageKey.roomId, '0'),
intent.getStringExtra(AppDefType.ChatPushMessageKey.roomName),
intent.getStringExtra(AppDefType.ChatPushMessageKey.collaborationType),
intent.getStringExtra(AppDefType.ChatPushMessageKey.roomType),
targetActivityName,
baseActivityName);
}
}
}, 500);
setIntent(new Intent());
return true;
}
return false;
}
/** /**
* listDtoの中に第2引数のdtoが存在するかチェックメソッド * listDtoの中に第2引数のdtoが存在するかチェックメソッド
...@@ -1642,4 +1714,40 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -1642,4 +1714,40 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
} }
} }
/**
* プッシュメッセージ受信後のダイアログを表示する。
* @param context コンテキスト
* @param messageMap プッシュメッセージ
*/
public void showChatRoomPopupMessage(Context context, Map<String, String> messageMap) {
String messageBody = messageMap.get(AppDefType.PushMessageKey.message);
if (StringUtil.isNullOrEmpty(messageBody)) {
return;
}
PushMessageJSON json = new PushMessageJSON(messageBody);
// 協業
String messageText = json.getMessage();
Intent pushMsgDialog = new Intent(context, ShowPushMessageDailogActivity.class);
pushMsgDialog.putExtra(AppDefType.PushMessageKey.message, messageText);
pushMsgDialog.putExtra(AppDefType.PushMessageKey.data, json.getData());
pushMsgDialog.putExtra(AppDefType.PushMessageKey.operationId, json.getOperationID());
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomId, json.getRoomId());
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomName, json.getRoomName());
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendLoginId, json.getPushSendLoginId());
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendDate, json.getPushSendDate());
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomType, json.getRoomType());
String collaborationType = communicationLogic.getCollaborationType(messageText);
if (collaborationType != null) {
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.collaborationType, collaborationType);
}
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.baseActivityName, messageMap.get(AppDefType.ChatPushMessageKey.baseActivityName));
String newVersion = messageMap.get(AppDefType.ChatPushMessageKey.needsDisplayOperationOrOperationRelatedContentScreen);
if (newVersion != null && newVersion.equals(new String("true"))) {
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.needsDisplayOperationOrOperationRelatedContentScreen, true);
} else {
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.needsDisplayOperationOrOperationRelatedContentScreen, false);
}
startActivityForResult(pushMsgDialog, ABookCommConstants.PUSH_MESSAGE_DLG_REQUEST_CODE);
}
} }
...@@ -17,7 +17,6 @@ import android.view.View; ...@@ -17,7 +17,6 @@ import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.AdapterView; import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener; import android.widget.AdapterView.OnItemClickListener;
import android.widget.Button;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
...@@ -71,7 +70,6 @@ import jp.agentec.abook.abv.ui.common.util.ABVToastUtil; ...@@ -71,7 +70,6 @@ import jp.agentec.abook.abv.ui.common.util.ABVToastUtil;
import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil; import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
import jp.agentec.abook.abv.ui.common.util.PatternStringUtil; import jp.agentec.abook.abv.ui.common.util.PatternStringUtil;
import jp.agentec.abook.abv.ui.common.view.ABVPopupListWindow; import jp.agentec.abook.abv.ui.common.view.ABVPopupListWindow;
import jp.agentec.abook.abv.ui.home.activity.ChatWebViewActivity;
import jp.agentec.abook.abv.ui.home.helper.ABookCheckWebViewHelper; import jp.agentec.abook.abv.ui.home.helper.ABookCheckWebViewHelper;
import jp.agentec.abook.abv.ui.home.helper.ABookPermissionHelper; import jp.agentec.abook.abv.ui.home.helper.ABookPermissionHelper;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper; import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
...@@ -92,9 +90,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -92,9 +90,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
protected static GroupLogic groupLogic = AbstractLogic.getLogic(GroupLogic.class); protected static GroupLogic groupLogic = AbstractLogic.getLogic(GroupLogic.class);
private static final String TAG ="ABVContentViewActivity"; private static final String TAG ="ABVContentViewActivity";
public final static int ABOOK_CHECK_TASK_IMAGE = 103;
public final static int ABOOK_CHECK_TASK_VIDEO = 104;
protected final static int ABOOK_CHECK_SELECT_SCENE = 105;
protected long contentId;// 表示中のコンテンツID protected long contentId;// 表示中のコンテンツID
protected long objectId; // オブジェクトID(オブジェクト用のActivityのときのみ使用) protected long objectId; // オブジェクトID(オブジェクト用のActivityのときのみ使用)
...@@ -168,6 +163,9 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -168,6 +163,9 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
isLinkedContent = intent.getBooleanExtra("isLinkedContent", false); isLinkedContent = intent.getBooleanExtra("isLinkedContent", false);
mOperationId = intent.getLongExtra(ABookKeys.OPERATION_ID, -1); mOperationId = intent.getLongExtra(ABookKeys.OPERATION_ID, -1);
// 戻り先のActivity名を保存しておく
baseActivityName = getIntent().getStringExtra(AppDefType.ChatPushMessageKey.baseActivityName);
if (!isLinkedContent) { if (!isLinkedContent) {
operationDto = AbstractLogic.getLogic(OperationLogic.class).getOperation(mOperationId); operationDto = AbstractLogic.getLogic(OperationLogic.class).getOperation(mOperationId);
mXWalkOpenType = intent.getIntExtra(Constant.ABookCheck.XWALK_OPEN_TYPE, Constant.XWalkOpenType.DEFAULT); mXWalkOpenType = intent.getIntExtra(Constant.ABookCheck.XWALK_OPEN_TYPE, Constant.XWalkOpenType.DEFAULT);
......
...@@ -390,7 +390,10 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity { ...@@ -390,7 +390,10 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity {
intent.putExtra(AppDefType.ChatPushMessageKey.roomId, extras.getLong(AppDefType.ChatPushMessageKey.roomId)); // Room Id intent.putExtra(AppDefType.ChatPushMessageKey.roomId, extras.getLong(AppDefType.ChatPushMessageKey.roomId)); // Room Id
intent.putExtra(AppDefType.ChatPushMessageKey.roomName, extras.getString(AppDefType.ChatPushMessageKey.roomName)); // Room Name intent.putExtra(AppDefType.ChatPushMessageKey.roomName, extras.getString(AppDefType.ChatPushMessageKey.roomName)); // Room Name
intent.putExtra(AppDefType.ChatPushMessageKey.pushSendLoginId, extras.getString(AppDefType.ChatPushMessageKey.pushSendLoginId)); // sendLoginId intent.putExtra(AppDefType.ChatPushMessageKey.pushSendLoginId, extras.getString(AppDefType.ChatPushMessageKey.pushSendLoginId)); // sendLoginId
intent.putExtra(AppDefType.ChatPushMessageKey.pushSendDate, extras.getString(AppDefType.ChatPushMessageKey.pushSendDate)); intent.putExtra(AppDefType.ChatPushMessageKey.pushSendDate, extras.getLong(AppDefType.ChatPushMessageKey.pushSendDate));
intent.putExtra(AppDefType.ChatPushMessageKey.roomType, extras.getString(AppDefType.ChatPushMessageKey.roomType));
intent.putExtra(AppDefType.ChatPushMessageKey.collaborationType, extras.getString(AppDefType.ChatPushMessageKey.collaborationType));
getABVUIDataCache().isChatPushMessageOpenOperationList = true;
} }
} }
intent.setClassName(getApplicationContext().getPackageName(), getMainActivityClassName()).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.setClassName(getApplicationContext().getPackageName(), getMainActivityClassName()).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
......
...@@ -3,15 +3,12 @@ package jp.agentec.abook.abv.ui.common.activity; ...@@ -3,15 +3,12 @@ package jp.agentec.abook.abv.ui.common.activity;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.os.Bundle; import android.os.Bundle;
import java.util.Date; import jp.agentec.abook.abv.bl.common.constant.ABookCommConstants;
import java.util.List;
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.OperationDto; import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.bl.dto.PushMessageDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic; import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.OperationLogic; import jp.agentec.abook.abv.bl.logic.OperationLogic;
import jp.agentec.abook.abv.bl.logic.PushMessageLogic; import jp.agentec.abook.abv.bl.websocket.MeetingManager;
import jp.agentec.abook.abv.launcher.android.R; import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.PushMessageKey; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.PushMessageKey;
...@@ -19,16 +16,17 @@ import jp.agentec.abook.abv.ui.common.constant.ErrorMessage; ...@@ -19,16 +16,17 @@ 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.dialog.ABookAlertDialog;
import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil; import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
import jp.agentec.abook.abv.ui.common.util.PatternStringUtil; import jp.agentec.abook.abv.ui.common.util.PatternStringUtil;
import jp.agentec.abook.abv.ui.home.activity.ChatWebViewActivity;
import jp.agentec.abook.abv.ui.home.activity.OperationListActivity; import jp.agentec.abook.abv.ui.home.activity.OperationListActivity;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper; import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.StringUtil; import jp.agentec.adf.util.StringUtil;
public class ShowPushMessageDailogActivity extends ABVUIActivity { public class ShowPushMessageDailogActivity extends ABVUIActivity {
private static final String TAG = "ShowPushMessageDailogActivity"; private static final String TAG = "ShowPushMessageDailogActivity";
OperationLogic mOperationLogic = AbstractLogic.getLogic(OperationLogic.class); OperationLogic mOperationLogic = AbstractLogic.getLogic(OperationLogic.class);
boolean isMeetingRoomConnected = false;
boolean isCollabration = false;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
...@@ -112,7 +110,9 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity { ...@@ -112,7 +110,9 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity {
alertDialog.show(); alertDialog.show();
} else { } else {
final ABookAlertDialog alertDialog = AlertDialogUtil.createAlertDialog(ShowPushMessageDailogActivity.this, getRString(R.string.app_name), getIntent().getExtras().getString(PushMessageKey.message)); final ABookAlertDialog alertDialog = AlertDialogUtil.createAlertDialog(ShowPushMessageDailogActivity.this,
getRString(R.string.app_name),
getIntent().getExtras().getString(PushMessageKey.message));
Bundle extras = getIntent().getExtras(); Bundle extras = getIntent().getExtras();
Long roomId = extras.getLong(AppDefType.ChatPushMessageKey.roomId, 0); Long roomId = extras.getLong(AppDefType.ChatPushMessageKey.roomId, 0);
if (roomId == 0) { if (roomId == 0) {
...@@ -121,56 +121,96 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity { ...@@ -121,56 +121,96 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity {
alertDialog.setPositiveButton(R.string.move, new DialogInterface.OnClickListener() { alertDialog.setPositiveButton(R.string.move, new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
// Check PushMessage isMeetingRoomConnected = MeetingManager.getInstance().isConnected();
isCollabration = MeetingManager.getInstance().isCollaboration();
Bundle extras = getIntent().getExtras(); Bundle extras = getIntent().getExtras();
if (isMeetingRoomConnected || isCollabration) {
showCannotMoveChatRoomDialog();
} else {
if (extras != null) { if (extras != null) {
Long roomId = extras.getLong(AppDefType.ChatPushMessageKey.roomId, 0); boolean isNewVersion = extras.getBoolean(AppDefType.ChatPushMessageKey.needsDisplayOperationOrOperationRelatedContentScreen);
String roomName = extras.getString(AppDefType.ChatPushMessageKey.roomName); if (isNewVersion) {
String pushSendLoginId = extras.getString(AppDefType.ChatPushMessageKey.pushSendLoginId); setResult(ABookCommConstants.PUSH_MESSAGE_DLG_RESULT.OK, getIntent());
long pushSendDate = extras.getLong(AppDefType.ChatPushMessageKey.pushSendDate);
String collaborationType = extras.getString(AppDefType.ChatPushMessageKey.collaborationType);
String roomType = extras.getString(AppDefType.ChatPushMessageKey.roomType);
if (roomId > 0 && !StringUtil.isNullOrEmpty(roomName)) {
List<PushMessageDto> pushMessageDtoList = AbstractLogic.getLogic(PushMessageLogic.class).getAllPushMessageList();
Logger.d("pushSendDate", "pushSendDate : " + pushSendDate);
String pushSendDateDate = DateTimeUtil.toString(new Date(pushSendDate), DateTimeFormat.yyyyMMddHHmmssSSS_none);
Logger.d("pushSendDate", "pushSendDateDate : " + pushSendDateDate);
String pushSendDateDate2 = DateTimeUtil.toString(DateTimeUtil.toDate(pushSendDateDate, DateTimeFormat.yyyyMMddHHmmssSSS_none), DateTimeFormat.yyyyMMddHHmmssSSS_none);
Logger.d("pushSendDate", "pushSendDateDate2 : " + pushSendDateDate2);
for (int i = 0; i < pushMessageDtoList.size() - 1; i++) {
String tempDate = DateTimeUtil.toString(pushMessageDtoList.get(i).pushSendDate, DateTimeFormat.yyyyMMddHHmmssSSS_none);
Logger.d("tempDate", "date : " + tempDate);
}
if (StringUtil.isNullOrEmpty(collaborationType)) {
ActivityHandlingHelper.getInstance().startChatWebViewActivity(roomId, roomName);
} else { } else {
ActivityHandlingHelper.getInstance().startChatWebViewActivityWithCollaboration(roomId, roomName, collaborationType, roomType); moveChatRoom(extras);
} }
} }
} }
finish(); dialog.dismiss();
} }
}); });
alertDialog.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { alertDialog.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
finish(); setResult(ABookCommConstants.PUSH_MESSAGE_DLG_RESULT.CANCEL, getIntent());
dialog.dismiss();
} }
}); });
}
alertDialog.setOnDismissListener(new DialogInterface.OnDismissListener() { alertDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override @Override
public void onDismiss(DialogInterface dialog) { public void onDismiss(DialogInterface dialog) {
finish(); finish();
} }
}); });
}
alertDialog.show(); alertDialog.show();
} }
} }
} }
/**
* チャットルームへ遷移するための処理
* @param extras
*/
private void moveChatRoom(Bundle extras) {
Long roomId = extras.getLong(AppDefType.ChatPushMessageKey.roomId, 0);
String roomName = extras.getString(AppDefType.ChatPushMessageKey.roomName);
String collaborationType = extras.getString(AppDefType.ChatPushMessageKey.collaborationType);
String roomType = extras.getString(AppDefType.ChatPushMessageKey.roomType);
if (roomId > 0 && !StringUtil.isNullOrEmpty(roomName)) {
ChatWebViewActivity chatWebViewActivity= activityHandlingHelper.getChatWebViewActivity();
if (chatWebViewActivity != null) {
chatWebViewActivity.reloadRoomViewCollaboration(roomId, roomName, collaborationType);
} else {
if (StringUtil.isNullOrEmpty(collaborationType)) {
ActivityHandlingHelper.getInstance().startChatWebViewActivity(roomId, roomName, ChatWebViewActivity.class.getName(),"");
} else {
ActivityHandlingHelper.getInstance().startChatWebViewActivityWithCollaboration(roomId,
roomName,
collaborationType,
roomType,
ChatWebViewActivity.class.getName(),
"");
}
}
}
}
/**
* 遠隔支援中(会議室接続中)はチャットルームにはいけない。
*/
private void showCannotMoveChatRoomDialog() {
handler.post(new Runnable() {
@Override
public void run() {
String dialogMessage = null;
if (isCollabration) {
dialogMessage = getRString(R.string.chat_open_fail_collaborattion_connected);
} else if (isMeetingRoomConnected) {
dialogMessage = getRString(R.string.chat_open_fail_meeting_connected);
}
final ABookAlertDialog alertDialog = AlertDialogUtil.createAlertDialog(ShowPushMessageDailogActivity.this,
getRString(R.string.app_name),
dialogMessage);
alertDialog.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
setResult(ABookCommConstants.PUSH_MESSAGE_DLG_RESULT.CANCEL, getIntent());
finish();
}
});
alertDialog.show();
}
});
}
} }
...@@ -145,5 +145,9 @@ public interface AppDefType { ...@@ -145,5 +145,9 @@ public interface AppDefType {
String pushSendDate = "pushSendDate"; String pushSendDate = "pushSendDate";
String collaborationType = "collaborationType"; String collaborationType = "collaborationType";
String roomType = "roomType"; String roomType = "roomType";
String shopName = "shopName";
String loginId = "loginId";
String baseActivityName = "baseActivityName";
String needsDisplayOperationOrOperationRelatedContentScreen = "needsDisplayOperationOrOperationRelatedContentScreen";
} }
} }
package jp.agentec.abook.abv.ui.common.util; package jp.agentec.abook.abv.ui.common.util;
import android.content.Context; import android.content.Context;
import android.os.Build;
import android.os.Handler; import android.os.Handler;
import android.view.Gravity; import android.view.Gravity;
import android.widget.Toast; import android.widget.Toast;
...@@ -43,7 +44,9 @@ public class ABVToastUtil { ...@@ -43,7 +44,9 @@ public class ABVToastUtil {
} else { } else {
sToast = Toast.makeText(context.getApplicationContext(), text, duration); sToast = Toast.makeText(context.getApplicationContext(), text, duration);
} }
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
sToast.setGravity(gravity, 0, 0); sToast.setGravity(gravity, 0, 0);
}
sToast.show(); sToast.show();
} }
}); });
......
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.activity; package jp.agentec.abook.abv.ui.home.activity;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences.Editor;
import android.os.Build;
import android.os.Bundle;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnKeyListener;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.TranslateAnimation;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.Toast;
import jp.agentec.abook.abv.bl.acms.client.json.CmsUrlJSON; import jp.agentec.abook.abv.bl.acms.client.json.CmsUrlJSON;
import jp.agentec.abook.abv.bl.acms.type.DeleteDataType; import jp.agentec.abook.abv.bl.acms.type.DeleteDataType;
import jp.agentec.abook.abv.bl.acms.type.LoginMode; import jp.agentec.abook.abv.bl.acms.type.LoginMode;
...@@ -41,24 +60,6 @@ import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog; ...@@ -41,24 +60,6 @@ import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog;
import jp.agentec.abook.abv.ui.common.helper.ABVViewUnbindHelper; import jp.agentec.abook.abv.ui.common.helper.ABVViewUnbindHelper;
import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil; import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
import jp.agentec.adf.util.StringUtil; import jp.agentec.adf.util.StringUtil;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.Bundle;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnKeyListener;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.TranslateAnimation;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.Toast;
/** /**
* @author Minhyuk Seok * @author Minhyuk Seok
...@@ -701,7 +702,9 @@ public class LoginActivity extends ABVLoginActivity { ...@@ -701,7 +702,9 @@ public class LoginActivity extends ABVLoginActivity {
clickCount++; clickCount++;
if (clickCount >= 10) { if (clickCount >= 10) {
Toast t = Toast.makeText(getApplicationContext(), getResources().getString(R.string.acms_address), Toast.LENGTH_LONG); Toast t = Toast.makeText(getApplicationContext(), getResources().getString(R.string.acms_address), Toast.LENGTH_LONG);
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
t.setGravity(Gravity.TOP, 0, 0); t.setGravity(Gravity.TOP, 0, 0);
}
t.show(); t.show();
clickCount = 0; clickCount = 0;
} }
......
...@@ -7,8 +7,6 @@ import android.content.Intent; ...@@ -7,8 +7,6 @@ import android.content.Intent;
import android.content.res.Configuration; import android.content.res.Configuration;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.Gravity; import android.view.Gravity;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.View; import android.view.View;
...@@ -41,7 +39,6 @@ import java.util.Calendar; ...@@ -41,7 +39,6 @@ import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.Stack; import java.util.Stack;
...@@ -57,6 +54,7 @@ import jp.agentec.abook.abv.bl.common.CommonExecutor; ...@@ -57,6 +54,7 @@ import jp.agentec.abook.abv.bl.common.CommonExecutor;
import jp.agentec.abook.abv.bl.common.Constant; import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.Constant.ReportType; import jp.agentec.abook.abv.bl.common.Constant.ReportType;
import jp.agentec.abook.abv.bl.common.Constant.TaskReportLevel; import jp.agentec.abook.abv.bl.common.Constant.TaskReportLevel;
import jp.agentec.abook.abv.bl.common.constant.ABookCommConstants;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys; import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.exception.ABVException; import jp.agentec.abook.abv.bl.common.exception.ABVException;
import jp.agentec.abook.abv.bl.common.exception.ABVExceptionCode; import jp.agentec.abook.abv.bl.common.exception.ABVExceptionCode;
...@@ -78,20 +76,14 @@ import jp.agentec.abook.abv.bl.dto.OperationGroupMasterDto; ...@@ -78,20 +76,14 @@ import jp.agentec.abook.abv.bl.dto.OperationGroupMasterDto;
import jp.agentec.abook.abv.bl.dto.TaskDto; import jp.agentec.abook.abv.bl.dto.TaskDto;
import jp.agentec.abook.abv.bl.dto.TaskReportDto; import jp.agentec.abook.abv.bl.dto.TaskReportDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic; import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.ApertureMasterDataLogic;
import jp.agentec.abook.abv.bl.logic.CategoryLogic;
import jp.agentec.abook.abv.bl.logic.ContractLogic;
import jp.agentec.abook.abv.bl.logic.GroupLogic;
import jp.agentec.abook.abv.bl.logic.OperationGroupMasterLogic; import jp.agentec.abook.abv.bl.logic.OperationGroupMasterLogic;
import jp.agentec.abook.abv.bl.logic.OperationLogic; import jp.agentec.abook.abv.bl.logic.OperationLogic;
import jp.agentec.abook.abv.bl.logic.PushMessageLogic; import jp.agentec.abook.abv.bl.logic.PushMessageLogic;
import jp.agentec.abook.abv.cl.util.PreferenceUtil; import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.launcher.android.R; import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.util.LogUtil;
import jp.agentec.abook.abv.ui.viewer.activity.OnlineHTMLWebViewActivity;
import jp.agentec.abook.abv.ui.common.activity.ABVUIActivity; import jp.agentec.abook.abv.ui.common.activity.ABVUIActivity;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.OperationLocationType;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.OperationLocationType;
import jp.agentec.abook.abv.ui.common.constant.ErrorCode; 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;
...@@ -110,6 +102,7 @@ import jp.agentec.abook.abv.ui.home.helper.OperationGroupMasterListHelper; ...@@ -110,6 +102,7 @@ import jp.agentec.abook.abv.ui.home.helper.OperationGroupMasterListHelper;
import jp.agentec.abook.abv.ui.home.helper.OperationListHelper; import jp.agentec.abook.abv.ui.home.helper.OperationListHelper;
import jp.agentec.abook.abv.ui.viewer.activity.DeviceImageListActivity; import jp.agentec.abook.abv.ui.viewer.activity.DeviceImageListActivity;
import jp.agentec.abook.abv.ui.viewer.activity.HTMLXWalkWebViewActivity; import jp.agentec.abook.abv.ui.viewer.activity.HTMLXWalkWebViewActivity;
import jp.agentec.abook.abv.ui.viewer.activity.OnlineHTMLWebViewActivity;
import jp.agentec.adf.util.DateTimeFormat; import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil; import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.FileUtil; import jp.agentec.adf.util.FileUtil;
...@@ -169,7 +162,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -169,7 +162,7 @@ public class OperationListActivity extends ABVUIActivity {
setContentView(R.layout.chat_webview); setContentView(R.layout.chat_webview);
mCheckWebView = findViewById(R.id.chatWebview2); mCheckWebView = findViewById(R.id.chatWebview);
mCheckWebView.setOverScrollMode(View.OVER_SCROLL_NEVER); //オーバースクロールしない。 mCheckWebView.setOverScrollMode(View.OVER_SCROLL_NEVER); //オーバースクロールしない。
mCheckWebView.setVerticalScrollBarEnabled(false); //スクロールバーを消す。 mCheckWebView.setVerticalScrollBarEnabled(false); //スクロールバーを消す。
mCheckWebView.addJavascriptInterface(jsInf, "android"); mCheckWebView.addJavascriptInterface(jsInf, "android");
...@@ -208,39 +201,67 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -208,39 +201,67 @@ public class OperationListActivity extends ABVUIActivity {
if (!StringUtil.isNullOrEmpty(getIntent().getStringExtra(AppDefType.PushMessageKey.operationId))) { if (!StringUtil.isNullOrEmpty(getIntent().getStringExtra(AppDefType.PushMessageKey.operationId))) {
final long operationId = Long.parseLong(getIntent().getStringExtra(AppDefType.PushMessageKey.operationId)); final long operationId = Long.parseLong(getIntent().getStringExtra(AppDefType.PushMessageKey.operationId));
String message = getIntent().getStringExtra(AppDefType.PushMessageKey.message); String message = getIntent().getStringExtra(AppDefType.PushMessageKey.message);
if (operationId > 0) { if (operationId < 1) { return; }
final ABookAlertDialog alertDialog = AlertDialogUtil.createAlertDialog(this, getRString(R.string.app_name), message); final ABookAlertDialog alertDialog = AlertDialogUtil.createAlertDialog(this, getRString(R.string.app_name), message);
// リソースパターンの適用 // リソースパターンの適用
alertDialog.setPositiveButton(PatternStringUtil.patternToInt(getApplicationContext(), R.string.work_report, getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)), alertDialog.setPositiveButton(PatternStringUtil.patternToInt(
getApplicationContext(),
R.string.work_report,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)
),
new DialogInterface.OnClickListener() { new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int whichButton) { public void onClick(DialogInterface dialog, int whichButton) {
if (contentRefresher.isRefreshing()) { if (contentRefresher.isRefreshing()) {
// リソースパターンの適用 // リソースパターンの適用
ErrorMessage.showErrorMessageToast(OperationListActivity.this, PatternStringUtil.patternToInt(getApplicationContext(), ErrorMessage.showErrorMessageToast(
OperationListActivity.this,
PatternStringUtil.patternToInt(
getApplicationContext(),
R.string.msg_routineTask_report_disable_refreshing, R.string.msg_routineTask_report_disable_refreshing,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)
)
);
} else if(ActivityHandlingHelper.getInstance().isMeetingConnected()) { } else if(ActivityHandlingHelper.getInstance().isMeetingConnected()) {
// リソースパターンの適用 // リソースパターンの適用
ErrorMessage.showErrorMessageToast(OperationListActivity.this, PatternStringUtil.patternToInt(getApplicationContext(), ErrorMessage.showErrorMessageToast(
OperationListActivity.this,
PatternStringUtil.patternToInt(
getApplicationContext(),
R.string.msg_routineTask_report_disable_meeting_room, R.string.msg_routineTask_report_disable_meeting_room,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)
)
);
} else if (isShowingBatchSync()) { } else if (isShowingBatchSync()) {
// 一括同期中は移動しない // 一括同期中は移動しない
ErrorMessage.showErrorMessageToast(OperationListActivity.this, getString(R.string.msg_batch_sync_move_operation_view)); ErrorMessage.showErrorMessageToast(
OperationListActivity.this,
getString(R.string.msg_batch_sync_move_operation_view)
);
} else { } else {
OperationDto operationDto = mOperationLogic.getOperation(operationId); OperationDto operationDto = mOperationLogic.getOperation(operationId);
if (operationDto == null) { if (operationDto == null) {
// リソースパターンの適用 // リソースパターンの適用
ErrorMessage.showErrorMessageToast(OperationListActivity.this, PatternStringUtil.patternToInt(getApplicationContext(), ErrorMessage.showErrorMessageToast(
OperationListActivity.this,
PatternStringUtil.patternToInt(
getApplicationContext(),
R.string.msg_routineTask_report_disable_no_operation, R.string.msg_routineTask_report_disable_no_operation,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)
)
);
} else if (operationDto.needSyncFlg) { } else if (operationDto.needSyncFlg) {
// リソースパターンの適用 // リソースパターンの適用
ErrorMessage.showErrorMessageToast(OperationListActivity.this, PatternStringUtil.patternToInt(getApplicationContext(), ErrorMessage.showErrorMessageToast(
OperationListActivity.this,
PatternStringUtil.patternToInt(
getApplicationContext(),
R.string.msg_routineTask_report_disable_not_updated, R.string.msg_routineTask_report_disable_not_updated,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)
)
);
} else { } else {
startTaskDirectionOrReportView(operationDto); startTaskDirectionOrReportView(operationDto);
} }
...@@ -248,7 +269,8 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -248,7 +269,8 @@ public class OperationListActivity extends ABVUIActivity {
dialog.dismiss(); dialog.dismiss();
} }
}); }
);
alertDialog.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { alertDialog.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
@Override @Override
...@@ -258,18 +280,9 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -258,18 +280,9 @@ public class OperationListActivity extends ABVUIActivity {
}); });
alertDialog.show(); alertDialog.show();
}
}
// // プッシュメッセージがある場合
// else if (!StringUtil.isNullOrEmpty(getIntent().getStringExtra(AppDefType.ChatPushMessageKey.roomName)) &&
// getIntent().getLongExtra(AppDefType.ChatPushMessageKey.roomId, '0') > 0) {
// ActivityHandlingHelper.getInstance().startChatWebviewActivity(
// getIntent().getLongExtra(AppDefType.ChatPushMessageKey.roomId, '0'),
// getIntent().getStringExtra(AppDefType.ChatPushMessageKey.roomName));
// }
} }
}
private class JsInf { private class JsInf {
@JavascriptInterface @JavascriptInterface
...@@ -456,6 +469,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -456,6 +469,7 @@ public class OperationListActivity extends ABVUIActivity {
private void showCommonContent() { private void showCommonContent() {
Intent intent = new Intent(); Intent intent = new Intent();
intent.setClass(OperationListActivity.this, OperationRelatedContentActivity.class); intent.setClass(OperationListActivity.this, OperationRelatedContentActivity.class);
intent.putExtra(AppDefType.ChatPushMessageKey.baseActivityName, OperationListActivity.class.getName());
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(intent, NaviConsts.Right); startActivity(intent, NaviConsts.Right);
} }
...@@ -553,6 +567,18 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -553,6 +567,18 @@ public class OperationListActivity extends ABVUIActivity {
// 一括同期中の場合何もしない // 一括同期中の場合何もしない
return; return;
} }
screenRefresh();
// プッシュメッセージがある場合の処理
//一度チャットルームを開いたのかチェックし、開いたらい何もしない
if (getABVUIDataCache().isChatPushMessageOpenOperationList) {
if (goChatRoom(getIntent(), ChatWebViewActivity.class.getName(), OperationListActivity.class.getName())) {
getABVUIDataCache().isChatPushMessageOpenOperationList = false;
return;
}
}
// 報告画面から作業一覧へ戻った時の同期処理 // 報告画面から作業一覧へ戻った時の同期処理
final long operationId = getUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, -1L); final long operationId = getUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, -1L);
...@@ -802,6 +828,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -802,6 +828,7 @@ public class OperationListActivity extends ABVUIActivity {
intent.putExtra(ABookKeys.OPERATION_ID, operationDto.operationId); intent.putExtra(ABookKeys.OPERATION_ID, operationDto.operationId);
intent.putExtra(Constant.ABookCheck.XWALK_OPEN_TYPE, Constant.XWalkOpenType.TASK_REPORT); intent.putExtra(Constant.ABookCheck.XWALK_OPEN_TYPE, Constant.XWalkOpenType.TASK_REPORT);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra(AppDefType.ChatPushMessageKey.baseActivityName, OperationListActivity.class.getName());
if(operationDto.operationType == OperationType.PDF) { if(operationDto.operationType == OperationType.PDF) {
intent.putExtra("LINKURL", "file://" + path); intent.putExtra("LINKURL", "file://" + path);
...@@ -1020,6 +1047,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1020,6 +1047,7 @@ public class OperationListActivity extends ABVUIActivity {
intent.putExtra(ABookKeys.CONTENT_ID, operationDto.contentId); intent.putExtra(ABookKeys.CONTENT_ID, operationDto.contentId);
intent.putExtra(ABookKeys.OPERATION_ID, operationDto.operationId); intent.putExtra(ABookKeys.OPERATION_ID, operationDto.operationId);
intent.putExtra(Constant.ABookCheck.XWALK_OPEN_TYPE, Constant.XWalkOpenType.PANO_EDIT); intent.putExtra(Constant.ABookCheck.XWALK_OPEN_TYPE, Constant.XWalkOpenType.PANO_EDIT);
intent.putExtra(AppDefType.ChatPushMessageKey.baseActivityName, OperationListActivity.class.getName());
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setClass(OperationListActivity.this, HTMLXWalkWebViewActivity.class); intent.setClass(OperationListActivity.this, HTMLXWalkWebViewActivity.class);
ActivityHandlingHelper.getInstance().startHTMLXWalkWebActivity(OperationListActivity.this, intent, url, operationDto.contentId, -1, -1, -1, -1, -1); ActivityHandlingHelper.getInstance().startHTMLXWalkWebActivity(OperationListActivity.this, intent, url, operationDto.contentId, -1, -1, -1, -1, -1);
...@@ -1220,6 +1248,16 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1220,6 +1248,16 @@ public class OperationListActivity extends ABVUIActivity {
@Override @Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent) { protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
super.onActivityResult(requestCode,requestCode, intent);
if (requestCode == ABookCommConstants.PUSH_MESSAGE_DLG_REQUEST_CODE) {
// プッシュメッセージダイアログのリザルトだった場合
if (resultCode == ABookCommConstants.PUSH_MESSAGE_DLG_RESULT.OK) {
goChatRoom(intent, ChatWebViewActivity.class.getName(), OperationListActivity.class.getName());
}
return;
}
activityResultFlg = true; activityResultFlg = true;
Uri result = (intent == null || resultCode != RESULT_OK) ? null : intent.getData(); Uri result = (intent == null || resultCode != RESULT_OK) ? null : intent.getData();
//ベースファイル登録した後にシーン画像選択画面閉じた後に呼ばれる //ベースファイル登録した後にシーン画像選択画面閉じた後に呼ばれる
......
...@@ -11,7 +11,6 @@ import android.view.Display; ...@@ -11,7 +11,6 @@ import android.view.Display;
import android.view.Gravity; import android.view.Gravity;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.View; import android.view.View;
import android.view.ViewGroup;
import android.widget.Button; import android.widget.Button;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.LinearLayout; import android.widget.LinearLayout;
...@@ -21,11 +20,11 @@ import android.widget.Toast; ...@@ -21,11 +20,11 @@ import android.widget.Toast;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Stack;
import jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON; import jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON;
import jp.agentec.abook.abv.bl.acms.type.AcmsApis; import jp.agentec.abook.abv.bl.acms.type.AcmsApis;
import jp.agentec.abook.abv.bl.common.ABVEnvironment; 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.ExceptionHandler; import jp.agentec.abook.abv.bl.common.exception.ExceptionHandler;
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;
...@@ -36,7 +35,6 @@ import jp.agentec.abook.abv.bl.logic.AbstractLogic; ...@@ -36,7 +35,6 @@ import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.OperationLogic; import jp.agentec.abook.abv.bl.logic.OperationLogic;
import jp.agentec.abook.abv.bl.websocket.MeetingManager; import jp.agentec.abook.abv.bl.websocket.MeetingManager;
import jp.agentec.abook.abv.launcher.android.R; 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.ABVUIActivity; import jp.agentec.abook.abv.ui.common.activity.ABVUIActivity;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType; 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.ErrorCode;
...@@ -77,6 +75,7 @@ public class OperationRelatedContentActivity extends ABVUIActivity { ...@@ -77,6 +75,7 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
Logger.i(TAG,"onCreate");
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
updateCollaborationInfo(); updateCollaborationInfo();
setContentView(R.layout.ac_operation_related_content); setContentView(R.layout.ac_operation_related_content);
...@@ -286,6 +285,7 @@ public class OperationRelatedContentActivity extends ABVUIActivity { ...@@ -286,6 +285,7 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
} }
Intent intent = new Intent(); Intent intent = new Intent();
intent.putExtra(AppDefType.ChatPushMessageKey.baseActivityName, OperationRelatedContentActivity.class.getName());
ActivityHandlingHelper.getInstance().checkContentActivity(contentId, 0, intent); ActivityHandlingHelper.getInstance().checkContentActivity(contentId, 0, intent);
} }
} catch (Exception e) { } catch (Exception e) {
...@@ -405,9 +405,12 @@ public class OperationRelatedContentActivity extends ABVUIActivity { ...@@ -405,9 +405,12 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
* 作業一覧へ戻る * 作業一覧へ戻る
*/ */
private void backToHome() { private void backToHome() {
finish(); Intent intent = new Intent();
// 終了後、アニメーション追加(左へ移動) intent.setClass(OperationRelatedContentActivity.this, OperationListActivity.class);
overridePendingTransition(R.anim.viewin_left_to_right, R.anim.viewout_left_to_right); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
intent.putExtra(AppDefType.ChatPushMessageKey.baseActivityName, OperationRelatedContentActivity.class.getName());
// 左へ移動しながら戻る
startActivity(intent, NaviConsts.Left);
} }
public void showCancelDownloadDialog(final ContentDto contentDto) { public void showCancelDownloadDialog(final ContentDto contentDto) {
...@@ -541,6 +544,9 @@ public class OperationRelatedContentActivity extends ABVUIActivity { ...@@ -541,6 +544,9 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
updateCollaborationInfo(); updateCollaborationInfo();
refreshCollaborationUI(); refreshCollaborationUI();
super.onResume(); super.onResume();
if(goChatRoom(getIntent(), ChatWebViewActivity.class.getName(), OperationRelatedContentActivity.class.getName())) {
return;
}
showOperationRelatedContentList(); showOperationRelatedContentList();
} }
...@@ -592,4 +598,16 @@ public class OperationRelatedContentActivity extends ABVUIActivity { ...@@ -592,4 +598,16 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
super.showAlertDialog(alertDialog); super.showAlertDialog(alertDialog);
} }
@Override
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
super.onActivityResult(requestCode, resultCode, intent);
if (requestCode == ABookCommConstants.PUSH_MESSAGE_DLG_REQUEST_CODE) {
if (resultCode == ABookCommConstants.PUSH_MESSAGE_DLG_RESULT.OK) {
finish();
goChatRoom(intent, ChatWebViewActivity.class.getName(), getClass().getName());
}
return;
}
}
} }
...@@ -388,7 +388,7 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve ...@@ -388,7 +388,7 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
//資料が変更されたらPIPモードに更新する。 //資料が変更されたらPIPモードに更新する。
ChatWebViewActivity chatWebViewActivity = getActivity(ChatWebViewActivity.class); ChatWebViewActivity chatWebViewActivity = getActivity(ChatWebViewActivity.class);
if (chatWebViewActivity != null && meetingManager.isSubscribed() && !chatWebViewActivity.isInPictureInPictureMode()) { if (chatWebViewActivity != null && meetingManager.isSubscribed() && !chatWebViewActivity.isInPictureInPictureMode()) {
chatWebViewActivity.startPIPmode(); chatWebViewActivity.startPIPMode();
} }
if (!StringUtil.equalsAny( if (!StringUtil.equalsAny(
...@@ -851,6 +851,20 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve ...@@ -851,6 +851,20 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
} }
} }
/**
* 文書協業用の関連資料画面を閉じる
*/
public void finishCollaborationOperationRelatedContentActivity() {
if (!currentActivityStack.isEmpty()) {
for (ABVAuthenticatedActivity activity : currentActivityStack) {
if (activity instanceof OperationRelatedContentActivity) {
activity.finish();
break;
}
}
}
}
public Stack<ABVAuthenticatedActivity> getCurrentActivityStack() { public Stack<ABVAuthenticatedActivity> getCurrentActivityStack() {
return currentActivityStack; return currentActivityStack;
} }
...@@ -881,8 +895,10 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve ...@@ -881,8 +895,10 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
if (meetingManager != null) { if (meetingManager != null) {
isCollaboration = meetingManager.isCollaboration(); isCollaboration = meetingManager.isCollaboration();
} }
if (cmd.equals(MeetingManager.CMD_MEETINGINFO) && !isCollaboration) { // 入室結果 if (cmd.equals(MeetingManager.CMD_MEETINGINFO)) { // 入室結果
if (!isCollaboration) { //文書協業中にはトースト表示させない。
showToast(mContext.getString(meetingManager.isOwner() ? R.string.msg_enter_as_publisher : R.string.msg_enter_as_subscriber)); showToast(mContext.getString(meetingManager.isOwner() ? R.string.msg_enter_as_publisher : R.string.msg_enter_as_subscriber));
}
return; return;
} }
...@@ -988,8 +1004,21 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve ...@@ -988,8 +1004,21 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
if (data.startsWith("onClose:1000")) { if (data.startsWith("onClose:1000")) {
saveMeetingInfo(null, null, null, false); saveMeetingInfo(null, null, null, false);
} else if (contentViewActivity == null && data.endsWith(";" + MeetingManager.STATUS_PEND)) { // 初期接続の失敗では再接続アラートダイアログは出さない } else if (contentViewActivity == null && data.endsWith(";" + MeetingManager.STATUS_PEND)) { // 初期接続の失敗では再接続アラートダイアログは出さない
ChatWebViewActivity chatWebViewActivity = getChatWebViewActivity();
if (chatWebViewActivity == null) {
showEnterFailedAlert(); showEnterFailedAlert();
} else { } else {
chatWebViewActivity.finishPIPMode();
handler.postDelayed(new Runnable() {
@Override
public void run() {
ABookAlertDialog alertDialog = AlertDialogUtil.createAlertDialog(getCurrentActivity(), mContext.getString(R.string.error), mContext.getString(R.string.msg_fail_collaboration_join_error));
alertDialog.setPositiveButton(R.string.ok, null);
alertDialog.show();
}
}, 1000);
}
} else {
reflectContentView = false; reflectContentView = false;
lastDisconnect = System.currentTimeMillis(); lastDisconnect = System.currentTimeMillis();
if ((contentViewActivity != null) && ABVActivity.isVisible()) { // Wifi以外の理由で接続が突然切れた場合 if ((contentViewActivity != null) && ABVActivity.isVisible()) { // Wifi以外の理由で接続が突然切れた場合
...@@ -1630,61 +1659,50 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve ...@@ -1630,61 +1659,50 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
} }
//プシュメッセージ一覧からチャットに入る //プシュメッセージ一覧からチャットに入る
public void startChatWebViewActivityWithPushMessage(PushMessageDto dto) { public void startChatWebViewActivityWithPushMessage(PushMessageDto dto, String collaborationType) {
String className = ChatWebViewActivity.class.getName(); if (collaborationType == null) {
boolean isNormalSize = (mContext.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_NORMAL; startChatWebViewActivity(dto.roomId, dto.roomName, ChatWebViewActivity.class.getName(), null);
Intent intent = new Intent(); } else {
startChatWebViewActivityWithCollaboration(dto.roomId, dto.roomName, collaborationType, null, ChatWebViewActivity.class.getName(), null);
intent.putExtra("chatWebviewUrl",ABVEnvironment.getInstance().acmsAddress + ABVDataCache.getInstance().getUrlPath() + "/chatapi/chat/");
String sid = ABVDataCache.getInstance().getMemberInfo().sid;
intent.putExtra("sid", sid);
String loginId = ABVDataCache.getInstance().getMemberInfo().loginId;
String shopName = ABVDataCache.getInstance().getUrlPath();
intent.putExtra("loginId", loginId);
intent.putExtra("shopName", shopName);
if(dto != null)
{
intent.putExtra("roomId",dto.roomId);
intent.putExtra("roomName", dto.roomName);
} }
intent.setClassName(mContext.getPackageName(), className);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
getCurrentActivity().startActivity(intent);
} }
//チャットに入る //チャットに入る
public void startChatWebViewActivity() { public void startChatWebViewActivity() {
String className = ChatWebViewActivity.class.getName(); String className = ChatWebViewActivity.class.getName();
boolean isNormalSize = (mContext.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_NORMAL;
Intent intent = new Intent(); Intent intent = new Intent();
intent.putExtra("chatWebviewUrl",ABVEnvironment.getInstance().acmsAddress + ABVDataCache.getInstance().getUrlPath() + "/chatapi/chat/"); intent.putExtra("chatWebviewUrl",ABVEnvironment.getInstance().acmsAddress + ABVDataCache.getInstance().getUrlPath() + "/chatapi/chat/");
String sid = ABVDataCache.getInstance().getMemberInfo().sid; String sid = ABVDataCache.getInstance().getMemberInfo().sid;
intent.putExtra("sid", sid); intent.putExtra("sid", sid);
String loginId = ABVDataCache.getInstance().getMemberInfo().loginId; String loginId = ABVDataCache.getInstance().getMemberInfo().loginId;
String shopName = ABVDataCache.getInstance().getUrlPath(); String shopName = ABVDataCache.getInstance().getUrlPath();
intent.putExtra("loginId", loginId); intent.putExtra(AppDefType.ChatPushMessageKey.loginId, loginId);
intent.putExtra("shopName", shopName); intent.putExtra(AppDefType.ChatPushMessageKey.shopName, shopName);
intent.setClassName(mContext.getPackageName(), className); intent.setClassName(mContext.getPackageName(), className);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
getCurrentActivity().startActivity(intent); getCurrentActivity().startActivity(intent);
} }
// プシュメッセージからチャットに入る /**
public void startChatWebViewActivity(Long roomId, String roomName) { * プシュメッセージからチャットに遷移する
String className = ChatWebViewActivity.class.getName(); * @param roomId chatRoom の Id
boolean isNormalSize = (mContext.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_NORMAL; * @param roomName chatRoom の名前
* @param targetActivityName 直接chatRoom に遷移する場合は、ChatWebViewActivity名。chatRoomに遷移する前に、別のActivityを経由する場合は、そのActivity名
* @param baseActivityName この関数を呼び出したActivity名。戻る時にはこのアクティビティに戻る
*/
public void startChatWebViewActivity(Long roomId, String roomName, String targetActivityName, String baseActivityName) {
Intent intent = new Intent(); Intent intent = new Intent();
intent.putExtra("chatWebviewUrl",ABVEnvironment.getInstance().acmsAddress + ABVDataCache.getInstance().getUrlPath() + "/chatapi/chat/"); intent.putExtra("chatWebviewUrl",ABVEnvironment.getInstance().acmsAddress + ABVDataCache.getInstance().getUrlPath() + "/chatapi/chat/");
String sid = ABVDataCache.getInstance().getMemberInfo().sid; String sid = ABVDataCache.getInstance().getMemberInfo().sid;
intent.putExtra("sid", sid); intent.putExtra("sid", sid);
String loginId = ABVDataCache.getInstance().getMemberInfo().loginId; String loginId = ABVDataCache.getInstance().getMemberInfo().loginId;
String shopName = ABVDataCache.getInstance().getUrlPath(); String shopName = ABVDataCache.getInstance().getUrlPath();
intent.putExtra("loginId", loginId); intent.putExtra(AppDefType.ChatPushMessageKey.loginId, loginId);
intent.putExtra("shopName", shopName); intent.putExtra(AppDefType.ChatPushMessageKey.shopName, shopName);
intent.putExtra("roomId", roomId); intent.putExtra(AppDefType.ChatPushMessageKey.roomId, roomId);
intent.putExtra("roomName", roomName); intent.putExtra(AppDefType.ChatPushMessageKey.roomName, roomName);
intent.putExtra(AppDefType.ChatPushMessageKey.baseActivityName, baseActivityName);
intent.setClassName(mContext.getPackageName(), className); intent.setClassName(mContext.getPackageName(), targetActivityName);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
getCurrentActivity().startActivity(intent); getCurrentActivity().startActivity(intent);
} }
...@@ -1870,6 +1888,20 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve ...@@ -1870,6 +1888,20 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
} }
/** /**
* 使用中のChatWebViewActivityを返す
* @return 使用中のChatWebViewActivity
*/
public ChatWebViewActivity getChatWebViewActivity() {
if (!currentActivityStack.isEmpty()) {
for (final ABVAuthenticatedActivity activity : currentActivityStack) {
if (activity instanceof ChatWebViewActivity) {
return (ChatWebViewActivity)activity;
}
}
}
return null;
}
/**
* 設定画面から戻る用 * 設定画面から戻る用
* @return 設定画面へ遷移前の画面 * @return 設定画面へ遷移前の画面
*/ */
...@@ -1914,22 +1946,28 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve ...@@ -1914,22 +1946,28 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
this.previousOfSettingActivity2 = activity; this.previousOfSettingActivity2 = activity;
} }
public void startChatWebViewActivityWithCollaboration(Long roomId, String roomName, String collaborationType, String roomType) { /**
String className = ChatWebViewActivity.class.getName(); * プッシュメッセージから協業に遷移する
boolean isNormalSize = (mContext.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_NORMAL; * @param roomId
* @param roomName
* @param collaborationType
* @param roomType
*/
public void startChatWebViewActivityWithCollaboration(Long roomId, String roomName, String collaborationType, String roomType, String targetActivityName, String baseActivityName) {
Intent intent = new Intent(); Intent intent = new Intent();
intent.putExtra("chatWebviewUrl",ABVEnvironment.getInstance().acmsAddress + ABVDataCache.getInstance().getUrlPath() + "/chatapi/chat/"); intent.putExtra("chatWebviewUrl", ABVEnvironment.getInstance().acmsAddress + ABVDataCache.getInstance().getUrlPath() + "/chatapi/chat/");
String sid = ABVDataCache.getInstance().getMemberInfo().sid; String sid = ABVDataCache.getInstance().getMemberInfo().sid;
intent.putExtra("sid", sid); intent.putExtra("sid", sid);
String loginId = ABVDataCache.getInstance().getMemberInfo().loginId; String loginId = ABVDataCache.getInstance().getMemberInfo().loginId;
String shopName = ABVDataCache.getInstance().getUrlPath(); String shopName = ABVDataCache.getInstance().getUrlPath();
intent.putExtra("loginId", loginId); intent.putExtra(AppDefType.ChatPushMessageKey.loginId, loginId);
intent.putExtra("collaborationType", collaborationType); intent.putExtra(AppDefType.ChatPushMessageKey.collaborationType, collaborationType);
intent.putExtra("shopName", shopName); intent.putExtra(AppDefType.ChatPushMessageKey.shopName, shopName);
intent.putExtra("roomId", roomId); intent.putExtra(AppDefType.ChatPushMessageKey.roomId, roomId);
intent.putExtra("roomName", roomName); intent.putExtra(AppDefType.ChatPushMessageKey.roomName, roomName);
intent.putExtra("roomType", roomType); intent.putExtra(AppDefType.ChatPushMessageKey.roomType, roomType);
intent.setClassName(mContext.getPackageName(), className); intent.putExtra(AppDefType.ChatPushMessageKey.baseActivityName, baseActivityName);
intent.setClassName(mContext.getPackageName(), targetActivityName);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
getCurrentActivity().startActivity(intent); getCurrentActivity().startActivity(intent);
} }
......
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 ChatWebViewDelegate delegate;
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() {
//Androidの場合、PIP解除はできないので、不要(リクエスト要請時に呼ばれる)
}
@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();
}
@JavascriptInterface
public void showLoadingIndicator() {
if (delegate != null) {
delegate.chatWebViewNeedsShowProgressBar();
}
}
@JavascriptInterface
public void hideLoadingIndicator() {
if (delegate != null) {
delegate.chatWebViewNeedsDismissProgressBar();
}
}
public void loadBlank() {
post(new Runnable() {
@Override
public void run() {
loadUrl("about:blank");
}
});
}
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 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 ));
}
}
package jp.agentec.abook.abv.ui.home.view;
public interface ChatWebViewDelegate {
void chatWebViewNeedsShowProgressBar();
void chatWebViewNeedsDismissProgressBar();
}
package jp.agentec.abook.abv.ui.viewer.activity; package jp.agentec.abook.abv.ui.viewer.activity;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.database.Cursor; import android.database.Cursor;
import android.net.Uri; import android.net.Uri;
import android.provider.MediaStore; import android.provider.MediaStore;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Button; import android.widget.Button;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.LinearLayout; import android.widget.LinearLayout;
...@@ -16,45 +10,11 @@ import android.widget.ProgressBar; ...@@ -16,45 +10,11 @@ import android.widget.ProgressBar;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON;
import jp.agentec.abook.abv.bl.acms.type.OperationType;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.Callback;
import jp.agentec.abook.abv.bl.common.CommonExecutor;
import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.exception.ABVExceptionCode;
import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.common.log.Logger; import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
import jp.agentec.abook.abv.bl.data.dao.ContentDao;
import jp.agentec.abook.abv.bl.dto.ContentDto; import jp.agentec.abook.abv.bl.dto.ContentDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.ContentObjectLogLogic;
import jp.agentec.abook.abv.bl.logic.OperationLogic;
import jp.agentec.abook.abv.cl.util.ContentLogUtil;
import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.activity.ABVAuthenticatedActivity; import jp.agentec.abook.abv.ui.common.activity.ABVAuthenticatedActivity;
import jp.agentec.abook.abv.ui.common.activity.ABVContentViewActivity;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.common.constant.ErrorCode;
import jp.agentec.abook.abv.ui.common.constant.ErrorMessage;
import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog;
import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
import jp.agentec.abook.abv.ui.common.util.PatternStringUtil;
import jp.agentec.abook.abv.ui.home.activity.ABookSettingActivity;
import jp.agentec.abook.abv.ui.home.helper.ABookCheckWebViewHelper; import jp.agentec.abook.abv.ui.home.helper.ABookCheckWebViewHelper;
import jp.agentec.abook.abv.ui.home.helper.ABookPermissionHelper;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.home.helper.ContentViewHelper;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.FileUtil;
public class CommunicationWebViewActivity extends ABVAuthenticatedActivity { public class CommunicationWebViewActivity extends ABVAuthenticatedActivity {
private static final String TAG = "CommunicationWebViewActivity"; private static final String TAG = "CommunicationWebViewActivity";
...@@ -74,8 +34,6 @@ public class CommunicationWebViewActivity extends ABVAuthenticatedActivity { ...@@ -74,8 +34,6 @@ public class CommunicationWebViewActivity extends ABVAuthenticatedActivity {
private ProgressBar m_progress; private ProgressBar m_progress;
protected ContentDto mContentDto; protected ContentDto mContentDto;
protected File mLocalFile; protected File mLocalFile;
public final static int ABOOK_CHECK_TASK_IMAGE = 103;
public final static int ABOOK_CHECK_TASK_VIDEO = 104;
@Override @Override
protected void onDestroy() { protected void onDestroy() {
......
...@@ -76,7 +76,6 @@ import java.util.ArrayList; ...@@ -76,7 +76,6 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Stack;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import jp.agentec.abook.abv.bl.acms.client.json.DownloadedContentInfoJSON; import jp.agentec.abook.abv.bl.acms.client.json.DownloadedContentInfoJSON;
...@@ -94,6 +93,7 @@ import jp.agentec.abook.abv.bl.acms.type.OperationType; ...@@ -94,6 +93,7 @@ import jp.agentec.abook.abv.bl.acms.type.OperationType;
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; import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.constant.ABookCommConstants;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys; import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.exception.ExceptionHandler; import jp.agentec.abook.abv.bl.common.exception.ExceptionHandler;
import jp.agentec.abook.abv.bl.common.log.Logger; import jp.agentec.abook.abv.bl.common.log.Logger;
...@@ -119,7 +119,6 @@ import jp.agentec.abook.abv.cl.util.ContentLogUtil; ...@@ -119,7 +119,6 @@ import jp.agentec.abook.abv.cl.util.ContentLogUtil;
import jp.agentec.abook.abv.cl.util.PreferenceUtil; import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.launcher.android.R; import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.launcher.android.R.id; import jp.agentec.abook.abv.launcher.android.R.id;
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.activity.ABVContentViewActivity;
import jp.agentec.abook.abv.ui.common.appinfo.AppColor; import jp.agentec.abook.abv.ui.common.appinfo.AppColor;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
...@@ -137,8 +136,6 @@ import jp.agentec.abook.abv.ui.common.util.PatternStringUtil; ...@@ -137,8 +136,6 @@ import jp.agentec.abook.abv.ui.common.util.PatternStringUtil;
import jp.agentec.abook.abv.ui.common.view.ABVEditText; import jp.agentec.abook.abv.ui.common.view.ABVEditText;
import jp.agentec.abook.abv.ui.common.view.ABVPopupListWindow; import jp.agentec.abook.abv.ui.common.view.ABVPopupListWindow;
import jp.agentec.abook.abv.ui.common.vo.Size; import jp.agentec.abook.abv.ui.common.vo.Size;
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.ABookCheckWebViewHelper; import jp.agentec.abook.abv.ui.home.helper.ABookCheckWebViewHelper;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper; import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.Interface.MovePageInterface; import jp.agentec.abook.abv.ui.Interface.MovePageInterface;
...@@ -337,6 +334,7 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -337,6 +334,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
// 移動・タップモードのフラグ // 移動・タップモードのフラグ
public boolean mMoveTaskFlg = false; public boolean mMoveTaskFlg = false;
private long currentRemoteObjectId = 0;
/** /**
...@@ -1419,7 +1417,14 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -1419,7 +1417,14 @@ public class ContentViewActivity extends ABVContentViewActivity {
mHistoryBtn.setVisibility(View.GONE); mHistoryBtn.setVisibility(View.GONE);
indexBtn.setVisibility(View.GONE); indexBtn.setVisibility(View.GONE);
search.setVisibility(View.GONE); search.setVisibility(View.GONE);
marking.setVisibility(View.GONE); //マーキングアイコン位置調節
RelativeLayout.LayoutParams params =
new RelativeLayout.LayoutParams(WC, WC);
params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT, RelativeLayout.TRUE);
params.addRule(RelativeLayout.CENTER_VERTICAL, RelativeLayout.TRUE);
params.rightMargin = (int) (getResources().getDisplayMetrics().density * 10);
marking.setLayoutParams(params);
bookmark.setVisibility(View.GONE); bookmark.setVisibility(View.GONE);
subMenuBtn.setVisibility(View.GONE); subMenuBtn.setVisibility(View.GONE);
tvContentTitle.setVisibility(View.GONE); tvContentTitle.setVisibility(View.GONE);
...@@ -2134,6 +2139,8 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -2134,6 +2139,8 @@ public class ContentViewActivity extends ABVContentViewActivity {
ContentLogUtil.getInstance().contentPageMove(contentId, readingLogId, currentPageNumber, nextPageNumber); ContentLogUtil.getInstance().contentPageMove(contentId, readingLogId, currentPageNumber, nextPageNumber);
if (contentsBgmFlg && !StringUtil.isNullOrEmpty(contentsBgmFilePath) && !contentBGMPlayer.isPlaying()) { if (contentsBgmFlg && !StringUtil.isNullOrEmpty(contentsBgmFilePath) && !contentBGMPlayer.isPlaying()) {
//文書協業接続中にはコンテンツBGM再生しない
if (!isCollaboration) {
//contentsBgmFilePath //contentsBgmFilePath
contentBGMPlayer = new ABVMediaPlayer(true); contentBGMPlayer = new ABVMediaPlayer(true);
try { try {
...@@ -2142,10 +2149,11 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -2142,10 +2149,11 @@ public class ContentViewActivity extends ABVContentViewActivity {
contentBGMPlayer.prepare(); contentBGMPlayer.prepare();
contentBGMPlayer.start(); contentBGMPlayer.start();
} catch (IOException e) { } catch (IOException e) {
Logger.e(TAG, "Can't play content BGM",e); Logger.e(TAG, "Can't play content BGM", e);
ABVToastUtil.showMakeText(getApplicationContext(), R.string.ERROR, Toast.LENGTH_SHORT); ABVToastUtil.showMakeText(getApplicationContext(), R.string.ERROR, Toast.LENGTH_SHORT);
} }
} }
}
//リモート機能 //リモート機能
if (meetingManager.isSendable()) { // TODO: later 止まったタイミングで送るように要修正 if (meetingManager.isSendable()) { // TODO: later 止まったタイミングで送るように要修正
...@@ -2633,7 +2641,13 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -2633,7 +2641,13 @@ public class ContentViewActivity extends ABVContentViewActivity {
private void handleAction(ActionButton actionButton, PageObjectJSON pageObject) { private void handleAction(ActionButton actionButton, PageObjectJSON pageObject) {
ActionInfoJSON actionInfoJSON = pageObject.getActionInfo(); ActionInfoJSON actionInfoJSON = pageObject.getActionInfo();
int pageNumber = pageObject.getPageNumber(); int pageNumber = pageObject.getPageNumber();
//文書協業接続時、機能制限する(動作再生、音声再生)
if (actionInfoJSON.getActionType() == ActionInfoJSON.VIDEO_ACTION ||
actionInfoJSON.getActionType() == ActionInfoJSON.MUSIC_ACTION) {
if (isCollaborationConnected()) {
return;
}
}
if (meetingManager.isSendable() if (meetingManager.isSendable()
&& actionInfoJSON.getActionType() != ActionInfoJSON.EMAIL_ACTION && actionInfoJSON.getActionType() != ActionInfoJSON.EMAIL_ACTION
&& actionInfoJSON.getActionType() != ActionInfoJSON.CONTENTLINK_ACTION) { // リモート送信(メール・コンテンツリンクを除く) && actionInfoJSON.getActionType() != ActionInfoJSON.CONTENTLINK_ACTION) { // リモート送信(メール・コンテンツリンクを除く)
...@@ -2862,6 +2876,8 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -2862,6 +2876,8 @@ public class ContentViewActivity extends ABVContentViewActivity {
} }
// BGM // BGM
if (contentsBgmFlg && !StringUtil.isNullOrEmpty(contentsBgmFilePath) && !contentBGMPlayer.isPlaying()) { if (contentsBgmFlg && !StringUtil.isNullOrEmpty(contentsBgmFilePath) && !contentBGMPlayer.isPlaying()) {
//文書協業接続中にはコンテンツBGM再生しない
if (!isCollaboration) {
//contentsBgmFilePath //contentsBgmFilePath
contentBGMPlayer = new ABVMediaPlayer(true); contentBGMPlayer = new ABVMediaPlayer(true);
try { try {
...@@ -2874,6 +2890,7 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -2874,6 +2890,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
ABVToastUtil.showMakeText(getApplicationContext(), R.string.ERROR, Toast.LENGTH_SHORT); ABVToastUtil.showMakeText(getApplicationContext(), R.string.ERROR, Toast.LENGTH_SHORT);
} }
} }
}
playPageBGMSound(jumpPage); playPageBGMSound(jumpPage);
//탭사운드 플레이 Bug //탭사운드 플레이 Bug
...@@ -3173,6 +3190,10 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -3173,6 +3190,10 @@ public class ContentViewActivity extends ABVContentViewActivity {
imgButton.setOnClickListener(new View.OnClickListener() { imgButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
//文書協業接続中には差し替え動作機能制限
if (isCollaborationConnected()) {
return;
}
if (meetingManager.isSendable()) { if (meetingManager.isSendable()) {
meetingManager.sendWs(MeetingManager.CMD_ACTION, getContentId(), pageNumber, pageObjectId, null); meetingManager.sendWs(MeetingManager.CMD_ACTION, getContentId(), pageNumber, pageObjectId, null);
} }
...@@ -3287,6 +3308,10 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -3287,6 +3308,10 @@ public class ContentViewActivity extends ABVContentViewActivity {
} }
private void videoOnClick(PageObjectJSON pageObject, int pageidx) { private void videoOnClick(PageObjectJSON pageObject, int pageidx) {
//文書協業接続中には全画面動画制御
if (isCollaborationConnected()) {
return;
}
if (mPageScrollView.isZooming() == false) { if (mPageScrollView.isZooming() == false) {
//リモート機能 //リモート機能
if (meetingManager.isSendable()) { if (meetingManager.isSendable()) {
...@@ -3478,6 +3503,10 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -3478,6 +3503,10 @@ public class ContentViewActivity extends ABVContentViewActivity {
clickableArea.setOnClickListener(new View.OnClickListener() { clickableArea.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
//文書協業接続時には音声アクション制限
if (isCollaborationConnected()) {
return;
}
if (meetingManager.isSendable()) { if (meetingManager.isSendable()) {
meetingManager.sendWs(MeetingManager.CMD_ACTION, contentId, pageObject.getPageNumber(), pageObject.getActionInfo().getObjectId(), null); meetingManager.sendWs(MeetingManager.CMD_ACTION, contentId, pageObject.getPageNumber(), pageObject.getActionInfo().getObjectId(), null);
} }
...@@ -3504,6 +3533,10 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -3504,6 +3533,10 @@ public class ContentViewActivity extends ABVContentViewActivity {
playIcon.setOnClickListener(new View.OnClickListener() { playIcon.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
//文書協業接続時には音声アクション制限
if (isCollaborationConnected()) {
return;
}
if (meetingManager.isSendable()) { if (meetingManager.isSendable()) {
meetingManager.sendWs(MeetingManager.CMD_ACTION, contentId, pageObject.getPageNumber(), pageObject.getActionInfo().getObjectId(), null); meetingManager.sendWs(MeetingManager.CMD_ACTION, contentId, pageObject.getPageNumber(), pageObject.getActionInfo().getObjectId(), null);
} }
...@@ -3521,6 +3554,10 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -3521,6 +3554,10 @@ public class ContentViewActivity extends ABVContentViewActivity {
if (contentBGMPlayer != null) { if (contentBGMPlayer != null) {
return; return;
} }
//文書協業接続中にはコンテンツBGM再生しない
if (isCollaboration) {
return;
}
contentBGMPlayer = new ABVMediaPlayer(true); contentBGMPlayer = new ABVMediaPlayer(true);
try { try {
Logger.v(TAG, "[addMusic]:MediaPlayer Content BGM"); Logger.v(TAG, "[addMusic]:MediaPlayer Content BGM");
...@@ -3602,6 +3639,8 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -3602,6 +3639,8 @@ public class ContentViewActivity extends ABVContentViewActivity {
String soundFilePath = mContentDir + "/" + contentsBGMPageObject.getActionInfo().getMusicFileName(); String soundFilePath = mContentDir + "/" + contentsBGMPageObject.getActionInfo().getMusicFileName();
if (contentsBGMPageObject.getActionInfo().getPlayType() == 1) { if (contentsBGMPageObject.getActionInfo().getPlayType() == 1) {
if (contentBGMPlayer == null) { if (contentBGMPlayer == null) {
//文書協業接続中にはコンテンツBGM再生しない
if (!isCollaboration) {
contentBGMPlayer = new ABVMediaPlayer(true); contentBGMPlayer = new ABVMediaPlayer(true);
try { try {
if (pageBgmFlg) { if (pageBgmFlg) {
...@@ -3618,6 +3657,8 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -3618,6 +3657,8 @@ public class ContentViewActivity extends ABVContentViewActivity {
Logger.e(TAG, "Can't play content BGM", e); Logger.e(TAG, "Can't play content BGM", e);
ABVToastUtil.showMakeText(getApplicationContext(), R.string.ERROR, Toast.LENGTH_SHORT); ABVToastUtil.showMakeText(getApplicationContext(), R.string.ERROR, Toast.LENGTH_SHORT);
} }
}
} else { } else {
return; return;
} }
...@@ -3698,6 +3739,10 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -3698,6 +3739,10 @@ public class ContentViewActivity extends ABVContentViewActivity {
} }
private void playPageBGMSound(int pageNumber) { private void playPageBGMSound(int pageNumber) {
//文書協業接続中にはページBGM再生しない
if (isCollaboration) {
return;
}
String bgmFilePath = pageBGMPathList.get(pageNumber); String bgmFilePath = pageBGMPathList.get(pageNumber);
//프리뷰 모드일때 사운드 계속 재생 //프리뷰 모드일때 사운드 계속 재생
...@@ -3822,6 +3867,15 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -3822,6 +3867,15 @@ public class ContentViewActivity extends ABVContentViewActivity {
Uri[] result = null; Uri[] result = null;
Uri dataUri = null; Uri dataUri = null;
if (requestCode == ABookCommConstants.PUSH_MESSAGE_DLG_REQUEST_CODE) {
// プッシュメッセージダイアログのリザルトだった場合
if (resultCode == ABookCommConstants.PUSH_MESSAGE_DLG_RESULT.OK && !StringUtil.isNullOrEmpty(baseActivityName)) {
finishActivity();
goChatRoom(intent, baseActivityName, ContentViewActivity.class.getName());
}
return;
}
if (intent != null && resultCode == RESULT_OK) { if (intent != null && resultCode == RESULT_OK) {
String dataString = intent.getDataString(); String dataString = intent.getDataString();
if (dataString != null) { if (dataString != null) {
...@@ -3835,9 +3889,9 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -3835,9 +3889,9 @@ public class ContentViewActivity extends ABVContentViewActivity {
case WEBVIEW: case WEBVIEW:
case PREVIEW: case PREVIEW:
isAnotherViewOpenFlg = false; isAnotherViewOpenFlg = false;
// playPageBGMSound(mCurrentPageNumber); //프리뷰 모드 일때 음악재생 Bug //playPageBGMSound(mCurrentPageNumber); //프리뷰 모드 일때 음악재생 Bug
break; break;
case ABOOK_CHECK_TASK_IMAGE: case ABookCommConstants.ABOOK_CHECK_TASK_IMAGE:
if (mUploadMessage == null) { if (mUploadMessage == null) {
return; return;
} }
...@@ -3858,7 +3912,7 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -3858,7 +3912,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
ErrorMessage.showErrorMessageToast(getApplicationContext(), ErrorCode.E107); ErrorMessage.showErrorMessageToast(getApplicationContext(), ErrorCode.E107);
} }
break; break;
case ABOOK_CHECK_TASK_VIDEO: case ABookCommConstants.ABOOK_CHECK_TASK_VIDEO:
if (mUploadMessage == null) { if (mUploadMessage == null) {
return; return;
} }
...@@ -4226,6 +4280,12 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -4226,6 +4280,12 @@ public class ContentViewActivity extends ABVContentViewActivity {
} }
if (cmd.equals(MeetingManager.CMD_ACTION)) { // 通常アクションボタン if (cmd.equals(MeetingManager.CMD_ACTION)) { // 通常アクションボタン
//同じアクションが連続で呼ばれる問題対応(司会者は1回送信しますが、2回受信される問題)
if (currentRemoteObjectId == remoteObjectId) {
Logger.e(TAG, "same remoteObjectId");
return;
}
currentRemoteObjectId = remoteObjectId;
View targetView = objectIdButtonMap.get(remoteObjectId); View targetView = objectIdButtonMap.get(remoteObjectId);
if (targetView == null) { if (targetView == null) {
VideoMountAction videoMountAction = findVideoMountAction(pageNumber, remoteObjectId); // 埋め込み動画の最初のアクション VideoMountAction videoMountAction = findVideoMountAction(pageNumber, remoteObjectId); // 埋め込み動画の最初のアクション
...@@ -4235,8 +4295,15 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -4235,8 +4295,15 @@ public class ContentViewActivity extends ABVContentViewActivity {
Logger.e(TAG, "[performRemoteEvent] targetView not found. remoteObjectId=" + remoteObjectId); // EMAILの場合はエラーが出てしまう。 Logger.e(TAG, "[performRemoteEvent] targetView not found. remoteObjectId=" + remoteObjectId); // EMAILの場合はエラーが出てしまう。
return; return;
} }
Logger.v(TAG, "[performRemoteEvent] perform click. remoteObjectId=%s targetView=%s", remoteObjectId, targetView); Logger.d(TAG, "[performRemoteEvent] perform click. remoteObjectId=%s targetView=%s", remoteObjectId, targetView);
targetView.performClick(); // ボタンをクリック targetView.performClick(); // ボタンをクリック
//なぜ2回呼ばれるのがわからないので、0.5秒後にcurrentRemoteObjectIdをリセットする。
handler.postDelayed(new Runnable() {
@Override
public void run() {
currentRemoteObjectId = 0;
}
}, 500);
} }
else if (cmd.equals(MeetingManager.CMD_LINKURLACTION)) { // PDF Link else if (cmd.equals(MeetingManager.CMD_LINKURLACTION)) { // PDF Link
String url = JsonUtil.getString(json, MeetingManager.URL); // null可 String url = JsonUtil.getString(json, MeetingManager.URL); // null可
...@@ -5527,5 +5594,15 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -5527,5 +5594,15 @@ public class ContentViewActivity extends ABVContentViewActivity {
operationTaskLayout.setIconStatus(taskKey,false); operationTaskLayout.setIconStatus(taskKey,false);
} }
/**
* 文書協業接続中の値を返して、接続中にはエラーダイアログ表示
* @return YES:接続中、NO:非接続
* */
public boolean isCollaborationConnected() {
if (isCollaboration) {
showSimpleAlertDialog(R.string.msg_fail_collaboration_not_action_allow);
}
return isCollaboration;
}
} }
...@@ -138,6 +138,8 @@ public class EnqueteWebViewActivity extends ABVContentViewActivity { ...@@ -138,6 +138,8 @@ public class EnqueteWebViewActivity extends ABVContentViewActivity {
settings.setAppCacheEnabled(false); settings.setAppCacheEnabled(false);
settings.setCacheMode(WebSettings.LOAD_NO_CACHE); settings.setCacheMode(WebSettings.LOAD_NO_CACHE);
// webView.loadDataWithBaseURL("", url2, "text/html", "UTF-8", ""); // webView.loadDataWithBaseURL("", url2, "text/html", "UTF-8", "");
//ターゲットバージョン30以上からデフォルトがfalseに設定されている問題対応
settings.setAllowFileAccess(true);
final RelativeLayout fl = (RelativeLayout) findViewById(R.id.frameTopbar); final RelativeLayout fl = (RelativeLayout) findViewById(R.id.frameTopbar);
......
...@@ -28,15 +28,8 @@ import android.webkit.URLUtil; ...@@ -28,15 +28,8 @@ import android.webkit.URLUtil;
import android.webkit.CookieManager; import android.webkit.CookieManager;
import android.webkit.DownloadListener; import android.webkit.DownloadListener;
import android.os.Environment; import android.os.Environment;
import android.webkit.WebViewClient;
import android.content.Context;
import android.graphics.Bitmap;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List;
import java.io.File;
import java.io.FileOutputStream;
import java.util.Objects;
import jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON; import jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON;
import jp.agentec.abook.abv.bl.acms.type.AcmsApis; import jp.agentec.abook.abv.bl.acms.type.AcmsApis;
...@@ -44,6 +37,7 @@ import jp.agentec.abook.abv.bl.acms.type.DownloadStatusType; ...@@ -44,6 +37,7 @@ import jp.agentec.abook.abv.bl.acms.type.DownloadStatusType;
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; import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.constant.ABookCommConstants;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys; import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
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;
...@@ -56,7 +50,6 @@ import jp.agentec.abook.abv.bl.logic.AbstractLogic; ...@@ -56,7 +50,6 @@ import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.OperationLogic; import jp.agentec.abook.abv.bl.logic.OperationLogic;
import jp.agentec.abook.abv.cl.util.ContentLogUtil; import jp.agentec.abook.abv.cl.util.ContentLogUtil;
import jp.agentec.abook.abv.launcher.android.R; import jp.agentec.abook.abv.launcher.android.R;
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.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;
...@@ -64,6 +57,7 @@ import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog; ...@@ -64,6 +57,7 @@ import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog;
import jp.agentec.abook.abv.ui.common.util.ABVToastUtil; import jp.agentec.abook.abv.ui.common.util.ABVToastUtil;
import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil; import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
import jp.agentec.abook.abv.ui.common.view.ABVPopupListWindow; import jp.agentec.abook.abv.ui.common.view.ABVPopupListWindow;
import jp.agentec.adf.util.StringUtil;
//TODO: later 遠隔連動関連はContentView,NoPdfViewと共通しているので要集約 //TODO: later 遠隔連動関連はContentView,NoPdfViewと共通しているので要集約
public class HTMLWebViewActivity extends ParentWebViewActivity { public class HTMLWebViewActivity extends ParentWebViewActivity {
...@@ -134,6 +128,7 @@ public class HTMLWebViewActivity extends ParentWebViewActivity { ...@@ -134,6 +128,7 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
settings.setCacheMode(WebSettings.LOAD_NO_CACHE); settings.setCacheMode(WebSettings.LOAD_NO_CACHE);
// webView.loadDataWithBaseURL("", url2, "text/html", "UTF-8", ""); // webView.loadDataWithBaseURL("", url2, "text/html", "UTF-8", "");
settings.setAllowFileAccessFromFileURLs(true); //Android7利用で警告ダイヤログ表示問題対応 settings.setAllowFileAccessFromFileURLs(true); //Android7利用で警告ダイヤログ表示問題対応
//ターゲットバージョン30以上からデフォルトがfalseに設定されている問題対応
settings.setAllowFileAccess(true); settings.setAllowFileAccess(true);
settings.setAllowContentAccess(true); settings.setAllowContentAccess(true);
settings.setAllowUniversalAccessFromFileURLs(true); settings.setAllowUniversalAccessFromFileURLs(true);
...@@ -168,8 +163,6 @@ public class HTMLWebViewActivity extends ParentWebViewActivity { ...@@ -168,8 +163,6 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
} }
}); });
final RelativeLayout fl = (RelativeLayout) findViewById(R.id.frameTopbar); final RelativeLayout fl = (RelativeLayout) findViewById(R.id.frameTopbar);
//fl.setVisibility(View.GONE); //fl.setVisibility(View.GONE);
...@@ -270,10 +263,10 @@ public class HTMLWebViewActivity extends ParentWebViewActivity { ...@@ -270,10 +263,10 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
FileChooserParams fileChooserParams) { FileChooserParams fileChooserParams) {
boolean result = false; boolean result = false;
if (fileChooserParams.getAcceptTypes()[0].toLowerCase().indexOf(ABookKeys.IMAGE) != -1) { if (fileChooserParams.getAcceptTypes()[0].toLowerCase().indexOf(ABookKeys.IMAGE) != -1) {
result = startCameraIntent(ABOOK_CHECK_TASK_IMAGE, "Camera", ABookKeys.IMAGE, true); result = startCameraIntent(ABookCommConstants.ABOOK_CHECK_TASK_IMAGE, "Camera", ABookKeys.IMAGE, true);
} else if (fileChooserParams.getAcceptTypes()[0].toLowerCase().indexOf(ABookKeys.VIDEO) != -1) { } else if (fileChooserParams.getAcceptTypes()[0].toLowerCase().indexOf(ABookKeys.VIDEO) != -1) {
result = startCameraIntent(ABOOK_CHECK_TASK_VIDEO, "Video", ABookKeys.VIDEO, true); result = startCameraIntent(ABookCommConstants.ABOOK_CHECK_TASK_VIDEO, "Video", ABookKeys.VIDEO, true);
} }
if (result) { if (result) {
...@@ -746,8 +739,22 @@ public class HTMLWebViewActivity extends ParentWebViewActivity { ...@@ -746,8 +739,22 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
} }
@Override @Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent) { protected void onActivityResult(int requestCode, int resultCode, final Intent intent) {
super.onActivityResult(requestCode, resultCode, intent); super.onActivityResult(requestCode, resultCode, intent);
if (requestCode == ABookCommConstants.PUSH_MESSAGE_DLG_REQUEST_CODE) {
// プッシュメッセージダイアログのリザルトだった場合
if (resultCode == ABookCommConstants.PUSH_MESSAGE_DLG_RESULT.OK && !StringUtil.isNullOrEmpty(baseActivityName)) {
if(mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) {
// 360編集をしている場合
callUnloadAuth();
}
finishActivity();
goChatRoom(intent, baseActivityName, HTMLWebViewActivity.class.getName());
}
return;
}
Uri[] result = null; Uri[] result = null;
Uri dataUri = null; Uri dataUri = null;
if (intent != null && resultCode == RESULT_OK) { if (intent != null && resultCode == RESULT_OK) {
...@@ -758,7 +765,7 @@ public class HTMLWebViewActivity extends ParentWebViewActivity { ...@@ -758,7 +765,7 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
} }
} }
if (requestCode == ABOOK_CHECK_TASK_IMAGE) { if (requestCode == ABookCommConstants.ABOOK_CHECK_TASK_IMAGE) {
if (mUploadMessage == null) { if (mUploadMessage == null) {
return; return;
} }
...@@ -778,12 +785,12 @@ public class HTMLWebViewActivity extends ParentWebViewActivity { ...@@ -778,12 +785,12 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
mUploadMessage.onReceiveValue(null); mUploadMessage.onReceiveValue(null);
ErrorMessage.showErrorMessageToast(getApplicationContext(), ErrorCode.E107); ErrorMessage.showErrorMessageToast(getApplicationContext(), ErrorCode.E107);
} }
} else if (requestCode == ABOOK_CHECK_TASK_VIDEO) { } else if (requestCode == ABookCommConstants.ABOOK_CHECK_TASK_VIDEO) {
if (mUploadMessage == null) { if (mUploadMessage == null) {
return; return;
} }
mUploadMessage.onReceiveValue(result); mUploadMessage.onReceiveValue(result);
} else if (requestCode == ABOOK_CHECK_SELECT_SCENE) { } else if (requestCode == ABookCommConstants.ABOOK_CHECK_SELECT_SCENE) {
if (intent != null && result != null) { if (intent != null && result != null) {
confirmEntrySceneDialog(result[0]); confirmEntrySceneDialog(result[0]);
} }
......
...@@ -51,6 +51,7 @@ import jp.agentec.abook.abv.bl.common.ABVEnvironment; ...@@ -51,6 +51,7 @@ import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.Callback; import jp.agentec.abook.abv.bl.common.Callback;
import jp.agentec.abook.abv.bl.common.CommonExecutor; import jp.agentec.abook.abv.bl.common.CommonExecutor;
import jp.agentec.abook.abv.bl.common.Constant; import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.constant.ABookCommConstants;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys; import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.log.Logger; import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.data.dao.AbstractDao; import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
...@@ -272,9 +273,9 @@ public class HTMLXWalkWebViewActivity extends ParentWebViewActivity { ...@@ -272,9 +273,9 @@ public class HTMLXWalkWebViewActivity extends ParentWebViewActivity {
Logger.d(TAG, "*********************commonOpenFileChooser"); Logger.d(TAG, "*********************commonOpenFileChooser");
boolean result = false; boolean result = false;
if (acceptType.toLowerCase().indexOf(ABookKeys.IMAGE) != -1) { if (acceptType.toLowerCase().indexOf(ABookKeys.IMAGE) != -1) {
result = startCameraIntent(ABOOK_CHECK_TASK_IMAGE, "Camera", ABookKeys.IMAGE, true); result = startCameraIntent(ABookCommConstants.ABOOK_CHECK_TASK_IMAGE, "Camera", ABookKeys.IMAGE, true);
} else if (acceptType.toLowerCase().indexOf(ABookKeys.VIDEO) != -1) { } else if (acceptType.toLowerCase().indexOf(ABookKeys.VIDEO) != -1) {
result = startCameraIntent(ABOOK_CHECK_TASK_VIDEO, "Video", ABookKeys.VIDEO, true); result = startCameraIntent(ABookCommConstants.ABOOK_CHECK_TASK_VIDEO, "Video", ABookKeys.VIDEO, true);
} }
mUploadMessage = uploadFile; mUploadMessage = uploadFile;
if (result) { if (result) {
...@@ -773,7 +774,7 @@ public class HTMLXWalkWebViewActivity extends ParentWebViewActivity { ...@@ -773,7 +774,7 @@ public class HTMLXWalkWebViewActivity extends ParentWebViewActivity {
protected void onActivityResult(int requestCode, int resultCode, Intent intent) { protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
Uri result = (intent == null || resultCode != RESULT_OK) ? null : intent.getData(); Uri result = (intent == null || resultCode != RESULT_OK) ? null : intent.getData();
if (requestCode == ABOOK_CHECK_TASK_IMAGE) { if (requestCode == ABookCommConstants.ABOOK_CHECK_TASK_IMAGE) {
if (mUploadMessage == null) { if (mUploadMessage == null) {
return; return;
} }
...@@ -789,13 +790,13 @@ public class HTMLXWalkWebViewActivity extends ParentWebViewActivity { ...@@ -789,13 +790,13 @@ public class HTMLXWalkWebViewActivity extends ParentWebViewActivity {
mUploadMessage.onReceiveValue(null); mUploadMessage.onReceiveValue(null);
ErrorMessage.showErrorMessageToast(getApplicationContext(), ErrorCode.E107); ErrorMessage.showErrorMessageToast(getApplicationContext(), ErrorCode.E107);
} }
} else if (requestCode == ABOOK_CHECK_TASK_VIDEO) { } else if (requestCode == ABookCommConstants.ABOOK_CHECK_TASK_VIDEO) {
if (mUploadMessage == null) { if (mUploadMessage == null) {
return; return;
} }
// 動画 // 動画
mUploadMessage.onReceiveValue(result); mUploadMessage.onReceiveValue(result);
} else if (requestCode == ABOOK_CHECK_SELECT_SCENE) { } else if (requestCode == ABookCommConstants.ABOOK_CHECK_SELECT_SCENE) {
if (intent != null && result != null) { if (intent != null && result != null) {
confirmEntrySceneDialog(result); confirmEntrySceneDialog(result);
} }
......
package jp.agentec.abook.abv.ui.viewer.activity; package jp.agentec.abook.abv.ui.viewer.activity;
import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
...@@ -12,17 +13,16 @@ import android.widget.ImageButton; ...@@ -12,17 +13,16 @@ import android.widget.ImageButton;
import java.util.ArrayList; import java.util.ArrayList;
import jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON; import jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON;
import jp.agentec.abook.abv.bl.common.ABVEnvironment; 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.log.Logger;
import jp.agentec.abook.abv.bl.data.ABVDataCache;
import jp.agentec.abook.abv.bl.data.dao.AbstractDao; import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
import jp.agentec.abook.abv.bl.data.dao.ContentDao; import jp.agentec.abook.abv.bl.data.dao.ContentDao;
import jp.agentec.abook.abv.bl.dto.ContentDto; import jp.agentec.abook.abv.bl.dto.ContentDto;
import jp.agentec.abook.abv.launcher.android.R; import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.activity.ABVContentViewActivity; import jp.agentec.abook.abv.ui.common.activity.ABVContentViewActivity;
import jp.agentec.abook.abv.ui.common.appinfo.options.Options;
import jp.agentec.abook.abv.ui.common.view.ABVPopupListWindow; import jp.agentec.abook.abv.ui.common.view.ABVPopupListWindow;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper; import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.adf.util.StringUtil;
// TODO: later 遠隔連動関連はContentView,HTMLWebViewと共通しているので要集約 // TODO: later 遠隔連動関連はContentView,HTMLWebViewと共通しているので要集約
public class NoPdfViewActivity extends ABVContentViewActivity { public class NoPdfViewActivity extends ABVContentViewActivity {
...@@ -209,4 +209,17 @@ public class NoPdfViewActivity extends ABVContentViewActivity { ...@@ -209,4 +209,17 @@ public class NoPdfViewActivity extends ABVContentViewActivity {
layout.addView(view); layout.addView(view);
} }
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
super.onActivityResult(requestCode, requestCode, intent);
if (requestCode == ABookCommConstants.PUSH_MESSAGE_DLG_REQUEST_CODE) {
// プッシュメッセージダイアログのリザルトだった場合
if (resultCode == ABookCommConstants.PUSH_MESSAGE_DLG_RESULT.OK && !StringUtil.isNullOrEmpty(baseActivityName)) {
finishActivity();
goChatRoom(intent, baseActivityName, getClass().getName());
}
return;
}
}
} }
...@@ -114,6 +114,8 @@ public class OnlineHTMLWebViewActivity extends ABVContentViewActivity { ...@@ -114,6 +114,8 @@ public class OnlineHTMLWebViewActivity extends ABVContentViewActivity {
settings.setAppCacheEnabled(false); settings.setAppCacheEnabled(false);
settings.setCacheMode(WebSettings.LOAD_NO_CACHE); settings.setCacheMode(WebSettings.LOAD_NO_CACHE);
settings.setAllowFileAccessFromFileURLs(true); //Android7利用で警告ダイヤログ表示問題対応 settings.setAllowFileAccessFromFileURLs(true); //Android7利用で警告ダイヤログ表示問題対応
//ターゲットバージョン30以上からデフォルトがfalseに設定されている問題対応
settings.setAllowFileAccess(true);
webView.setWebViewClient(new WebViewClient() { webView.setWebViewClient(new WebViewClient() {
@Override @Override
......
...@@ -122,6 +122,9 @@ public class PhotoEditActivity extends Dialog { ...@@ -122,6 +122,9 @@ public class PhotoEditActivity extends Dialog {
editPageWebView.setVisibility(View.GONE); editPageWebView.setVisibility(View.GONE);
//ターゲットバージョン30以上からデフォルトがfalseに設定されている問題対応
editPageWebView.getSettings().setAllowFileAccess(true);
//ページをロード //ページをロード
editPageWebView.loadUrl(editToolPath); editPageWebView.loadUrl(editToolPath);
......
...@@ -147,7 +147,7 @@ public class FoxitPdfCore { ...@@ -147,7 +147,7 @@ public class FoxitPdfCore {
* @throws PDFException * @throws PDFException
*/ */
public PointF getPageSize(int pageIndex) throws PDFException { public PointF getPageSize(int pageIndex) throws PDFException {
Logger.i("getPageSize : " + pageIndex); Logger.d("getPageSize : " + pageIndex);
PDFPage pdfPage = mPDFDoc.getPage(pageIndex); PDFPage pdfPage = mPDFDoc.getPage(pageIndex);
return new PointF(pdfPage.getWidth(), pdfPage.getHeight()); return new PointF(pdfPage.getWidth(), pdfPage.getHeight());
} }
...@@ -165,7 +165,7 @@ public class FoxitPdfCore { ...@@ -165,7 +165,7 @@ public class FoxitPdfCore {
* @return * @return
*/ */
public Bitmap drawPage(int page, int pageW, int pageH, int patchX, int patchY, int patchW, int patchH) { public Bitmap drawPage(int page, int pageW, int pageH, int patchX, int patchY, int patchW, int patchH) {
Logger.i(TAG, "drawPage start."); Logger.d(TAG, "drawPage start.");
synchronized (mContext) { synchronized (mContext) {
Bitmap bm = Bitmap.createBitmap(patchW, patchH, Bitmap.Config.ARGB_8888); Bitmap bm = Bitmap.createBitmap(patchW, patchH, Bitmap.Config.ARGB_8888);
PDFPage pdfPage = loadPage(mPDFDoc, page, PDFPage.e_ParsePageNormal); PDFPage pdfPage = loadPage(mPDFDoc, page, PDFPage.e_ParsePageNormal);
...@@ -198,7 +198,7 @@ public class FoxitPdfCore { ...@@ -198,7 +198,7 @@ public class FoxitPdfCore {
Logger.e(TAG, "Failed to render the page No.%d! %s", page, e.getMessage()); Logger.e(TAG, "Failed to render the page No.%d! %s", page, e.getMessage());
} }
Logger.i(TAG, "drawPage end."); Logger.d(TAG, "drawPage end.");
return bm; return bm;
} }
} }
......
...@@ -264,7 +264,7 @@ public class PdfImageProvider { ...@@ -264,7 +264,7 @@ public class PdfImageProvider {
Logger.d(TAG, "setPauseTask " + ste.getClassName() + "#" + ste.getMethodName() + " " + pauseTask); Logger.d(TAG, "setPauseTask " + ste.getClassName() + "#" + ste.getMethodName() + " " + pauseTask);
} }
else { else {
Logger.i(TAG, "setPauseTask " + pauseTask); Logger.d(TAG, "setPauseTask " + pauseTask);
} }
if (pauseTask) { if (pauseTask) {
pauseTaskCount++; pauseTaskCount++;
...@@ -307,7 +307,7 @@ public class PdfImageProvider { ...@@ -307,7 +307,7 @@ public class PdfImageProvider {
int width = (int) (size.x * pageScale); int width = (int) (size.x * pageScale);
int height = (int) (size.y * pageScale); int height = (int) (size.y * pageScale);
Logger.i(TAG, "[drawPage]: pageNumber=" + pageNumber + " width=" + width + " height=" + height + " imagePath=" + imagePath); Logger.d(TAG, "[drawPage]: pageNumber=" + pageNumber + " width=" + width + " height=" + height + " imagePath=" + imagePath);
Bitmap bm = null; Bitmap bm = null;
try { try {
bm = mFoxitPdfCore.drawPage(pageNumber, width, height, 0, 0, width, height); bm = mFoxitPdfCore.drawPage(pageNumber, width, height, 0, 0, width, height);
......
...@@ -86,8 +86,7 @@ public class AudioPlayView extends RelativeLayout { ...@@ -86,8 +86,7 @@ public class AudioPlayView extends RelativeLayout {
if (StringUtil.isNullOrEmpty(contentName)) { // オーサリング動画の場合 if (StringUtil.isNullOrEmpty(contentName)) { // オーサリング動画の場合
LinearLayout linearLayout1 = (LinearLayout)controlLayout.findViewById(R.id.linear1); LinearLayout linearLayout1 = (LinearLayout)controlLayout.findViewById(R.id.linear1);
linearLayout1.setVisibility(View.GONE); linearLayout1.setVisibility(View.GONE);
} } else { // 動画コンテンツの場合
else { // 動画コンテンツの場合
TextView txtTitle = (TextView)controlLayout.findViewById(R.id.txtTitle); TextView txtTitle = (TextView)controlLayout.findViewById(R.id.txtTitle);
txtTitle.setText(contentName); txtTitle.setText(contentName);
...@@ -192,8 +191,7 @@ public class AudioPlayView extends RelativeLayout { ...@@ -192,8 +191,7 @@ public class AudioPlayView extends RelativeLayout {
if (mMediaPlayer.isPlaying()) { if (mMediaPlayer.isPlaying()) {
mBtnPlay.setImageDrawable(getResources().getDrawable(R.drawable.btn_play)); mBtnPlay.setImageDrawable(getResources().getDrawable(R.drawable.btn_play));
pause(); pause();
} } else{
else{
mBtnPlay.setImageDrawable(getResources().getDrawable(R.drawable.btn_pause)); mBtnPlay.setImageDrawable(getResources().getDrawable(R.drawable.btn_pause));
restart(); restart();
} }
...@@ -214,8 +212,7 @@ public class AudioPlayView extends RelativeLayout { ...@@ -214,8 +212,7 @@ public class AudioPlayView extends RelativeLayout {
position = 0; position = 0;
} }
jump(position); jump(position);
} } else {
else {
btnBackward.setImageDrawable(getResources().getDrawable(R.drawable.btn_backward)); btnBackward.setImageDrawable(getResources().getDrawable(R.drawable.btn_backward));
} }
return false; return false;
...@@ -236,8 +233,7 @@ public class AudioPlayView extends RelativeLayout { ...@@ -236,8 +233,7 @@ public class AudioPlayView extends RelativeLayout {
position = duration; position = duration;
} }
jump(position); jump(position);
} } else {
else {
btnForward.setImageDrawable(getResources().getDrawable(R.drawable.btn_forward)); btnForward.setImageDrawable(getResources().getDrawable(R.drawable.btn_forward));
} }
return false; return false;
...@@ -272,8 +268,7 @@ public class AudioPlayView extends RelativeLayout { ...@@ -272,8 +268,7 @@ public class AudioPlayView extends RelativeLayout {
LinearLayout.LayoutParams params; LinearLayout.LayoutParams params;
if (config.orientation == Configuration.ORIENTATION_LANDSCAPE && !isMobile) { if (config.orientation == Configuration.ORIENTATION_LANDSCAPE && !isMobile) {
params = new LinearLayout.LayoutParams((int) (density * 500), ViewGroup.LayoutParams.WRAP_CONTENT); params = new LinearLayout.LayoutParams((int) (density * 500), ViewGroup.LayoutParams.WRAP_CONTENT);
} } else {
else {
params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
} }
...@@ -285,8 +280,7 @@ public class AudioPlayView extends RelativeLayout { ...@@ -285,8 +280,7 @@ public class AudioPlayView extends RelativeLayout {
if (isMobile && point.x < point.y) { // モバイルで縦長の場合、戻り・早送りはなし if (isMobile && point.x < point.y) { // モバイルで縦長の場合、戻り・早送りはなし
btnBackward.setVisibility(View.GONE); btnBackward.setVisibility(View.GONE);
btnForward.setVisibility(View.GONE); btnForward.setVisibility(View.GONE);
} } else {
else {
btnBackward.setVisibility(View.VISIBLE); btnBackward.setVisibility(View.VISIBLE);
btnForward.setVisibility(View.VISIBLE); btnForward.setVisibility(View.VISIBLE);
} }
...@@ -401,6 +395,10 @@ public class AudioPlayView extends RelativeLayout { ...@@ -401,6 +395,10 @@ public class AudioPlayView extends RelativeLayout {
public void stop() { public void stop() {
if (mMediaPlayer != null) { if (mMediaPlayer != null) {
mVisualizer.release(); mVisualizer.release();
if (mMediaPlayer.isPlaying()){
mMediaPlayer.stop();
}
mMediaPlayer.reset();
mMediaPlayer.release(); mMediaPlayer.release();
mMediaPlayer = null; mMediaPlayer = null;
} }
......
...@@ -127,7 +127,8 @@ public class EnqueteLayout extends RelativeLayout { ...@@ -127,7 +127,8 @@ public class EnqueteLayout extends RelativeLayout {
settings.setAppCacheEnabled(false); settings.setAppCacheEnabled(false);
settings.setCacheMode(WebSettings.LOAD_NO_CACHE); settings.setCacheMode(WebSettings.LOAD_NO_CACHE);
} }
//ターゲットバージョン30以上からデフォルトがfalseに設定されている問題対応
mWebView.getSettings().setAllowFileAccess(true);
if (Logger.isDebugEnabled()) { if (Logger.isDebugEnabled()) {
mWebView.setWebContentsDebuggingEnabled(true); //デバッグモード(chromeからinspect可) mWebView.setWebContentsDebuggingEnabled(true); //デバッグモード(chromeからinspect可)
} }
......
...@@ -24,6 +24,7 @@ import java.util.ArrayList; ...@@ -24,6 +24,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import jp.agentec.abook.abv.bl.common.Constant; import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.constant.ABookCommConstants;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys; import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.log.Logger; import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.data.dao.AbstractDao; import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
...@@ -106,7 +107,8 @@ public class OperationTaskLayout extends RelativeLayout { ...@@ -106,7 +107,8 @@ public class OperationTaskLayout extends RelativeLayout {
settings.setCacheMode(WebSettings.LOAD_NO_CACHE); settings.setCacheMode(WebSettings.LOAD_NO_CACHE);
// mWebView.loadDataWithBaseURL("", url2, "text/html", "UTF-8", ""); // mWebView.loadDataWithBaseURL("", url2, "text/html", "UTF-8", "");
settings.setAllowFileAccessFromFileURLs(true); //Android7利用で警告ダイヤログ表示問題対応 settings.setAllowFileAccessFromFileURLs(true); //Android7利用で警告ダイヤログ表示問題対応
//ターゲットバージョン30以上からデフォルトがfalseに設定されている問題対応
settings.setAllowFileAccess(true);
mWebView.setAlpha((int) (255 * 1.0f)); mWebView.setAlpha((int) (255 * 1.0f));
if (Build.VERSION.SDK_INT >= 29) { if (Build.VERSION.SDK_INT >= 29) {
mWebView.setLayerType(View.LAYER_TYPE_SOFTWARE, null); mWebView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
...@@ -136,10 +138,10 @@ public class OperationTaskLayout extends RelativeLayout { ...@@ -136,10 +138,10 @@ public class OperationTaskLayout extends RelativeLayout {
FileChooserParams fileChooserParams) { FileChooserParams fileChooserParams) {
boolean result = false; boolean result = false;
if(fileChooserParams.getAcceptTypes()[0].toLowerCase().indexOf(ABookKeys.IMAGE) != -1) { if(fileChooserParams.getAcceptTypes()[0].toLowerCase().indexOf(ABookKeys.IMAGE) != -1) {
result = ((ABVActivity)context).startCameraIntent(((ABVContentViewActivity)context).ABOOK_CHECK_TASK_IMAGE, "Camera", ABookKeys.IMAGE, true); result = ((ABVActivity)context).startCameraIntent(ABookCommConstants.ABOOK_CHECK_TASK_IMAGE, "Camera", ABookKeys.IMAGE, true);
} else if(fileChooserParams.getAcceptTypes()[0].toLowerCase().indexOf(ABookKeys.VIDEO) != -1) { } else if(fileChooserParams.getAcceptTypes()[0].toLowerCase().indexOf(ABookKeys.VIDEO) != -1) {
result = ((ABVActivity)context).startCameraIntent(((ABVContentViewActivity)context).ABOOK_CHECK_TASK_VIDEO, "Video", ABookKeys.VIDEO, true); result = ((ABVActivity)context).startCameraIntent(ABookCommConstants.ABOOK_CHECK_TASK_VIDEO, "Video", ABookKeys.VIDEO, true);
} }
if (result) { if (result) {
......
...@@ -345,6 +345,11 @@ public class VideoMountAction { ...@@ -345,6 +345,11 @@ public class VideoMountAction {
} }
private void videoOnClick(RelativeLayout contentPageView) { private void videoOnClick(RelativeLayout contentPageView) {
//文書協業接続中、埋め込み動画制限
if (mActivity.isCollaborationConnected()) {
return;
}
if (((ZoomRelativeLayout)contentPageView).isZooming() == false) { if (((ZoomRelativeLayout)contentPageView).isZooming() == false) {
//動画の表示・再生 //動画の表示・再生
if (meetingManager.isSendable()) { if (meetingManager.isSendable()) {
......
...@@ -86,8 +86,8 @@ is_check_invalid_passward_limit=true ...@@ -86,8 +86,8 @@ is_check_invalid_passward_limit=true
repeat_default=true repeat_default=true
#Setting Info(設定画面のABookについての設定情報) #Setting Info(設定画面のABookについての設定情報)
version_name=1.4.100 version_name=1.4.201
release_date=2021/07/29 release_date=2021/09/21
copy_right=2016 AGENTEC Co.,Ltd. All rights reserved. copy_right=2016 AGENTEC Co.,Ltd. All rights reserved.
hope_page=http://www.agentec.jp hope_page=http://www.agentec.jp
contact_email=abook-appsupport@agentec.jp contact_email=abook-appsupport@agentec.jp
......
apply plugin: 'com.android.library' apply plugin: 'com.android.library'
android { android {
compileSdkVersion 26 compileSdkVersion 30
buildToolsVersion '28.0.3' buildToolsVersion '30.0.2'
defaultConfig { defaultConfig {
minSdkVersion 23 minSdkVersion 23
targetSdkVersion 29 targetSdkVersion 30
} }
buildTypes { buildTypes {
......
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