Commit 34ec142b by Lee Munkyeong

Merge branch 'features/1.4.0' of…

Merge branch 'features/1.4.0' of https://gitlab.agentec.jp/abook_android/abook_check into features/1.4.0_lmk
parents 2e65f899 1c0e2c92
......@@ -40,10 +40,12 @@ import jp.agentec.abook.abv.bl.acms.client.json.OperationListJSON;
import jp.agentec.abook.abv.bl.acms.client.json.ProcessDataJSON;
import jp.agentec.abook.abv.bl.acms.client.json.RequirePasswordChangeJSON;
import jp.agentec.abook.abv.bl.acms.client.json.ResultJSON;
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.SceneEntryJSON;
import jp.agentec.abook.abv.bl.acms.client.json.ServerTimeZoneJSON;
import jp.agentec.abook.abv.bl.acms.client.json.ServiceOptionsJSON;
import jp.agentec.abook.abv.bl.acms.client.json.UnreadCountJSON;
import jp.agentec.abook.abv.bl.acms.client.json.UserInviteResultJSON;
import jp.agentec.abook.abv.bl.acms.client.json.WorkerGroupJSON;
import jp.agentec.abook.abv.bl.acms.client.parameters.AbstractAcmsLoginParameters;
......@@ -53,6 +55,7 @@ import jp.agentec.abook.abv.bl.acms.client.parameters.AddMemberGroupParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.AppStoreNewLoginParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.ArchiveDetailRequestParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.ArchiveRequestParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.ChangeCollaborationParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.ChangeRoomNameParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.CheckSendLogParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.ContentReadingLogParameters;
......@@ -62,6 +65,7 @@ import jp.agentec.abook.abv.bl.acms.client.parameters.EnterpriseLoginParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.EnterpriseNewLoginParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.FavoriteGroupParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.FavoriteUserParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.FinishCollaborationParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.GetApertureMasterDataParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.GetContentParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.GetEnqueteReplyParameters;
......@@ -562,6 +566,12 @@ public class AcmsClient implements AcmsClientResponseListener {
return json;
}
public RoomJSON getRoom(String sid,String roomId) throws NetworkDisconnectedException, AcmsException {
HttpResponse response = send(AcmsApis.ApigetChatRooms, new GetMessagesParameters(sid, AcmsApis.RoomCmds.getRoom, roomId, null, null, null ));
RoomJSON json = new RoomJSON(response.httpResponseBody);
return json;
}
/**
* ログインしたユーザの情報を取得する。
*
......@@ -595,14 +605,13 @@ public class AcmsClient implements AcmsClientResponseListener {
* 全てのグループ更新。
*
* @param sid
* @param groupId
* @param updatedDate
* @return
* @throws NetworkDisconnectedException
* @throws AcmsException
*/
public GroupListJSON getGroupInfo(String sid, String groupId, String updatedDate) throws NetworkDisconnectedException, AcmsException {
HttpResponse response = send(AcmsApis.ApigetUser, new GetGroupInfoParameters(sid, AcmsApis.UserCmds.getGroupInfo, groupId, updatedDate));
public GroupListJSON getGroupInfo(String sid, String updatedDate) throws NetworkDisconnectedException, AcmsException {
HttpResponse response = send(AcmsApis.ApigetUser, new GetGroupInfoParameters(sid, AcmsApis.UserCmds.getGroupInfo, updatedDate));
GroupListJSON json = new GroupListJSON(response.httpResponseBody);
return json;
}
......@@ -649,12 +658,17 @@ public class AcmsClient implements AcmsClientResponseListener {
* @throws NetworkDisconnectedException
* @throws AcmsException
*/
public MessageInfoListJSON getMessages(String sid, String roomId) throws NetworkDisconnectedException, AcmsException {
HttpResponse response = send(AcmsApis.ApigetMessage, new GetMessagesParameters(sid, AcmsApis.MessageCmds.getMessages, roomId, "0"));
public MessageInfoListJSON getMessages(String sid, String roomId, String messageId, String updateDate) throws NetworkDisconnectedException, AcmsException {
HttpResponse response = send(AcmsApis.ApigetMessage, new GetMessagesParameters(sid, AcmsApis.MessageCmds.getMessages, roomId, "0", messageId, updateDate));
MessageInfoListJSON json = new MessageInfoListJSON(response.httpResponseBody);
return json;
}
public UnreadCountJSON getMessagesUnreadCount(String sid, String roomId) throws NetworkDisconnectedException, AcmsException {
HttpResponse response = send(AcmsApis.ApigetMessage, new GetMessagesParameters(sid, AcmsApis.MessageCmds.getUnreadCount, roomId, "0", null, null));
UnreadCountJSON json = new UnreadCountJSON(response.httpResponseBody);
return json;
}
/**
* ユーザ招待。
*
......@@ -795,12 +809,25 @@ public class AcmsClient implements AcmsClientResponseListener {
* @throws NetworkDisconnectedException
* @throws AcmsException
*/
public ArchiveDetailJSON joinCollaboration(String sid, Integer roomId) throws NetworkDisconnectedException, AcmsException {
public void joinCollaboration(String sid, Integer roomId) throws NetworkDisconnectedException, AcmsException {
HttpResponse response = send(AcmsApis.ApigetCollaboration, new JoinCollaborationParameters(sid, AcmsApis.CollaborationCmds.join, roomId));
ArchiveDetailJSON json = new ArchiveDetailJSON(response.httpResponseBody);
return json;
if (response.httpResponseCode != 200) {
}
}
public void finishCollaboration(String sid, int roomId) throws NetworkDisconnectedException, AcmsException {
HttpResponse response = send(AcmsApis.ApigetCollaboration, new FinishCollaborationParameters(sid, AcmsApis.CollaborationCmds.finish, roomId));
}
public void finishAllCollaboration(String sid, int roomId) throws NetworkDisconnectedException, AcmsException {
send(AcmsApis.ApigetCollaboration, new FinishCollaborationParameters(sid, AcmsApis.CollaborationCmds.finishAll, roomId));
}
public void changeCollaboration(String sid, int roomId, int changeCollaborationType, int meetingId) throws NetworkDisconnectedException, AcmsException {
HttpResponse response = send(AcmsApis.ApigetCollaboration, new ChangeCollaborationParameters(sid, AcmsApis.CollaborationCmds.change, roomId, changeCollaborationType, meetingId));
}
/**
* 協業内ユーザー招待
*
......@@ -813,10 +840,11 @@ public class AcmsClient implements AcmsClientResponseListener {
* @throws NetworkDisconnectedException
* @throws AcmsException
*/
public ArchiveDetailJSON inviteCollaboration(String sid, Integer roomId, String roomName, String inveitedUserIds, String collaborationType) throws NetworkDisconnectedException, AcmsException {
public void inviteCollaboration(String sid, Integer roomId, String roomName, String inveitedUserIds, String collaborationType) throws NetworkDisconnectedException, AcmsException {
HttpResponse response = send(AcmsApis.ApigetCollaboration, new InviteCollaborationParameters(sid, AcmsApis.CollaborationCmds.invite, roomId, roomName, inveitedUserIds, collaborationType));
ArchiveDetailJSON json = new ArchiveDetailJSON(response.httpResponseBody);
return json;
if (response.httpResponseCode != 200) {
}
}
/**
......@@ -1112,9 +1140,7 @@ public class AcmsClient implements AcmsClientResponseListener {
*/
private HttpResponse send(String methodName, HttpParameterObject param) throws NetworkDisconnectedException, AcmsException {
Logger.d(TAG, "call api : %s", methodName);
String apiUrl = AcmsApis.getApiUrl(env.acmsAddress, urlPath, methodName);
HttpResponse response = send(apiUrl, methodName, param);
// 最終アクセス時間更新
......@@ -1251,7 +1277,7 @@ public class AcmsClient implements AcmsClientResponseListener {
public Date getLastPresentTime() {
return lastPresentTime;
}
private class HttpTaskWorker <T extends HttpParameterObject> extends Thread {
private String methodName = null;
private boolean result = false;
......
......@@ -8,9 +8,11 @@ import java.util.ArrayList;
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.JSONValidationException;
import jp.agentec.abook.abv.bl.common.util.JsonUtil;
import jp.agentec.abook.abv.bl.dto.ArchiveDto;
import jp.agentec.abook.abv.bl.dto.ChatGroupDto;
import jp.agentec.abook.abv.bl.dto.ShopMemberDto;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
public class ArchiveListJSON extends AcmsCommonJSON {
......@@ -41,18 +43,25 @@ public class ArchiveListJSON extends AcmsCommonJSON {
ArchiveDto archiveDto = new ArchiveDto();
archiveDto.archiveId = archiveJSON.getInt(ABookCommConstants.KEY.ARCHIVE_ID);
archiveDto.collaborationDetailId = archiveJSON.getInt(ABookCommConstants.KEY.COLLABORATION_DEATAIL_ID);
archiveDto.archiveName = archiveJSON.getString(ABookCommConstants.KEY.ARCHIVE_NAME);
archiveDto.archiveType = archiveJSON.getInt(ABookCommConstants.KEY.ARCHIVE_TYPE);
archiveDto.archiveDate = DateTimeUtil.millToDateString(archiveJSON.getJSONObject(ABookCommConstants.KEY.ARCHIVE_DATE)
.getLong(ABookCommConstants.KEY.TIME), "yyyy/MM/dd HH:mm");
archiveDto.archiveType = archiveJSON.getInt(ABookCommConstants.KEY.ARCHIVE_TYPE);
archiveDto.delFlg = archiveJSON.getInt(ABookCommConstants.KEY.DEL_FLG);
archiveDto.collaborationDetailId = archiveJSON.getInt(ABookCommConstants.KEY.COLLABORATION_DEATAIL_ID);
archiveDto.roomId = archiveJSON.getInt(ABookCommConstants.KEY.ROOM_ID);
archiveDto.saveUserId = archiveJSON.getInt(ABookCommConstants.KEY.SAVE_USER_ID);
archiveDto.filePath = archiveJSON.getString(ABookCommConstants.KEY.FILE_PATH);
if (archiveJSON.has(ABookCommConstants.KEY.ATTEND_USER_IDS)) {
archiveDto.attendUserIds = archiveJSON.getJSONArray(ABookCommConstants.KEY.ATTEND_USER_IDS).toString();
}
archiveList.add(archiveDto);
}
if (json.getJSONObject(ABookCommConstants.KEY.BODY).has(ABookCommConstants.KEY.ARCHIVE_INFO_LAST_UPDATE_DATE)) {
archiveLastUpdateDate = json.getJSONObject(ABookCommConstants.KEY.BODY).getString(ABookCommConstants.KEY.ARCHIVE_INFO_LAST_UPDATE_DATE);
}
String time = JsonUtil.getString(json, PresentTime);
presentTime = DateTimeUtil.toDate(time, DateTimeFormat.yyyyMMddHHmmss_hyphen);
archiveLastUpdateDate = DateTimeUtil.toString(presentTime, DateTimeFormat.yyyyMMddHHmmss_none);
}
}
......@@ -4,18 +4,22 @@ import org.json.adf.JSONArray;
import org.json.adf.JSONObject;
import java.util.ArrayList;
import java.util.Date;
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.JSONValidationException;
import jp.agentec.abook.abv.bl.common.util.JsonUtil;
import jp.agentec.abook.abv.bl.dto.ChatGroupDto;
import jp.agentec.abook.abv.bl.dto.ShopMemberDto;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
public class GroupListJSON extends AcmsCommonJSON {
public ArrayList<ChatGroupDto> groupList;
public String allGroupLastUpdateDate;
public String lastRequestDate;
public GroupListJSON(String jsonString) throws AcmsException {
super(jsonString);
......@@ -46,9 +50,6 @@ public class GroupListJSON extends AcmsCommonJSON {
}
groupDto.groupName = groupJSON.getString(ABookCommConstants.KEY.GROUP_NAME);
groupDto.delFlg = groupJSON.getInt(ABookCommConstants.KEY.DEL_FLG);
if (groupJSON.has(ABookCommConstants.KEY.GROUP_INFO_LAST_UPDATE_DATE)) {
groupDto.updateDate = groupJSON.getString(ABookCommConstants.KEY.GROUP_INFO_LAST_UPDATE_DATE);
}
if (groupJSON.has(ABookCommConstants.KEY.GROUP_MEMBER_LIST)) {
JSONArray groupMemberJsonArray = groupJSON.getJSONArray(ABookCommConstants.KEY.GROUP_MEMBER_LIST);
ArrayList<ShopMemberDto> groupMembers = new ArrayList<ShopMemberDto>();
......@@ -62,19 +63,15 @@ public class GroupListJSON extends AcmsCommonJSON {
if (groupMember.has(ABookCommConstants.KEY.PROFILE_IMAGE_PATH)) {
shopMemberDto.profileUrl = groupMember.getString(ABookCommConstants.KEY.PROFILE_IMAGE_PATH);
}
ArrayList groupIds = new ArrayList();
groupIds.add(groupDto.groupId);
shopMemberDto.groupIdList = groupIds;
groupMembers.add(shopMemberDto);
}
groupDto.groupMembers = groupMembers;
}
groupList.add(groupDto);
}
if (json.getJSONObject(ABookCommConstants.KEY.BODY).has(ABookCommConstants.KEY.GROUP_INFO_LAST_UPDATE_DATE)) {
allGroupLastUpdateDate = json.getJSONObject(ABookCommConstants.KEY.BODY).getString(ABookCommConstants.KEY.GROUP_INFO_LAST_UPDATE_DATE);
}
String time = JsonUtil.getString(json, PresentTime);
presentTime = DateTimeUtil.toDate(time, DateTimeFormat.yyyyMMddHHmmss_hyphen);
lastRequestDate = DateTimeUtil.toString(presentTime, DateTimeFormat.yyyyMMddHHmmss_none);
}
}
......
......@@ -9,8 +9,10 @@ import java.util.HashMap;
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.JSONValidationException;
import jp.agentec.abook.abv.bl.common.util.JsonUtil;
import jp.agentec.abook.abv.bl.dto.ChatMessageDto;
import jp.agentec.abook.abv.bl.dto.ShopMemberDto;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
public class MessageInfoListJSON extends AcmsCommonJSON {
......@@ -18,6 +20,7 @@ public class MessageInfoListJSON extends AcmsCommonJSON {
public ArrayList<ChatMessageDto> chatMessageDtoArrayList;
public ArrayList<ShopMemberDto> shopMemberDtoArrayList;
public String updateDate;
public MessageInfoListJSON(String jsonString) throws AcmsException {
super(jsonString);
......@@ -54,14 +57,11 @@ public class MessageInfoListJSON extends AcmsCommonJSON {
} else {
chatMessageDto.message = messageInfoJSON.getString(ABookCommConstants.KEY.MESSAGE);
}
chatMessageDto.unreadCount = messageInfoJSON.getInt(ABookCommConstants.KEY.UNREAD_COUNT);
if (messageInfoJSON.has(ABookCommConstants.KEY.TIME)) {
chatMessageDto.insertDate = DateTimeUtil.millToDateString(messageInfoJSON.getJSONObject(ABookCommConstants.KEY.TIME).getLong(ABookCommConstants.KEY.TIME));
}
chatMessageDtoArrayList.add(chatMessageDto);
if (existShopMmeberMap.get(chatMessageDto.shopMemberId) != null) { continue; }
ShopMemberDto shopMemberDto = new ShopMemberDto();
shopMemberDto.shopMemberId = messageInfoJSON.getInt(ABookCommConstants.KEY.SHOP_MEMBER_ID);
......@@ -74,6 +74,10 @@ public class MessageInfoListJSON extends AcmsCommonJSON {
shopMemberDtoArrayList.add(shopMemberDto);
}
String time = JsonUtil.getString(json, PresentTime);
presentTime = DateTimeUtil.toDate(time, DateTimeFormat.yyyyMMddHHmmss_hyphen);
updateDate = DateTimeUtil.toString(presentTime, DateTimeFormat.yyyyMMddHHmmss_none);
}
}
......@@ -27,12 +27,12 @@ public class MyInfoJSON extends AcmsCommonJSON {
if (MyInfoJson == null) { return; }
shopMemberDto = new ShopMemberDto();
ArrayList<Integer> groupIdList = new ArrayList<Integer>();
JSONArray groupIdJsonArray = (JSONArray) MyInfoJson.get(ABookCommConstants.KEY.GROUP_ID_LIST);
//ArrayList<Integer> groupIdList = new ArrayList<Integer>();
/*JSONArray groupIdJsonArray = (JSONArray) MyInfoJson.get(ABookCommConstants.KEY.GROUP_ID_LIST);
for (int i = 0; i < groupIdJsonArray.length(); i++) {
groupIdList.add(groupIdJsonArray.getInt(i));
}
shopMemberDto.groupIdList = groupIdList;
}*/
//shopMemberDto.groupIdList = groupIdList;
shopMemberDto.selfFlg = ABookCommConstants.FLAG.SELF_FLAG.ON;
shopMemberDto.profileUrl = MyInfoJson.getString(ABookCommConstants.KEY.PROFILE_IMAGE_PATH);
shopMemberDto.shopMemberId = MyInfoJson.getInt(ABookCommConstants.KEY.SHOP_MEMBER_ID);
......
package jp.agentec.abook.abv.bl.acms.client.json;
import org.json.adf.JSONArray;
import org.json.adf.JSONObject;
import java.util.ArrayList;
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.JSONValidationException;
import jp.agentec.abook.abv.bl.dto.ChatMessageDto;
import jp.agentec.abook.abv.bl.dto.ChatRoomDto;
import jp.agentec.adf.util.DateTimeUtil;
public class RoomJSON extends AcmsCommonJSON {
public ChatRoomDto chatRoomDto;
public RoomJSON(String jsonString) throws AcmsException {
super(jsonString);
}
@Override
protected void parse(JSONObject json) throws JSONValidationException {
// ルーム一覧情報を取得
if (!json.has(ABookCommConstants.KEY.BODY)) { return; }
JSONObject roomInfo = json.getJSONObject(ABookCommConstants.KEY.BODY);
chatRoomDto = new ChatRoomDto();
chatRoomDto.chatRoomId = roomInfo.getInt(ABookCommConstants.KEY.ROOM_ID);
chatRoomDto.chatRoomName = roomInfo.getString(ABookCommConstants.KEY.ROOM_NAME);
chatRoomDto.type = roomInfo.getInt(ABookCommConstants.KEY.ROOM_TYPE);
chatRoomDto.userCount = roomInfo.getJSONArray(ABookCommConstants.KEY.ATTEND_USER_IDS).length();
JSONArray attendUsers = roomInfo.getJSONArray(ABookCommConstants.KEY.ATTEND_USER_IDS);
ArrayList<Integer> attendUserList = new ArrayList<Integer>();
for (int attendUserCount = 0; attendUserCount < attendUsers.length(); attendUserCount++) {
attendUserList.add((Integer) attendUsers.get(attendUserCount));
}
chatRoomDto.attendUsers = attendUserList;
}
}
......@@ -48,8 +48,13 @@ public class RoomListJSON extends AcmsCommonJSON {
JSONObject lastMessageInfoJSON = roomListJsonArray.getJSONObject(listCount).has(ABookCommConstants.KEY.LAST_MESSAGE_INFO) ? roomListJsonArray.getJSONObject(listCount).getJSONObject(ABookCommConstants.KEY.LAST_MESSAGE_INFO) : null;
if (lastMessageInfoJSON != null && lastMessageInfoJSON.has(ABookCommConstants.KEY.MESSAGE_ID)) {
chatMessageDto.chatRoomId = chatRoomDto.chatRoomId;
chatMessageDto.message = lastMessageInfoJSON.getString(ABookCommConstants.KEY.MESSAGE);
chatMessageDto.messageType = lastMessageInfoJSON.getInt(ABookCommConstants.KEY.MESSAGE_TYPE);
if (ABookCommConstants.FLAG.MESSAGE_TYPE.COLLABORATION_START.equals(chatMessageDto.messageType)
|| ABookCommConstants.FLAG.MESSAGE_TYPE.COLLABORATION_END.equals(chatMessageDto.messageType)) {
chatMessageDto.message = lastMessageInfoJSON.getJSONObject(ABookCommConstants.KEY.MESSAGE).toString();
} else {
chatMessageDto.message = lastMessageInfoJSON.getString(ABookCommConstants.KEY.MESSAGE);
}
if (lastMessageInfoJSON.has(ABookCommConstants.KEY.INSERT_DATE)) {
chatMessageDto.insertDate = DateTimeUtil.millToDateString(lastMessageInfoJSON.getJSONObject(ABookCommConstants.KEY.INSERT_DATE).getLong(ABookCommConstants.KEY.TIME));
}
......
package jp.agentec.abook.abv.bl.acms.client.json;
import org.json.adf.JSONArray;
import org.json.adf.JSONObject;
import java.util.ArrayList;
import java.util.HashMap;
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.JSONValidationException;
import jp.agentec.abook.abv.bl.common.util.JsonUtil;
import jp.agentec.abook.abv.bl.dto.ChatMessageDto;
import jp.agentec.abook.abv.bl.dto.ShopMemberDto;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
public class UnreadCountJSON extends AcmsCommonJSON {
public ArrayList<ChatMessageDto> chatMessageDtoArrayList;
public UnreadCountJSON(String jsonString) throws AcmsException {
super(jsonString);
}
@Override
protected void parse(JSONObject json) throws JSONValidationException {
// メッセージ情報を取得
if (!json.has(ABookCommConstants.KEY.BODY)) { return; }
HashMap<Integer, Integer> existShopMmeberMap = new HashMap<Integer, Integer>();
JSONArray unreadCountList = json.getJSONArray(ABookCommConstants.KEY.BODY);
if (unreadCountList == null) { return; }
chatMessageDtoArrayList = new ArrayList<ChatMessageDto>();
for (int listCount = 0; listCount < unreadCountList.length(); listCount++) {
ChatMessageDto chatMessageDto = new ChatMessageDto();
JSONObject messageInfoJSON = unreadCountList.getJSONObject(listCount);
if (messageInfoJSON == null) { continue; }
chatMessageDto.chatMessageId = messageInfoJSON.getInt(ABookCommConstants.KEY.MESSAGE_ID);
chatMessageDto.unreadCount = messageInfoJSON.getInt(ABookCommConstants.KEY.UNREAD_COUNT);
chatMessageDtoArrayList.add(chatMessageDto);
}
}
}
package jp.agentec.abook.abv.bl.acms.client.parameters;
import jp.agentec.adf.net.http.HttpParameterObject;
/**
* ACMSのAPIに渡す共通的なパラメータを格納します。ACMSのAPIのパラメータ用クラスを作成するときはこのクラスを継承してください。<br>
* ただし、このクラスはログイン状態の確認用として使われる {@link ChangeCollaborationParameters#sid} を持っているため、ログイン用のパラメータ {@link MobileLoginParameters} は、このクラスを継承する必要はありません。
* @author lee-mk
* @version 1.0.0
*/
public class ChangeCollaborationParameters extends HttpParameterObject {
/**
* セッションID
* @since 1.0.0
*/
private String sid;
private String cmd;
private Integer roomId;
private Integer collaborationType;
private Integer meetingId;
/**
* {@link ChangeCollaborationParameters} のインスタンスを初期化します。
* @param sid ログインした時のセッションIDです。
* @param cmd Apiリクエストに必要なコマンド(ABOOK COMM専用)。
* @param roomId roomId
* @param meetingId meetingId
* @since 1.0.0
*/
public ChangeCollaborationParameters(String sid, String cmd, Integer roomId, Integer collaborationType, Integer meetingId) {
this.sid = sid;
this.cmd = cmd;
this.roomId = roomId;
this.collaborationType = collaborationType;
this.meetingId = meetingId;
}
/**
* セッションIDを返します。
* @return ログインした時のセッションIDです。
* @since 1.0.0
*/
public String getSid() {
return sid;
}
/**
* コマンドを返します。
* @return ログインした時のセッションIDです。
* @since 1.0.0
*/
public String getCmd() {
return cmd;
}
/**
* roomIdを返します。
* @return roomId
* @since 1.0.0
*/
public Integer getRoomId() {
return roomId;
}
/**
* meetingIdを返します。
* @return meetingId
* @since 1.0.0
*/
public Integer getMeetingId() {
return meetingId;
}
/**
* collaborationTypeを返します。
* @return collaborationType
* @since 1.0.0
*/
public Integer getCollaborationType() {
return collaborationType;
}
}
package jp.agentec.abook.abv.bl.acms.client.parameters;
import jp.agentec.adf.net.http.HttpParameterObject;
/**
* ACMSのAPIに渡す共通的なパラメータを格納します。ACMSのAPIのパラメータ用クラスを作成するときはこのクラスを継承してください。<br>
* ただし、このクラスはログイン状態の確認用として使われる {@link FinishCollaborationParameters#sid} を持っているため、ログイン用のパラメータ {@link MobileLoginParameters} は、このクラスを継承する必要はありません。
* @author lee-mk
* @version 1.0.0
*/
public class FinishCollaborationParameters extends HttpParameterObject {
/**
* セッションID
* @since 1.0.0
*/
private String sid;
private String cmd;
private Integer roomId;
/**
* {@link FinishCollaborationParameters} のインスタンスを初期化します。
* @param sid ログインした時のセッションIDです。
* @param cmd Apiリクエストに必要なコマンド(ABOOK COMM専用)。
* @since 1.0.0
*/
public FinishCollaborationParameters(String sid, String cmd, Integer roomId) {
this.sid = sid;
this.cmd = cmd;
this.roomId = roomId;
}
/**
* セッションIDを返します。
* @return ログインした時のセッションIDです。
* @since 1.0.0
*/
public String getSid() {
return sid;
}
/**
* コマンドを返します。
* @return ログインした時のセッションIDです。
* @since 1.0.0
*/
public String getCmd() {
return cmd;
}
/**
* roomIdを返します。
* @return roomId
* @since 1.0.0
*/
public Integer getRoomId() {
return roomId;
}
}
......@@ -38,10 +38,9 @@ public class GetGroupInfoParameters extends HttpParameterObject {
this.cmd = cmd;
}
public GetGroupInfoParameters(String sid, String cmd, String groupId, String updatedDate) {
public GetGroupInfoParameters(String sid, String cmd, String updatedDate) {
this.sid = sid;
this.cmd = cmd;
this.groupIds = groupId;
this.updatedDate = updatedDate;
}
......
......@@ -17,6 +17,8 @@ public class GetMessagesParameters extends HttpParameterObject {
private String cmd;
private String roomId;
private String lineNum;
private String messageId;
private String updateDate;
/**
* {@link GetMessagesParameters} のインスタンスを初期化します。
......@@ -33,11 +35,13 @@ public class GetMessagesParameters extends HttpParameterObject {
* @param cmd Apiリクエストに必要なコマンド(ABOOK COMM専用)。
* @since 1.0.0
*/
public GetMessagesParameters(String sid, String cmd, String roomId, String lineNum) {
public GetMessagesParameters(String sid, String cmd, String roomId, String lineNum, String messageId, String updateDate) {
this.sid = sid;
this.cmd = cmd;
this.roomId = roomId;
this.lineNum = lineNum;
this.messageId = messageId;
this.updateDate = updateDate;
}
/**
......@@ -66,4 +70,11 @@ public class GetMessagesParameters extends HttpParameterObject {
return lineNum;
}
public String getMessageId() {
return messageId;
}
public String getUpdateDate() {
return updateDate;
}
}
......@@ -188,10 +188,12 @@ public class AcmsApis {
public static final String getRoomList = "5";
public static final String createRoom = "2";
public static final String changeRoomName = "6";
public static final String getRoom = "7";
}
public static final class MessageCmds {
public static final String getMessages = "2";
public static final String getUnreadCount = "4";
}
public static final class FavoriteCmds {
......@@ -209,10 +211,11 @@ public class AcmsApis {
}
public static final class CollaborationCmds {
public static final String start = "1";
public static final String change = "1";
public static final String join = "2";
public static final String finish = "3";
public static final String invite = "4";
public static final String finishAll = "5";
}
// download
......
......@@ -55,7 +55,7 @@ public interface ABookCommConstants {
String LAST_MESSAGE_INFO = "lastMessageInfo";
String FAVORITE_USER_IDS = "favoriteUserIds";
String FAVORITE_GROUP_IDS = "favoriteGroupIds";
String GROUP_INFO_LAST_UPDATE_DATE = "groupInfoLastUpdateDate";
String LAST_REQUEST_DATE = "lastRequestDate";
String ARCHIVE_INFO_LIST = "archiveInfoList";
String ARCHIVE_INFO = "archiveInfo";
......@@ -77,7 +77,13 @@ public interface ABookCommConstants {
String COLLABORATION_DEATAIL_ID = "collaborationDetailId";
String MY_SHOPE_MEMBER_ID = "myShopMemberId";
String ROOT_GROUP_ID = "rootGroupId";
String GROUP_MEMBER_UPDATED_DATE = "groupMemberUpdatedDate";
String MESSAGE_UPDATED_DATE = "MessageUpdatedDate";
String ARCHIVE_UPDATED_DATE = "ArchiveUpdatedDate";
String HTTP_STATUS = "httpStatus";
interface API_KIND {
String USER = "user";
......@@ -120,6 +126,8 @@ public interface ABookCommConstants {
Integer AUDIO = 0;
Integer CAMERA = 2;
Integer VIDEO = 3;
Integer DOCUMENT = 4;
Integer BOARD = 5;
}
interface COLLABORATION_JOIN_FLG {
......@@ -138,6 +146,7 @@ public interface ABookCommConstants {
interface SIZE {
Integer MAX_FAVORITE_COUNT = 100;
Integer MESSAGE_PAGING_SIZE = 100;
}
String FILE_SAVE_PATH = "/data/user/0/jp.co.agentec.abookplus.check/files/";
......
......@@ -161,7 +161,7 @@ public class ArchiveDao extends AbstractCommunicationDao {
}
public boolean updateArchiveDetailInfo(ArchiveDto dto) {
long count = update("update t_archive set archive_name=?, archive_type=?, archive_date=?, room_id=?, room_name=?, attend_user_ids=?, file_path=?, save_user_id=? where archive_id=?", dto.getUpdateDetailValues());
long count = update("update t_archive set room_name=? where archive_id=?", new String[]{"" + dto.roomName, "" + dto.archiveId});
return count > 0;
}
......
......@@ -283,6 +283,7 @@ public class ChatGroupDao extends AbstractCommunicationDao {
beginTransaction();
for (ChatGroupDto groupDto : groupList) {
update(sql.toString(), new Object[] { groupDto.groupId });
update("delete from r_shop_member_group where group_id = ? ", new Object[] { groupDto.groupId });
}
commit();
} catch (Exception e) {
......
......@@ -3,6 +3,7 @@ package jp.agentec.abook.abv.bl.data.dao;
import java.util.ArrayList;
import java.util.List;
import jp.agentec.abook.abv.bl.common.constant.ABookCommConstants;
import jp.agentec.abook.abv.bl.common.db.Cursor;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.dto.ChatMessageDto;
......@@ -107,10 +108,41 @@ public class ChatMessageDao extends AbstractCommunicationDao {
sql.append(" ON cm.shop_member_id = sm.shop_member_id ");
sql.append(" WHERE cm.chat_room_id = ? ");
sql.append(" ORDER BY cm.insert_date DESC ");
sql.append(" LIMIT " + ABookCommConstants.SIZE.MESSAGE_PAGING_SIZE);
List<ChatMessageDto> list = rawQueryGetDtoList(sql.toString(), new String[]{""+ chatRoomId}, ChatMessageDto.class);
return list;
}
public List<ChatMessageDto> getChatMessageFromMessageId(int chatRoomId, String MessageId) {
StringBuffer sql = new StringBuffer();
sql.append(" SELECT ");
sql.append(" cm.chat_message_id ");
sql.append(" ,cm.chat_room_id ");
sql.append(" ,cm.shop_member_id ");
sql.append(" ,cm.login_id ");
sql.append(" ,cm.message ");
sql.append(" ,cm.message_type ");
sql.append(" ,cm.image_name ");
sql.append(" ,cm.download_file_name ");
sql.append(" ,cm.save_path ");
sql.append(" ,cm.insert_date ");
sql.append(" ,sm.shop_member_name ");
sql.append(" ,sm.profile_url ");
sql.append(" ,sm.self_flg ");
sql.append(" ,cm.unread_count ");
sql.append(" FROM ");
sql.append(" t_chat_message AS cm ");
sql.append(" INNER JOIN ");
sql.append(" m_shop_member AS sm ");
sql.append(" ON cm.shop_member_id = sm.shop_member_id ");
sql.append(" WHERE cm.chat_room_id = ? ");
sql.append(" AND cm.chat_message_id < ? ");
sql.append(" ORDER BY cm.insert_date DESC ");
sql.append(" LIMIT " + ABookCommConstants.SIZE.MESSAGE_PAGING_SIZE);
List<ChatMessageDto> list = rawQueryGetDtoList(sql.toString(), new String[]{"" + chatRoomId, "" + MessageId}, ChatMessageDto.class);
return list;
}
public List<ChatMessageDto> searchChatMessage(int chatRoomId, String[] keywords, String userList) {
StringBuffer sql = new StringBuffer();
sql.append(" SELECT ");
......@@ -177,6 +209,15 @@ public class ChatMessageDao extends AbstractCommunicationDao {
return count > 0;
}
public void updatUnreadCount(List<ChatMessageDto> messageDtoList, String roomId) {
beginTransaction();
update("update t_chat_message set unread_count = 0 where chat_room_id=?", new String[]{"" + roomId});
for (ChatMessageDto messageDto : messageDtoList) {
update("update t_chat_message set unread_count = ? where chat_message_id=?", new String[]{"" + messageDto.unreadCount, "" + messageDto.chatMessageId});
}
commit();
}
public void deleteChatMessage() {
try {
beginTransaction();
......
......@@ -188,9 +188,15 @@ public class ChatRoomDao extends AbstractCommunicationDao {
}
public void insertChatRoomUsers(List<Integer> attendUsers, Integer chatRoomId) {
if (CollectionUtil.isEmpty(attendUsers)) {
return;
}
String sql = "insert or replace into r_chat_room_shop_member (chat_room_id, shop_member_id) values ";
ArrayList<String> insertAttendUser = new ArrayList<String>();
for (Integer attendUserId : attendUsers) {
insert("insert or replace into r_chat_room_shop_member (chat_room_id, shop_member_id) values (?,?)", new Integer[]{chatRoomId, attendUserId});
insertAttendUser.add("(" + chatRoomId + ", " + attendUserId + ")");
}
insert(sql + StringUtil.join(", ", insertAttendUser), new Object[] {});
}
public void deleteChatRoomUsers(Integer chatRoomId) {
......
......@@ -2,6 +2,7 @@ package jp.agentec.abook.abv.bl.data.dao;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import jp.agentec.abook.abv.bl.common.db.Cursor;
......@@ -69,10 +70,11 @@ public class ShopMemberDao extends AbstractCommunicationDao {
try {
beginTransaction();
insert("insert or replace into m_shop_member (shop_member_id, shop_member_name, login_id, profile_url, self_flg, favorite_register_date) values (?,?,?,?,?,(select favorite_register_date from m_shop_member where shop_member_id = ?))", dto.getInsertValues());
update(" delete from r_shop_member_group WHERE shop_member_id = ? ", new Integer[]{dto.shopMemberId});
for (Integer groupId : dto.groupIdList) {
insert("insert or replace into r_shop_member_group (shop_member_id, group_id) values ("+dto.shopMemberId+",?)", new Integer[]{groupId});
if (dto.groupIdList != null && dto.groupIdList.size() > 0) {
update(" delete from r_shop_member_group WHERE shop_member_id = ? ", new Integer[]{dto.shopMemberId});
for (Integer groupId : dto.groupIdList) {
insert("insert or replace into r_shop_member_group (shop_member_id, group_id) values ("+dto.shopMemberId+",?)", new Integer[]{groupId});
}
}
commit();
} catch (Exception e) {
......@@ -102,10 +104,29 @@ public class ShopMemberDao extends AbstractCommunicationDao {
}
}
public void insertShopMemberGroupRelation(Integer groupId, List<ShopMemberDto> dtoList) {
try {
update("delete from r_shop_member_group where group_id = ? ", new Object[] { groupId });
for (ShopMemberDto dto : dtoList) {
insert("insert or replace into r_shop_member_group (shop_member_id, group_id) values ("+dto.shopMemberId+",?)", new Integer[]{groupId});
}
} catch (Exception e) {
rollback();
Logger.e("insertShopMember failed.", e);
throw new RuntimeException(e);
} finally {
}
}
public ShopMemberDto getMyInfo() {
return rawQueryGetDto("select * from m_shop_member where self_flg = 1", null, ShopMemberDto.class);
}
public void resetSelfFlg() {
update("update m_shop_member set self_flg = 0", new String[]{});
}
public List<ShopMemberDto> getUserInRoom(Integer chatRoomId) {
StringBuffer sql = new StringBuffer();
sql.append(" SELECT sm.* ");
......@@ -400,6 +421,17 @@ public class ShopMemberDao extends AbstractCommunicationDao {
return count > 0;
}
public void updateFavoriteUserList(List<Integer> shopMemberIdList) {
beginTransaction();
for (Integer shopMemberId : shopMemberIdList ) {
ShopMemberDto favoriteUserDto= new ShopMemberDto();
favoriteUserDto.shopMemberId = shopMemberId;
favoriteUserDto.favoriteRegisterDate = DateTimeUtil.toString_yyyyMMddHHmmss_none(new Date(System.currentTimeMillis()));
update("update m_shop_member set favorite_register_date=? where shop_member_id=?", new Object[]{favoriteUserDto.favoriteRegisterDate, favoriteUserDto.shopMemberId});
}
commit();
}
public void deleteShopMember() {
try {
beginTransaction();
......
......@@ -9,6 +9,7 @@ import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import jp.agentec.abook.abv.bl.common.constant.ABookCommConstants;
......@@ -126,6 +127,35 @@ public class CommunicationLogic extends AbstractLogic {
Map<String, Object> chatMessageMap = new HashMap<String, Object>();
chatMessageMap.put(ABookCommConstants.KEY.CHAT_ROOM_ID, chatMessageDto.chatRoomId);
chatMessageMap.put(ABookCommConstants.KEY.LOGIN_ID, chatMessageDto.shopMemberName);
chatMessageMap.put(ABookCommConstants.KEY.MESSAGE_ID, chatMessageDto.chatMessageId);
chatMessageMap.put(ABookCommConstants.KEY.SHOP_MEMBER_ID, chatMessageDto.shopMemberId);
if (ABookCommConstants.FLAG.MESSAGE_TYPE.PHOTO.equals(chatMessageDto.messageType) || ABookCommConstants.FLAG.MESSAGE_TYPE.VIDEO.equals(chatMessageDto.messageType)) {
chatMessageMap.put(ABookCommConstants.KEY.MESSAGE, getFileUrlPath(chatMessageDto.message));
} else {
chatMessageMap.put(ABookCommConstants.KEY.MESSAGE, chatMessageDto.message);
}
chatMessageMap.put(ABookCommConstants.KEY.MESSAGE_TYPE, chatMessageDto.messageType);
chatMessageMap.put(ABookCommConstants.KEY.INSERT_DATE, chatMessageDto.insertDate);
chatMessageMap.put(ABookCommConstants.KEY.PROFILE_URL, getProfileUrlPath(chatMessageDto.profileUrl));
chatMessageMap.put(ABookCommConstants.KEY.SELF_FLG, chatMessageDto.selfFlg);
chatMessageMap.put(ABookCommConstants.KEY.UNREAD_COUNT, chatMessageDto.unreadCount);
JSONObject jsonObject = new JSONObject(chatMessageMap);
resultJsonArray.put(jsonObject);
}
String messageListStr = resultJsonArray.toString();
return messageListStr;
}
public String getMessagesFromMessageId(Integer roomId, String messageId) {
List<ChatMessageDto> chatMessageDtoList = chatMessageDao.getChatMessageFromMessageId(roomId, messageId);
JSONArray resultJsonArray = new JSONArray();
for (ChatMessageDto chatMessageDto : chatMessageDtoList) {
Map<String, Object> chatMessageMap = new HashMap<String, Object>();
chatMessageMap.put(ABookCommConstants.KEY.CHAT_ROOM_ID, chatMessageDto.chatRoomId);
chatMessageMap.put(ABookCommConstants.KEY.LOGIN_ID, chatMessageDto.shopMemberName);
chatMessageMap.put(ABookCommConstants.KEY.MESSAGE_ID, chatMessageDto.chatMessageId);
chatMessageMap.put(ABookCommConstants.KEY.SHOP_MEMBER_ID, chatMessageDto.shopMemberId);
if (ABookCommConstants.FLAG.MESSAGE_TYPE.PHOTO.equals(chatMessageDto.messageType) || ABookCommConstants.FLAG.MESSAGE_TYPE.VIDEO.equals(chatMessageDto.messageType)) {
chatMessageMap.put(ABookCommConstants.KEY.MESSAGE, getFileUrlPath(chatMessageDto.message));
......@@ -762,7 +792,6 @@ public class CommunicationLogic extends AbstractLogic {
List<ShopMemberDto> deleteList = new ArrayList<ShopMemberDto>();
for (ShopMemberDto shopMemberDto : shopMemberDtoList) {
//TODO ユーザ最新化処理必要
//if (ABookCommConstants.FLAG.DEL_FLAG.EXIST.equals(shopMemberDto.delFlg)) {
if (myInfo.shopMemberId.equals(shopMemberDto.shopMemberId)) {
shopMemberDto.selfFlg = 1;
......@@ -778,6 +807,28 @@ public class CommunicationLogic extends AbstractLogic {
//shopMemberDao.deleteShopMemberByList(deleteList);
}
public void insertShopMemberByMap(HashMap<Integer, List<ShopMemberDto>> shopMemberDtoListMap) {
ShopMemberDto myInfo = shopMemberDao.getMyInfo();
List<ShopMemberDto> insertList = new ArrayList<ShopMemberDto>();
shopMemberDao.beginTransaction();
Set<Integer> groupIds = shopMemberDtoListMap.keySet();
for (Integer groupId : groupIds) {
List<ShopMemberDto> shopMemberDtoList = shopMemberDtoListMap.get(groupId);
for (ShopMemberDto shopMemberDto : shopMemberDtoList) {
if (myInfo.shopMemberId.equals(shopMemberDto.shopMemberId)) {
shopMemberDto.selfFlg = 1;
} else {
shopMemberDto.selfFlg = 0;
}
insertList.add(shopMemberDto);
}
shopMemberDao.insertShopMemberGroupRelation(groupId, shopMemberDtoList);
}
shopMemberDao.commit();
shopMemberDao.insertShopMember(insertList);
}
public void updateArchives(List<ArchiveDto> archiveDtoList) {
List<ArchiveDto> insertList = new ArrayList<ArchiveDto>();
List<ArchiveDto> deleteList = new ArrayList<ArchiveDto>();
......@@ -805,31 +856,31 @@ public class CommunicationLogic extends AbstractLogic {
}
public void updateGroup(List<ChatGroupDto> GroupList) {
List<ChatGroupDto> existGroupList = chatGroupDao.getAllGroups();
Map<Integer, ChatGroupDto> existGroupMap = convertGroupListToMap(existGroupList);
ArrayList<ChatGroupDto> insertGroupList = new ArrayList<ChatGroupDto>();
ArrayList<ChatGroupDto> deleteGroupList = new ArrayList<ChatGroupDto>();
ArrayList<ChatGroupDto> updateGroupList = new ArrayList<ChatGroupDto>();
HashMap<Integer, List<ShopMemberDto>> groupMembersMap = new HashMap<Integer, List<ShopMemberDto>>();
for (ChatGroupDto chatGroupDto : GroupList) {
if (chatGroupDto.delFlg == 1) {
deleteGroupList.add(chatGroupDto);
continue;
}
if (chatGroupDao.getGroup(chatGroupDto.groupId) == null) {
if (existGroupMap.get(chatGroupDto.groupId) == null) {
insertGroupList.add(chatGroupDto);
} else {
updateGroupList.add(chatGroupDto);
}
if (chatGroupDto.groupMembers == null) {
continue;
}
insertShopMember(chatGroupDto.groupMembers);
groupMembersMap.put(chatGroupDto.groupId, chatGroupDto.groupMembers);
}
chatGroupDao.insertGroupList(insertGroupList);
chatGroupDao.updateGroupList(updateGroupList);
chatGroupDao.deleteGroupList(deleteGroupList);
insertShopMemberByMap(groupMembersMap);
}
public ShopMemberDto getMyShopMemberDto() {
......@@ -843,16 +894,12 @@ public class CommunicationLogic extends AbstractLogic {
public void insertMyInfo(ShopMemberDto shopMemberDto) {
shopMemberDto.selfFlg = 1;
shopMemberDao.resetSelfFlg();
shopMemberDao.insertShopMember(shopMemberDto);
}
public void updateFavoriteUser(List<Integer> favoriteUserIds){
for (Integer favoriteUserId : favoriteUserIds) {
ShopMemberDto favoriteUserDto= new ShopMemberDto();
favoriteUserDto.shopMemberId = favoriteUserId;
favoriteUserDto.favoriteRegisterDate = DateTimeUtil.toString_yyyyMMddHHmmss_none(new Date(System.currentTimeMillis()));
shopMemberDao.updateFavoriteUser(favoriteUserDto);
}
shopMemberDao.updateFavoriteUserList(favoriteUserIds);
}
public void updateFavoriteGroup(List<Integer> favoriteGroupIds){
......@@ -1064,4 +1111,16 @@ public class CommunicationLogic extends AbstractLogic {
}
return resultJsonArray.toString();
}
public Map<Integer, ChatGroupDto> convertGroupListToMap(List<ChatGroupDto> groupList) {
Map<Integer, ChatGroupDto> map = new HashMap<Integer, ChatGroupDto>();
for (ChatGroupDto group : groupList) {
map.put(group.groupId, group);
}
return map;
}
public void updateUnreadCount(List<ChatMessageDto> messageList, String roomId) {
chatMessageDao.updatUnreadCount(messageList, roomId);
}
}
......@@ -138,6 +138,7 @@ public class MeetingManager extends Observable {
private int status = STATUS_READY; // ws通信ステータス
private boolean isOwner; // オーナーか否か
private boolean paused; // 一時停止状態
private boolean isCollaboration = false;
private ArrayList<MeetingDto> meetingList;
private BlockingQueue<Object> messageQueue;
......@@ -337,7 +338,7 @@ public class MeetingManager extends Observable {
joinedMeetingId = NO_MEETING_ID;
status = STATUS_READY;
paused = false;
isCollaboration = false;
if (messageHandlingThread != null) {
messageHandlingThread.terminate();
messageHandlingThread = null;
......@@ -794,6 +795,14 @@ public class MeetingManager extends Observable {
}
}
public void setCollaboration(boolean isCollaboration) {
this.isCollaboration = isCollaboration;
}
public boolean isCollaboration() {
return isCollaboration;
}
public String getJoinedMeetingPassword() {
return joinedMeetingPassword;
}
......
......@@ -251,7 +251,8 @@
android:theme="@style/Theme.AppCompat.Light.NoActionBar.FullScreen" >
</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:resizeableActivity="true"
android:supportsPictureInPicture="true"/>
......
......@@ -494,7 +494,8 @@
<string name="ReportReply">報告(回答)</string>
<string name="content_link_update">資料名「%1$s」は更新状態となります。\n更新しますか?</string>
<string name="msg_non_target_meeting_content">遠隔支援中には対象外の資料なので、開けません。</string>
<string name="msg_non_target_collaboration_content">協業中は閲覧できない資料です。</string>
<string name="msg_non_target_document_collaboration_content">文書協業では利用できない機能です。</string>
<string name="msg_help_operation_list_list_view">リスト表示に変更できます。</string>
<string name="msg_help_operation_list_panel_view">パネル表示に変更できます。</string>
<string name="msg_help_operation_list_filter">表示する作業の種類を選択できます。</string>
......@@ -1478,9 +1479,18 @@
<string name="msg_error_chat_room_name_too_long">ルーム名は文字列20字以内に入力してください。</string>
<string name="msg_error_chat_name_has_invalid_character">特殊文字 ;/?:@&amp;=+$,-_.!~*\'()#\\\"` はルーム名に含めることができません。</string>
<string name="msg_error_chat_room_sc_forbidden">認証に失敗しました。再度ログインが必要です。</string>
<string name="msg_error_already_exist_same_room">同じルームが既に存在します。</string>
<string name="msg_confirm_send_host_change">ホスト権限を渡しますか?</string>
<string name="msg_error_already_exist_same_room">同じルームが既に存在します。\n入室しますか</string>
<string name="msg_confirm_send_host_change">ホスト権限変更の依頼があります。変更しますか?</string>
<string name="host_confirm">ホスト変更リクエストがあります。</string>
<string name="msg_confirm_share_image">キャプチャーした写真を共有しますか?</string>
<string name="msg_invite_collaboration">協業に招待されました。</string>
<string name="msg_wait_for_host">ホストが文書を選択中です</string>
<string name="msg_rejected_by_host">ホストの変更依頼は拒否されました。</string>
<string name="msg_invalid_parameters">通信に失敗しました。チャットルームに戻ります。</string>
<string name="msg_destroy_exist_collaboration">進行中の協業が存在します。既存協業を終了し、新しい協業を開始してもよろしいですか</string>
<string name="not_found_camera">利用可能なカメラを見つかりませんでした。</string>
<string name="error_fail_record">レコーディングに失敗しました。管理者にお問い合わせしてください。</string>
<!-- 連続作業 -->
<string name="msg_error_all_process_delete">全削除の送信に失敗しました。</string>
<string name="msg_ozd_file_could_not_opened">帳票ファイルを開くことができませんでした。</string>
......
......@@ -497,7 +497,8 @@
<string name="ReportReply">보고(응답)</string>
<string name="content_link_update">자료명[%1$s]는 업데이트 가능한 상태입니다.\n업데이트 하시겠습니까?</string>
<string name="msg_non_target_meeting_content">원격 지원 접속 중에는 열람할 수 없는 자료입니다.</string>
<string name="msg_non_target_collaboration_content">협업중에는 열람할 수 없는 자료입니다.</string>
<string name="msg_non_target_document_collaboration_content">문서협업중에는 이용하실수 없는 기능입니다.</string>
<string name="msg_help_operation_list_list_view">리스트 표시로 변경 가능합니다.</string>
<string name="msg_help_operation_list_panel_view">패널 표시로 변경 가능합니다.</string>
<string name="msg_help_operation_list_filter">표시할 작업의 종류를 선택 가능합니다.</string>
......@@ -1485,8 +1486,16 @@
<string name="msg_error_chat_name_has_invalid_character">특수문자 ;/?:@&amp;=+$,-_.!~*\'()#\\\"` 는 방 제목에 포함될 수 없습니다.</string>
<string name="msg_error_chat_room_sc_forbidden">사용자 정보를 확인할 수 없습니다. 다시 로그인하시기 바랍니다.</string>
<string name="msg_error_all_process_delete">모두 삭제 송신에 실패하였습니다.</string>
<string name="msg_error_already_exist_same_room">동일한 채팅방이 이미 존재합니다.</string>
<string name="msg_error_already_exist_same_room">동일한 채팅방이 이미 존재합니다.\n 입장하시겠습니까?</string>
<string name="msg_ozd_file_could_not_opened">장표 파일을 열 수 없습니다.</string>
<string name="msg_confirm_send_host_change">방장 권한을 전달 받으시겠습니까?</string>
<string name="host_confirm">호스트변경을 요청하셨습니다</string>
<string name="msg_confirm_share_image">캡쳐한 사진을 공유 하시겠습니까?</string>
<string name="msg_invite_collaboration">협업에 초대되셨습니다.</string>
<string name="msg_wait_for_host">호스트가 문서를 선택중입니다.</string>
<string name="msg_rejected_by_host">호스트가 요청을 거절하셨습니다.</string>
<string name="msg_invalid_parameters">통신에 실패했습니다. 채팅룸으로 돌아갑니다.</string>
<string name="not_found_camera">사용 가능한 카메라 기기를 찾을수 없습니다.</string>
<string name="msg_destroy_exist_collaboration">진행중인 협업이 존재합니다. 기존 협업을 종료하고 새로운 협업을 시작 하시겠습니까?</string>
<string name="error_fail_record">레코드에 실패했습니다. 관리자에게 문의해주세요.</string>
</resources>
\ No newline at end of file
......@@ -501,7 +501,8 @@
<string name="ReportReply">ReportReply</string>
<string name="content_link_update">The document name [%1$s] will be updated. \nDo you want to update it?</string>
<string name="msg_non_target_meeting_content">It is the document that can not be read during distance support connection.</string>
<string name="msg_non_target_collaboration_content">It is the document that can not be read during collaboration.</string>
<string name="msg_non_target_document_collaboration_content">This is a function that cannot be used in document collaboration.</string>
<string name="msg_help_operation_list_list_view">You can change to list display.</string>
<string name="msg_help_operation_list_panel_view">You can change to panel display.</string>
<string name="msg_help_operation_list_filter">You can select the type of work to be displayed.</string>
......@@ -1482,8 +1483,16 @@
<string name="msg_error_chat_name_has_invalid_character">The character ;/?:@&amp;=+$,-_.!~*\'()#\\\"` cannot be included in the roomname.</string>
<string name="msg_error_chat_room_sc_forbidden">Failed to authenticate. Please login again.</string>
<string name="msg_error_all_process_delete">Failed to send all deletes.</string>
<string name="msg_error_already_exist_same_room">Already exist same room.</string>
<string name="msg_error_already_exist_same_room">Already exist same room.\n do you want enter exist room?</string>
<string name="msg_ozd_file_could_not_opened">Report file could not opened.</string>
<string name="msg_confirm_send_host_change">Do you want to receive host permissions?</string>
<string name="host_confirm">request host permission</string>
<string name="msg_confirm_share_image">Do you want to share captured image?</string>
<string name="msg_invite_collaboration">You are invited to collaboration.</string>
<string name="msg_wait_for_host">Please wait for selecting document by host</string>
<string name="msg_rejected_by_host">Rejected host request.</string>
<string name="msg_invalid_parameters">Communication failed. Return to the chat room.</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="error_fail_record">Recording failed. Please contact the administrator.</string>
</resources>
......@@ -3,7 +3,7 @@
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*,!code/removal/advanced,!method/inlining/short,!method/inlining/unique,!method/removal/*,!method/marking/*
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
......
......@@ -16,6 +16,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/related_content_third_linear"
android:orientation="vertical" >
<FrameLayout
......
......@@ -17,6 +17,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/related_content_third_linear"
android:orientation="vertical">
<FrameLayout
......
......@@ -69,6 +69,7 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
Integer insertId = 0;
Integer messageType = 0;
Integer messageId = 0;
String roomType = "";
Log.d(TAG,"tempMsg : "+ tempMsg);
......@@ -97,6 +98,7 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
}
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);
......@@ -107,6 +109,7 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
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;
}
......
......@@ -864,7 +864,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
ll_menuItem_chat.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
ActivityHandlingHelper.getInstance().startChatWebviewActivity();
ActivityHandlingHelper.getInstance().startChatWebViewActivity();
mCommunicationMenuDialog.dismiss();
}
});
......@@ -939,7 +939,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
if(dto.roomName != null && dto.roomId != 0)
{
pushMessageLogic.updateReadingFlg(dto.pushMessageId);
ActivityHandlingHelper.getInstance().startChatWebviewActivityWithPushMessage(dto);
ActivityHandlingHelper.getInstance().startChatWebViewActivityWithPushMessage(dto);
mPushMessageListDialog.dismiss();
} else {
showPushMessageDetailView(dto);
......
......@@ -71,6 +71,7 @@ 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.PatternStringUtil;
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.ABookPermissionHelper;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
......@@ -147,6 +148,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
protected String mEnablePhotoEdit; //最初ファイルをアップロードする時、Webからもらう編集可能可否のパラメタ 0:編集する。 1:編集しない。
protected PhotoEditActivity mPhotoEditDialog;
protected boolean isCollaboration = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
......@@ -196,7 +198,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
// 遠隔連動
meetingManager = MeetingManager.getInstance();
isCollaboration = meetingManager.isCollaboration();
mContentDir = getIntent().getStringExtra(FILEPATH);
// Activity登録
......@@ -462,7 +465,12 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
params.addRule(RelativeLayout.CENTER_VERTICAL);
params.rightMargin = (int) (getResources().getDisplayMetrics().density * 5);
subMenuBtn.setLayoutParams(params);
exitMeetingBtn.setVisibility(View.VISIBLE);
if (isCollaboration) {
exitMeetingBtn.setVisibility(View.GONE);
} else {
exitMeetingBtn.setVisibility(View.VISIBLE);
}
// if (helpButton != null && helpButton.getVisibility() == View.VISIBLE) {
// helpButton.setLayoutParams(params);
......@@ -560,7 +568,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
return;
}
textView.setVisibility(View.GONE);
if (isVisible) {
if (isVisible && !isCollaboration) {
if (meetingManager.isConnected() && meetingManager.isOwner()) {
textView.setVisibility(View.VISIBLE);
CommonExecutor.execute(new Runnable() {
......
......@@ -113,53 +113,60 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity {
alertDialog.show();
} else {
final ABookAlertDialog alertDialog = AlertDialogUtil.createAlertDialog(ShowPushMessageDailogActivity.this, getRString(R.string.app_name), getIntent().getExtras().getString(PushMessageKey.message));
alertDialog.setPositiveButton(R.string.move, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// Check PushMessage
Bundle extras = getIntent().getExtras();
if (extras != null) {
Long roomId = extras.getLong(AppDefType.ChatPushMessageKey.roomId, 0);
String roomName = extras.getString(AppDefType.ChatPushMessageKey.roomName);
String pushSendLoginId = extras.getString(AppDefType.ChatPushMessageKey.pushSendLoginId);
long pushSendDate = extras.getLong(AppDefType.ChatPushMessageKey.pushSendDate);
String collaborationType = extras.getString(AppDefType.ChatPushMessageKey.collaborationType);
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 {
ActivityHandlingHelper.getInstance().startChatWebviewActivityWithCollaboration(roomId, roomName, collaborationType);
Bundle extras = getIntent().getExtras();
Long roomId = extras.getLong(AppDefType.ChatPushMessageKey.roomId, 0);
if (roomId == 0) {
alertDialog.setPositiveButton(R.string.ok, null);
} else {
alertDialog.setPositiveButton(R.string.move, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// Check PushMessage
Bundle extras = getIntent().getExtras();
if (extras != null) {
Long roomId = extras.getLong(AppDefType.ChatPushMessageKey.roomId, 0);
String roomName = extras.getString(AppDefType.ChatPushMessageKey.roomName);
String pushSendLoginId = extras.getString(AppDefType.ChatPushMessageKey.pushSendLoginId);
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 {
ActivityHandlingHelper.getInstance().startChatWebViewActivityWithCollaboration(roomId, roomName, collaborationType, roomType);
}
}
}
finish();
}
finish();
}
});
alertDialog.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
});
alertDialog.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
finish();
}
});
@Override
public void onClick(DialogInterface dialog, int which) {
finish();
}
});
}
alertDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
finish();
}
});
alertDialog.show();
......
......@@ -144,5 +144,6 @@ public interface AppDefType {
String pushSendLoginId = "pushSendLoginId";
String pushSendDate = "pushSendDate";
String collaborationType = "collaborationType";
String roomType = "roomType";
}
}
package jp.agentec.abook.abv.ui.home.activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import java.util.ArrayList;
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.type.AcmsApis;
......@@ -28,6 +36,7 @@ import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.OperationLogic;
import jp.agentec.abook.abv.bl.websocket.MeetingManager;
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.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.common.constant.ErrorCode;
......@@ -57,15 +66,19 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
private TextView mTxtOperationRelatedContent;
private Button mAllSaveButton;
private boolean isCollaboration;
private boolean isCollaborationOwner;
private ListView mContentListView;
private List<CategoryContentDto> mOperationContentList;
private LinearLayout mToolbar;
private MeetingManager meetingManager = MeetingManager.getInstance();
private OperationLogic mOperationLogic = AbstractLogic.getLogic(OperationLogic.class);
TextView mWaitOwnerTextView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
updateCollaborationInfo();
setContentView(R.layout.ac_operation_related_content);
// ホームボタン(作業一覧へ遷移ボタン)
......@@ -78,7 +91,7 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
mAllSaveButton = (Button) findViewById(R.id.btn_all_save);
mContentListView = (ListView) findViewById(R.id.lv_content_list);
showContentList();
mTxtOperationRelatedContent = (TextView) findViewById(R.id.txt_operation_related_content);
mQuickReportPrintButton = (ImageButton) findViewById(R.id.btn_operation_print);
......@@ -86,12 +99,11 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
mTxtOperationRelatedContent.setText("" + PatternStringUtil.patternToString(getApplicationContext(),
R.string.title_common_content,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
mToolbar = (LinearLayout)findViewById(R.id.toolbar2);
mAllSaveButton.setVisibility(View.GONE);
settingBottomToolbar();
setOnButtonEvent();
settingBottomToolbar();
refreshCollaborationUI();
}
// 下辺のツールバー設定
......@@ -117,6 +129,22 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
}
}
private void hideBottomToolbar() {
mToolbar.setVisibility(View.GONE);
}
private void showBottomToolbar() {
mToolbar.setVisibility(View.VISIBLE);
}
private void hideContentList() {
mContentListView.setVisibility(View.GONE);
}
private void showContentList() {
mContentListView.setVisibility(View.VISIBLE);
}
@Override
public void onDownloadingContentZip(final ContentZipDownloadNotification notification) {
super.onDownloadingContentZip(notification);
......@@ -283,7 +311,7 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
public void run() {
final ABookAlertDialog nonTargetMeetingContentDialog = AlertDialogUtil.createAlertDialog(OperationRelatedContentActivity.this, R.string.app_name);
nonTargetMeetingContentDialog.setCancelable(false);
nonTargetMeetingContentDialog.setMessage(R.string.msg_non_target_meeting_content);
nonTargetMeetingContentDialog.setMessage(isCollaboration? R.string.msg_non_target_collaboration_content : R.string.msg_non_target_meeting_content);
nonTargetMeetingContentDialog.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int whichButton) {
......@@ -445,8 +473,11 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
// 端末の戻るボタン処理
Logger.d(TAG, "onKeyUp.Back");
// 端末の戻るボタン処理
if (isCollaboration) {
return true;
}
backToHome();
return true;
}
......@@ -477,21 +508,91 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
}
}
}
mAllSaveButton.setVisibility(visible);
if (isCollaboration) {
mAllSaveButton.setVisibility(isCollaborationOwner ? visible : View.GONE);
} else {
mAllSaveButton.setVisibility(visible);
}
}
});
}
public void refreshCollaborationUI() {
if (isCollaboration) {
activityHandlingHelper.removeContentViewActivity(activityHandlingHelper.getContentViewActivity());
hideBottomToolbar();
if (isCollaborationOwner) {
hideWaitOwnerSelect();
showContentList();
mAllSaveButton.setVisibility(View.VISIBLE);
} else {
showWaitOwnerSelect();
hideContentList();
mAllSaveButton.setVisibility(View.GONE);
}
} else {
hideWaitOwnerSelect();
showBottomToolbar();
showContentList();
mAllSaveButton.setVisibility(View.VISIBLE);
}
}
@Override
public void onResume() {
Logger.i(TAG, "onResume:start");
updateCollaborationInfo();
refreshCollaborationUI();
super.onResume();
showOperationRelatedContentList();
}
@Override
protected void onNewIntent(Intent intent) {
updateCollaborationInfo();
refreshCollaborationUI();
super.onNewIntent(intent);
}
// 設定画面へ遷移
public void onClickSetting(View v) {
showSetting();
}
public void showWaitOwnerSelect() {
if (mWaitOwnerTextView != null) {
mWaitOwnerTextView.setVisibility(View.VISIBLE);
return;
}
Display display = getWindowManager().getDefaultDisplay();
DisplayMetrics outMetrics = new DisplayMetrics ();
display.getMetrics(outMetrics);
LinearLayout container = (LinearLayout) findViewById(R.id.related_content_third_linear);
mWaitOwnerTextView = new TextView(this);
mWaitOwnerTextView.setText(getString(R.string.msg_wait_for_host));
mWaitOwnerTextView.setGravity(Gravity.CENTER);
mWaitOwnerTextView.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
LinearLayout mainLayout = (LinearLayout) findViewById(R.id.related_content_main_linear);
mWaitOwnerTextView.setHeight((int) (outMetrics.heightPixels / 2));
mWaitOwnerTextView.setTextSize(20);
mWaitOwnerTextView.setTextColor(Color.BLACK);
container.addView(mWaitOwnerTextView);
mWaitOwnerTextView.setVisibility(View.VISIBLE);
}
public void hideWaitOwnerSelect() {
if (mWaitOwnerTextView != null) {
mWaitOwnerTextView.setVisibility(View.GONE);
}
}
public void updateCollaborationInfo() {
isCollaboration = meetingManager.isCollaboration();
isCollaborationOwner = meetingManager.isCollaboration() && meetingManager.isOwner();
}
@Override
public void showAlertDialog(AlertDialog alertDialog) {
super.showAlertDialog(alertDialog);
}
}
package jp.agentec.abook.abv.ui.home.helper;
/*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import android.opengl.EGL14;
import android.opengl.EGLExt;
import android.opengl.EGLConfig;
import android.opengl.EGLContext;
import android.opengl.EGLDisplay;
import android.opengl.EGLSurface;
import android.util.Log;
import android.view.Surface;
/**
* Holds state associated with a Surface used for MediaCodec encoder input.
* <p>
* The constructor takes a Surface obtained from MediaCodec.createInputSurface(), and uses that
* to create an EGL window surface. Calls to eglSwapBuffers() cause a frame of data to be sent
* to the video encoder.
*/
class InputSurface {
private static final String TAG = "InputSurface";
private static final boolean VERBOSE = true;
private static final int EGL_RECORDABLE_ANDROID = 0x3142;
private static final int EGL_OPENGL_ES2_BIT = 4;
private EGLDisplay mEGLDisplay;
private EGLContext mEGLContext;
private EGLSurface mEGLSurface;
private Surface mSurface;
/**
* Creates an InputSurface from a Surface.
*/
public InputSurface(Surface surface) {
if (surface == null) {
throw new NullPointerException();
}
mSurface = surface;
eglSetup();
}
/**
* Prepares EGL. We want a GLES 2.0 context and a surface that supports recording.
*/
private void eglSetup() {
mEGLDisplay = EGL14.eglGetDisplay(EGL14.EGL_DEFAULT_DISPLAY);
if (mEGLDisplay == EGL14.EGL_NO_DISPLAY) {
throw new RuntimeException("unable to get EGL14 display");
}
int[] version = new int[2];
if (!EGL14.eglInitialize(mEGLDisplay, version, 0, version, 1)) {
mEGLDisplay = null;
throw new RuntimeException("unable to initialize EGL14");
}
// Configure EGL for pbuffer and OpenGL ES 2.0. We want enough RGB bits
// to be able to tell if the frame is reasonable.
int[] attribList = {
EGL14.EGL_RED_SIZE, 8,
EGL14.EGL_GREEN_SIZE, 8,
EGL14.EGL_BLUE_SIZE, 8,
EGL14.EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
EGL_RECORDABLE_ANDROID, 1,
EGL14.EGL_NONE
};
EGLConfig[] configs = new EGLConfig[1];
int[] numConfigs = new int[1];
if (!EGL14.eglChooseConfig(mEGLDisplay, attribList, 0, configs, 0, configs.length,
numConfigs, 0)) {
throw new RuntimeException("unable to find RGB888+recordable ES2 EGL config");
}
// Configure context for OpenGL ES 2.0.
int[] attrib_list = {
EGL14.EGL_CONTEXT_CLIENT_VERSION, 2,
EGL14.EGL_NONE
};
mEGLContext = EGL14.eglCreateContext(mEGLDisplay, configs[0], EGL14.EGL_NO_CONTEXT,
attrib_list, 0);
checkEglError("eglCreateContext");
if (mEGLContext == null) {
throw new RuntimeException("null context");
}
// Create a window surface, and attach it to the Surface we received.
int[] surfaceAttribs = {
EGL14.EGL_NONE
};
mEGLSurface = EGL14.eglCreateWindowSurface(mEGLDisplay, configs[0], mSurface,
surfaceAttribs, 0);
checkEglError("eglCreateWindowSurface");
if (mEGLSurface == null) {
throw new RuntimeException("surface was null");
}
}
/**
* Discard all resources held by this class, notably the EGL context. Also releases the
* Surface that was passed to our constructor.
*/
public void release() {
if (EGL14.eglGetCurrentContext().equals(mEGLContext)) {
// Clear the current context and surface to ensure they are discarded immediately.
EGL14.eglMakeCurrent(mEGLDisplay, EGL14.EGL_NO_SURFACE, EGL14.EGL_NO_SURFACE,
EGL14.EGL_NO_CONTEXT);
}
EGL14.eglDestroySurface(mEGLDisplay, mEGLSurface);
EGL14.eglDestroyContext(mEGLDisplay, mEGLContext);
//EGL14.eglTerminate(mEGLDisplay);
mSurface.release();
// null everything out so future attempts to use this object will cause an NPE
mEGLDisplay = null;
mEGLContext = null;
mEGLSurface = null;
mSurface = null;
}
/**
* Makes our EGL context and surface current.
*/
public void makeCurrent() {
if (!EGL14.eglMakeCurrent(mEGLDisplay, mEGLSurface, mEGLSurface, mEGLContext)) {
throw new RuntimeException("eglMakeCurrent failed");
}
}
/**
* Calls eglSwapBuffers. Use this to "publish" the current frame.
*/
public boolean swapBuffers() {
return EGL14.eglSwapBuffers(mEGLDisplay, mEGLSurface);
}
/**
* Returns the Surface that the MediaCodec receives buffers from.
*/
public Surface getSurface() {
return mSurface;
}
/**
* Sends the presentation time stamp to EGL. Time is expressed in nanoseconds.
*/
public void setPresentationTime(long nsecs) {
EGLExt.eglPresentationTimeANDROID(mEGLDisplay, mEGLSurface, nsecs);
}
/**
* Checks for EGL errors.
*/
private void checkEglError(String msg) {
boolean failed = false;
int error;
while ((error = EGL14.eglGetError()) != EGL14.EGL_SUCCESS) {
Log.e(TAG, msg + ": EGL error: 0x" + Integer.toHexString(error));
failed = true;
}
if (failed) {
throw new RuntimeException("EGL error encountered (see log)");
}
}
}
package jp.agentec.abook.abv.ui.home.helper;
/*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;
import android.graphics.SurfaceTexture;
import android.opengl.GLES11Ext;
import android.opengl.GLES20;
import android.opengl.GLSurfaceView;
import android.opengl.Matrix;
import android.util.Log;
/**
* Code for rendering a texture onto a surface using OpenGL ES 2.0.
*/
class TextureRender {
private static final String TAG = "TextureRender";
private static final int FLOAT_SIZE_BYTES = 4;
private static final int TRIANGLE_VERTICES_DATA_STRIDE_BYTES = 5 * FLOAT_SIZE_BYTES;
private static final int TRIANGLE_VERTICES_DATA_POS_OFFSET = 0;
private static final int TRIANGLE_VERTICES_DATA_UV_OFFSET = 3;
private final float[] mTriangleVerticesData = {
// X, Y, Z, U, V
-1.0f, -1.0f, 0, 0.f, 0.f,
1.0f, -1.0f, 0, 1.f, 0.f,
-1.0f, 1.0f, 0, 0.f, 1.f,
1.0f, 1.0f, 0, 1.f, 1.f,
};
private FloatBuffer mTriangleVertices;
private static final String VERTEX_SHADER =
"uniform mat4 uMVPMatrix;\n" +
"uniform mat4 uSTMatrix;\n" +
"attribute vec4 aPosition;\n" +
"attribute vec4 aTextureCoord;\n" +
"varying vec2 vTextureCoord;\n" +
"void main() {\n" +
" gl_Position = uMVPMatrix * aPosition;\n" +
" vTextureCoord = (uSTMatrix * aTextureCoord).xy;\n" +
"}\n";
private static final String FRAGMENT_SHADER =
"#extension GL_OES_EGL_image_external : require\n" +
"precision mediump float;\n" + // highp here doesn't seem to matter
"varying vec2 vTextureCoord;\n" +
"uniform samplerExternalOES sTexture;\n" +
"void main() {\n" +
" gl_FragColor = texture2D(sTexture, vTextureCoord);\n" +
"}\n";
private float[] mMVPMatrix = new float[16];
private float[] mSTMatrix = new float[16];
private int mProgram;
private int mTextureID = -12345;
private int muMVPMatrixHandle;
private int muSTMatrixHandle;
private int maPositionHandle;
private int maTextureHandle;
public TextureRender() {
mTriangleVertices = ByteBuffer.allocateDirect(
mTriangleVerticesData.length * FLOAT_SIZE_BYTES)
.order(ByteOrder.nativeOrder()).asFloatBuffer();
mTriangleVertices.put(mTriangleVerticesData).position(0);
Matrix.setIdentityM(mSTMatrix, 0);
}
public int getTextureId() {
return mTextureID;
}
public void drawFrame(SurfaceTexture st) {
checkGlError("onDrawFrame start");
st.getTransformMatrix(mSTMatrix);
GLES20.glClearColor(0.0f, 1.0f, 0.0f, 1.0f);
GLES20.glClear(GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT);
GLES20.glUseProgram(mProgram);
checkGlError("glUseProgram");
GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, mTextureID);
mTriangleVertices.position(TRIANGLE_VERTICES_DATA_POS_OFFSET);
GLES20.glVertexAttribPointer(maPositionHandle, 3, GLES20.GL_FLOAT, false,
TRIANGLE_VERTICES_DATA_STRIDE_BYTES, mTriangleVertices);
checkGlError("glVertexAttribPointer maPosition");
GLES20.glEnableVertexAttribArray(maPositionHandle);
checkGlError("glEnableVertexAttribArray maPositionHandle");
mTriangleVertices.position(TRIANGLE_VERTICES_DATA_UV_OFFSET);
GLES20.glVertexAttribPointer(maTextureHandle, 2, GLES20.GL_FLOAT, false,
TRIANGLE_VERTICES_DATA_STRIDE_BYTES, mTriangleVertices);
checkGlError("glVertexAttribPointer maTextureHandle");
GLES20.glEnableVertexAttribArray(maTextureHandle);
checkGlError("glEnableVertexAttribArray maTextureHandle");
Matrix.setIdentityM(mMVPMatrix, 0);
GLES20.glUniformMatrix4fv(muMVPMatrixHandle, 1, false, mMVPMatrix, 0);
GLES20.glUniformMatrix4fv(muSTMatrixHandle, 1, false, mSTMatrix, 0);
GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);
checkGlError("glDrawArrays");
GLES20.glFinish();
}
/**
* Initializes GL state. Call this after the EGL surface has been created and made current.
*/
public void surfaceCreated() {
mProgram = createProgram(VERTEX_SHADER, FRAGMENT_SHADER);
if (mProgram == 0) {
throw new RuntimeException("failed creating program");
}
maPositionHandle = GLES20.glGetAttribLocation(mProgram, "aPosition");
checkGlError("glGetAttribLocation aPosition");
if (maPositionHandle == -1) {
throw new RuntimeException("Could not get attrib location for aPosition");
}
maTextureHandle = GLES20.glGetAttribLocation(mProgram, "aTextureCoord");
checkGlError("glGetAttribLocation aTextureCoord");
if (maTextureHandle == -1) {
throw new RuntimeException("Could not get attrib location for aTextureCoord");
}
muMVPMatrixHandle = GLES20.glGetUniformLocation(mProgram, "uMVPMatrix");
checkGlError("glGetUniformLocation uMVPMatrix");
if (muMVPMatrixHandle == -1) {
throw new RuntimeException("Could not get attrib location for uMVPMatrix");
}
muSTMatrixHandle = GLES20.glGetUniformLocation(mProgram, "uSTMatrix");
checkGlError("glGetUniformLocation uSTMatrix");
if (muSTMatrixHandle == -1) {
throw new RuntimeException("Could not get attrib location for uSTMatrix");
}
int[] textures = new int[1];
GLES20.glGenTextures(1, textures, 0);
mTextureID = textures[0];
GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, mTextureID);
checkGlError("glBindTexture mTextureID");
GLES20.glTexParameterf(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_MIN_FILTER,
GLES20.GL_NEAREST);
GLES20.glTexParameterf(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_MAG_FILTER,
GLES20.GL_LINEAR);
GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_WRAP_S,
GLES20.GL_CLAMP_TO_EDGE);
GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_WRAP_T,
GLES20.GL_CLAMP_TO_EDGE);
checkGlError("glTexParameter");
}
/**
* Replaces the fragment shader.
*/
public void changeFragmentShader(String fragmentShader) {
GLES20.glDeleteProgram(mProgram);
mProgram = createProgram(VERTEX_SHADER, fragmentShader);
if (mProgram == 0) {
throw new RuntimeException("failed creating program");
}
}
private int loadShader(int shaderType, String source) {
int shader = GLES20.glCreateShader(shaderType);
checkGlError("glCreateShader type=" + shaderType);
GLES20.glShaderSource(shader, source);
GLES20.glCompileShader(shader);
int[] compiled = new int[1];
GLES20.glGetShaderiv(shader, GLES20.GL_COMPILE_STATUS, compiled, 0);
if (compiled[0] == 0) {
Log.e(TAG, "Could not compile shader " + shaderType + ":");
Log.e(TAG, " " + GLES20.glGetShaderInfoLog(shader));
GLES20.glDeleteShader(shader);
shader = 0;
}
return shader;
}
private int createProgram(String vertexSource, String fragmentSource) {
int vertexShader = loadShader(GLES20.GL_VERTEX_SHADER, vertexSource);
if (vertexShader == 0) {
return 0;
}
int pixelShader = loadShader(GLES20.GL_FRAGMENT_SHADER, fragmentSource);
if (pixelShader == 0) {
return 0;
}
int program = GLES20.glCreateProgram();
checkGlError("glCreateProgram");
if (program == 0) {
Log.e(TAG, "Could not create program");
}
GLES20.glAttachShader(program, vertexShader);
checkGlError("glAttachShader");
GLES20.glAttachShader(program, pixelShader);
checkGlError("glAttachShader");
GLES20.glLinkProgram(program);
int[] linkStatus = new int[1];
GLES20.glGetProgramiv(program, GLES20.GL_LINK_STATUS, linkStatus, 0);
if (linkStatus[0] != GLES20.GL_TRUE) {
Log.e(TAG, "Could not link program: ");
Log.e(TAG, GLES20.glGetProgramInfoLog(program));
GLES20.glDeleteProgram(program);
program = 0;
}
return program;
}
public void checkGlError(String op) {
int error;
while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
Log.e(TAG, op + ": glError " + error);
throw new RuntimeException(op + ": glError " + error);
}
}
}
......@@ -54,12 +54,12 @@ public class FullscreenableChromeClient extends WebChromeClient {
this.onShowCustomView(view, callback);
}
@Override
public void onHideCustomView() {
if (mCustomView == null) {
return;
}
setFullscreen(false);
FrameLayout decor = (FrameLayout) mActivity.getWindow().getDecorView();
decor.removeView(mFullscreenContainer);
......@@ -67,23 +67,20 @@ public class FullscreenableChromeClient extends WebChromeClient {
mCustomView = null;
mCustomViewCallback.onCustomViewHidden();
mActivity.setRequestedOrientation(mOriginalOrientation);
}
private void setFullscreen(boolean enabled) {
Window win = mActivity.getWindow();
WindowManager.LayoutParams winParams = win.getAttributes();
final int bits = WindowManager.LayoutParams.FLAG_FULLSCREEN;
int resourceId = mActivity.getResources().getIdentifier("navigation_bar_height", "dimen", "android");
if (enabled) {
winParams.flags |= bits;
} else {
winParams.flags &= ~bits;
if (mCustomView != null) {
mCustomView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
}
View decorView = win.getDecorView();
mCustomView.setPadding(0,0,0, mActivity.getResources().getDimensionPixelSize(resourceId));
ViewGroup.LayoutParams param = mCustomView.getLayoutParams();
param.width = ViewGroup.LayoutParams.MATCH_PARENT;
mCustomView.setLayoutParams(param);
}
win.setAttributes(winParams);
}
private static class FullscreenHolder extends FrameLayout {
......
package jp.agentec.abook.abv.ui.viewer.activity;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.provider.MediaStore;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON;
import jp.agentec.abook.abv.bl.acms.type.OperationType;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.Callback;
import jp.agentec.abook.abv.bl.common.CommonExecutor;
import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.exception.ABVExceptionCode;
import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
import jp.agentec.abook.abv.bl.data.dao.ContentDao;
import jp.agentec.abook.abv.bl.dto.ContentDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.ContentObjectLogLogic;
import jp.agentec.abook.abv.bl.logic.OperationLogic;
import jp.agentec.abook.abv.cl.util.ContentLogUtil;
import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.activity.ABVAuthenticatedActivity;
import jp.agentec.abook.abv.ui.common.activity.ABVContentViewActivity;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.common.constant.ErrorCode;
import jp.agentec.abook.abv.ui.common.constant.ErrorMessage;
import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog;
import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
import jp.agentec.abook.abv.ui.common.util.PatternStringUtil;
import jp.agentec.abook.abv.ui.home.activity.ABookSettingActivity;
import jp.agentec.abook.abv.ui.home.helper.ABookCheckWebViewHelper;
import jp.agentec.abook.abv.ui.home.helper.ABookPermissionHelper;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.home.helper.ContentViewHelper;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.FileUtil;
public class CommunicationWebViewActivity extends ABVAuthenticatedActivity {
private static final String TAG = "CommunicationWebViewActivity";
private LinearLayout historyLayout;
private ImageButton addSceneButton;
protected ImageButton promoteBtn;
protected ImageButton pauseBtn;
protected ImageButton mBtnRemoteStart;
protected Button historyListBtn;
protected ImageButton btnWebClose;
protected Button closeButton;
protected Button btnLinkOriginalBack;
protected Button btnWebBack;
protected Button btnWebForward;
private ProgressBar m_progress;
protected ContentDto mContentDto;
protected File mLocalFile;
public final static int ABOOK_CHECK_TASK_IMAGE = 103;
public final static int ABOOK_CHECK_TASK_VIDEO = 104;
@Override
protected void onDestroy() {
Logger.d(TAG, "onDestroy");
super.onDestroy();
}
protected Uri attachmentImageProcessing(Uri uri) throws Exception {
if (uri == null) {
return null;
}
String[] operationion = {MediaStore.MediaColumns.DATA};
Cursor cursor = getContentResolver().query(uri, operationion, null, null, null);
String photoFilePath = ABookCheckWebViewHelper.getInstance().contentSchemeUriToFilePath(cursor);
try {
int rotationAngle = ABookCheckWebViewHelper.getInstance().rotateBitmapOrientation(photoFilePath);
mLocalFile = new File(photoFilePath);
if (mLocalFile.exists()) {
return Uri.fromFile(mLocalFile);
}
} catch (FileNotFoundException e) {
Logger.e(TAG, "image file is not found", e);
}
return null;
}
}
......@@ -76,6 +76,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Stack;
import java.util.concurrent.ConcurrentHashMap;
import jp.agentec.abook.abv.bl.acms.client.json.DownloadedContentInfoJSON;
......@@ -118,6 +119,7 @@ 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.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.appinfo.AppColor;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
......@@ -135,6 +137,8 @@ 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.ABVPopupListWindow;
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.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.Interface.MovePageInterface;
......@@ -332,6 +336,8 @@ public class ContentViewActivity extends ABVContentViewActivity {
public boolean mShowPinFlg = true;
// 移動・タップモードのフラグ
public boolean mMoveTaskFlg = false;
/**
* スクロールステータス
......@@ -347,6 +353,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
Logger.i(TAG, "[onCreate]:contentId=" + getContentId());
super.onCreate(savedInstanceState);
// 全画面表示
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
......@@ -704,6 +711,15 @@ public class ContentViewActivity extends ABVContentViewActivity {
setToolbarVisableForTask(true);
}
}
if (isCollaboration) {
if (mPageNumberLayout != null) {
mPageNumberLayout.setVisibility(View.GONE);
}
if (mSeekBarLayout != null) {
mSeekBarLayout.setVisibility(View.GONE);
}
}
}
private void configureSize() {
......@@ -941,6 +957,14 @@ public class ContentViewActivity extends ABVContentViewActivity {
showMeetingExitDialog();
}
});
if (isCollaboration) {
titleTxt.setVisibility(View.GONE);
pauseBtn.setVisibility(View.GONE);
exitMeetingBtn.setVisibility(View.GONE);
exitBtn.setVisibility(View.GONE);
promoteBtn.setVisibility(View.GONE);
}
}
private boolean addPageViewFinish;
......@@ -1390,6 +1414,16 @@ public class ContentViewActivity extends ABVContentViewActivity {
mBtnRemoteStart.setVisibility(View.GONE);
}
}
if (isCollaboration) {
mHistoryBtn.setVisibility(View.GONE);
indexBtn.setVisibility(View.GONE);
search.setVisibility(View.GONE);
marking.setVisibility(View.GONE);
bookmark.setVisibility(View.GONE);
subMenuBtn.setVisibility(View.GONE);
tvContentTitle.setVisibility(View.GONE);
}
}
private void setMarkingViewVisibility(boolean visible){
......@@ -1758,6 +1792,14 @@ public class ContentViewActivity extends ABVContentViewActivity {
// ページ番号を表示する
setCurrentPageNumber();
}
if (isCollaboration) {
bookmark.setVisibility(View.GONE);
if (hasMultiPages) {
mPageNumberLayout.setVisibility(View.GONE);
mSeekBarLayout.setVisibility(View.GONE);
}
}
}
else {
if (hasMultiPages) {
......@@ -1823,6 +1865,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
exitMeetingBtn.setVisibility(View.VISIBLE);
}
}
mToolBar.setVisibility(visability);
}
......@@ -1859,7 +1902,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
}
} else {
TranslateAnimation toolBarAnimation;
if (mToolBar.getVisibility() == View.GONE) {
if (mToolBar.getVisibility() == View.GONE && !(meetingManager.isSubscribed() && isCollaboration)) {
setToolbarVisable(true);
toolBarAnimation = new TranslateAnimation(0, 0, -mToolBar.getHeight(), 0);
Logger.d(TAG, "[singleTapMotion]:[mToolBar]:VISIBLE");
......@@ -2641,8 +2684,20 @@ public class ContentViewActivity extends ABVContentViewActivity {
break;
case ActionInfoJSON.CONTENTLINK_ACTION:
//コンテンツリンクに紐づいたAction Buttonのイベント
if (meetingManager.isCollaboration()) {
final ABookAlertDialog nonTargetMeetingContentDialog = AlertDialogUtil.createAlertDialog(ContentViewActivity.this, R.string.app_name);
nonTargetMeetingContentDialog.setCancelable(false);
nonTargetMeetingContentDialog.setMessage(isCollaboration? R.string.msg_non_target_document_collaboration_content : R.string.msg_non_target_meeting_content);
nonTargetMeetingContentDialog.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int whichButton) {
nonTargetMeetingContentDialog.dismiss();
}
});
nonTargetMeetingContentDialog.show();
break;
}
long linkContentId = actionInfoJSON.getContentId();
// プロジェクト関連資料なのかをチェック
if (ActivityHandlingHelper.getInstance().isExistCommonContent(getContentId())) {
if (!ActivityHandlingHelper.getInstance().isExistCommonContent(linkContentId)) {
......
......@@ -394,7 +394,6 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
printButtonActivityControl();
historyListBtn.setVisibility(View.GONE);
if (isLinkedContent) {
if (ContentJSON.KEY_MOVIE_TYPE.equals(mContentDto.contentType) || ContentJSON.KEY_MUSIC_TYPE.equals(mContentDto.contentType)
|| ContentJSON.KEY_PANO_IMAGE_TYPE.equals(mContentDto.contentType) || ContentJSON.KEY_PANO_MOVIE_TYPE.equals(mContentDto.contentType)
......@@ -427,7 +426,9 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
} else {
configureRemote();
}
if (meetingManager.isCollaboration()) {
exitMeetingBtn.setVisibility(View.GONE);
}
}
private class JsInf {
......
......@@ -86,8 +86,8 @@ is_check_invalid_passward_limit=true
repeat_default=true
#Setting Info(設定画面のABookについての設定情報)
version_name=1.3.101
release_date=2021/05/18
version_name=1.3.200
release_date=2021/06/22
copy_right=2016 AGENTEC Co.,Ltd. All rights reserved.
hope_page=http://www.agentec.jp
contact_email=abook-appsupport@agentec.jp
......
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