Commit c957db90 by Lee Munkyeong

Merge branch 'features/abcomm_sp6_collaboration_picture' into 'features/abcomm_sp6'

Features/abcomm sp6 collaboration picture

See merge request !127
parents 48aa861a 9f97b1dc
...@@ -72,6 +72,7 @@ import jp.agentec.abook.abv.bl.acms.client.parameters.GetNameCardParameters; ...@@ -72,6 +72,7 @@ import jp.agentec.abook.abv.bl.acms.client.parameters.GetNameCardParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.GetOperationDataParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.GetOperationDataParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.GetTaskFileParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.GetTaskFileParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.InviteUsersParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.InviteUsersParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.JoinCollaborationParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.NewAppStoreLoginParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.NewAppStoreLoginParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.PasswordChangeParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.PasswordChangeParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.PostEnqueteReplyParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.PostEnqueteReplyParameters;
...@@ -785,6 +786,21 @@ public class AcmsClient implements AcmsClientResponseListener { ...@@ -785,6 +786,21 @@ public class AcmsClient implements AcmsClientResponseListener {
} }
/** /**
* 協業参加
*
* @param sid
* @param roomId
* @return
* @throws NetworkDisconnectedException
* @throws AcmsException
*/
public ArchiveDetailJSON 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;
}
/**
* 作業報告データ送信 * 作業報告データ送信
* @param sid * @param sid
* @param operationId * @param operationId
......
package jp.agentec.abook.abv.bl.acms.client.parameters;
import jp.agentec.adf.net.http.HttpParameterObject;
/**
* ACMSのAPIに渡す共通的なパラメータを格納します。ACMSのAPIのパラメータ用クラスを作成するときはこのクラスを継承してください。<br>
* ただし、このクラスはログイン状態の確認用として使われる {@link JoinCollaborationParameters#sid} を持っているため、ログイン用のパラメータ {@link MobileLoginParameters} は、このクラスを継承する必要はありません。
* @author lee-mk
* @version 1.0.0
*/
public class JoinCollaborationParameters extends HttpParameterObject {
/**
* セッションID
* @since 1.0.0
*/
private String sid;
private String cmd;
private Integer roomId;
/**
* {@link JoinCollaborationParameters} のインスタンスを初期化します。
* @param sid ログインした時のセッションIDです。
* @param cmd Apiリクエストに必要なコマンド(ABOOK COMM専用)。
* @since 1.0.0
*/
public JoinCollaborationParameters(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;
}
}
...@@ -175,6 +175,7 @@ public class AcmsApis { ...@@ -175,6 +175,7 @@ public class AcmsApis {
public static final String ApigetMessage = "message"; public static final String ApigetMessage = "message";
public static final String ApigetFavorite = "favorite"; public static final String ApigetFavorite = "favorite";
public static final String ApigetArchive = "archive"; public static final String ApigetArchive = "archive";
public static final String ApigetCollaboration = "collaboration";
public static final class UserCmds { public static final class UserCmds {
public static final String inviteUsers = "3"; public static final String inviteUsers = "3";
...@@ -207,6 +208,12 @@ public class AcmsApis { ...@@ -207,6 +208,12 @@ public class AcmsApis {
public static final String getArchiveDetail = "2"; public static final String getArchiveDetail = "2";
} }
public static final class CollaborationCmds {
public static final String start = "1";
public static final String join = "2";
public static final String finish = "3";
}
// download // download
/** /**
* コンテンツのZIPファイルを取得<br> * コンテンツのZIPファイルを取得<br>
...@@ -253,7 +260,9 @@ public class AcmsApis { ...@@ -253,7 +260,9 @@ public class AcmsApis {
methodName.equals(ApiOperationGroupMaster) || methodName.equals(ApiGetApertureMasterData) || methodName.equals(ApiQuickReportSearch) || methodName.equals(ApiQuickReportRevision) methodName.equals(ApiOperationGroupMaster) || methodName.equals(ApiGetApertureMasterData) || methodName.equals(ApiQuickReportSearch) || methodName.equals(ApiQuickReportRevision)
|| methodName.equals(ApiGetProcessData) || methodName.equals(ApiDeleteProcess)) { || methodName.equals(ApiGetProcessData) || methodName.equals(ApiDeleteProcess)) {
apiValue = Constant.ApiValue.checkapi; apiValue = Constant.ApiValue.checkapi;
} else if (methodName.equals(ApiGetChatPushData) || methodName.equals(ApigetChatRooms) || methodName.equals(ApigetUser) || methodName.equals(ApigetMessage) || methodName.equals(ApigetFavorite) || methodName.equals(ApigetArchive)) { // pushActionはchatapiを指定 } else if (methodName.equals(ApiGetChatPushData) || methodName.equals(ApigetChatRooms) || methodName.equals(ApigetUser)
|| methodName.equals(ApigetMessage) || methodName.equals(ApigetFavorite) || methodName.equals(ApigetArchive)
|| methodName.equals(ApigetCollaboration)) { // pushActionはchatapiを指定
apiValue = Constant.ApiValue.chatapi; apiValue = Constant.ApiValue.chatapi;
} }
......
...@@ -68,6 +68,13 @@ public interface ABookCommConstants { ...@@ -68,6 +68,13 @@ public interface ABookCommConstants {
String ATTEND_USER_IDS = "attendUserIds"; String ATTEND_USER_IDS = "attendUserIds";
String ARCHIVE_INFO_LAST_UPDATE_DATE = "archiveInfoLastUpdateDate"; String ARCHIVE_INFO_LAST_UPDATE_DATE = "archiveInfoLastUpdateDate";
String CONTENT_ID = "contentId";
String CONTENT_NAEM = "contentName";
String THUMBNAIL_NORMAL_PATH = "thumbnailNormalPath";
String THUMBNAIL_BIG_PATH = "thumbnailBigPath";
String RESOURCE_PATH = "resourcePath";
String COLLABORATION_DEATAIL_ID = "collaborationDetailId"; String COLLABORATION_DEATAIL_ID = "collaborationDetailId";
String ROOT_GROUP_ID = "rootGroupId"; String ROOT_GROUP_ID = "rootGroupId";
...@@ -108,6 +115,18 @@ public interface ABookCommConstants { ...@@ -108,6 +115,18 @@ public interface ABookCommConstants {
Integer COLLABORATION_START = 4; Integer COLLABORATION_START = 4;
Integer COLLABORATION_END = 5; Integer COLLABORATION_END = 5;
} }
interface COLLABORATION_TYPE {
Integer AUDIO = 0;
Integer CAMERA = 2;
Integer VIDEO = 3;
}
interface COLLABORATION_JOIN_FLG {
Integer CREATE = 0;
Integer JOIN = 1;
}
Integer GROUP_REQUEST_ALL = 0; Integer GROUP_REQUEST_ALL = 0;
} }
......
...@@ -18,11 +18,13 @@ import jp.agentec.abook.abv.bl.data.dao.ArchiveDao; ...@@ -18,11 +18,13 @@ import jp.agentec.abook.abv.bl.data.dao.ArchiveDao;
import jp.agentec.abook.abv.bl.data.dao.ChatGroupDao; import jp.agentec.abook.abv.bl.data.dao.ChatGroupDao;
import jp.agentec.abook.abv.bl.data.dao.ChatMessageDao; import jp.agentec.abook.abv.bl.data.dao.ChatMessageDao;
import jp.agentec.abook.abv.bl.data.dao.ChatRoomDao; import jp.agentec.abook.abv.bl.data.dao.ChatRoomDao;
import jp.agentec.abook.abv.bl.data.dao.ContentDao;
import jp.agentec.abook.abv.bl.data.dao.ShopMemberDao; import jp.agentec.abook.abv.bl.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.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.ChatGroupDto;
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.ArrayUtil;
import jp.agentec.adf.util.CollectionUtil; import jp.agentec.adf.util.CollectionUtil;
...@@ -39,6 +41,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -39,6 +41,7 @@ public class CommunicationLogic extends AbstractLogic {
private ChatMessageDao chatMessageDao = AbstractDao.getDao(ChatMessageDao.class); private ChatMessageDao chatMessageDao = AbstractDao.getDao(ChatMessageDao.class);
private ShopMemberDao shopMemberDao = AbstractDao.getDao(ShopMemberDao.class); private ShopMemberDao shopMemberDao = AbstractDao.getDao(ShopMemberDao.class);
private ChatGroupDao chatGroupDao = AbstractDao.getDao(ChatGroupDao.class); private ChatGroupDao chatGroupDao = AbstractDao.getDao(ChatGroupDao.class);
private ContentDao contentDao = AbstractDao.getDao(ContentDao.class);
private String localFilePath; private String localFilePath;
private ArchiveDao archiveDao = AbstractDao.getDao(ArchiveDao.class); private ArchiveDao archiveDao = AbstractDao.getDao(ArchiveDao.class);
...@@ -999,4 +1002,20 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -999,4 +1002,20 @@ public class CommunicationLogic extends AbstractLogic {
} }
return StringUtil.join(seperator, groupPathString); return StringUtil.join(seperator, groupPathString);
} }
public String getContentList() {
List<ContentDto> contentDtoList = contentDao.getDownloadedContents();
JSONArray resultJsonArray = new JSONArray();
for (ContentDto contentDto : contentDtoList) {
Map<String, Object> contentMap = new HashMap<String, Object>();
contentMap.put(ABookCommConstants.KEY.CONTENT_ID, contentDto.contentId);
contentMap.put(ABookCommConstants.KEY.CONTENT_NAEM, contentDto.contentName);
contentMap.put(ABookCommConstants.KEY.THUMBNAIL_NORMAL_PATH, contentDto.thumbnailNormalPath);
contentMap.put(ABookCommConstants.KEY.THUMBNAIL_BIG_PATH, contentDto.thumbnailBigPath);
contentMap.put(ABookCommConstants.KEY.RESOURCE_PATH, contentDto.resourcePath);
JSONObject jsonObject = new JSONObject(contentMap);
resultJsonArray.put(jsonObject);
}
return resultJsonArray.toString();
}
} }
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
<uses-permission android:name="android.permission.CAMERA"/> <uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.FLASHLIGHT"/> <uses-permission android:name="android.permission.FLASHLIGHT"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<permission <permission
android:name="${applicationId}.permission.C2D_MESSAGE" android:name="${applicationId}.permission.C2D_MESSAGE"
android:protectionLevel="signature" /> android:protectionLevel="signature" />
......
...@@ -89,7 +89,7 @@ android { ...@@ -89,7 +89,7 @@ android {
armv7 { armv7 {
versionCode defaultConfig.versionCode versionCode defaultConfig.versionCode
ndk { ndk {
abiFilters "armeabi-v7a", "x86", "" abiFilters "armeabi-v7a", ""
} }
} }
...@@ -124,7 +124,7 @@ android { ...@@ -124,7 +124,7 @@ android {
armv7 { armv7 {
versionCode defaultConfig.versionCode versionCode defaultConfig.versionCode
ndk { ndk {
abiFilters "armeabi-v7a", "x86", "" abiFilters "armeabi-v7a", ""
} }
} }
armv8 { armv8 {
......
...@@ -20,8 +20,10 @@ import android.net.NetworkInfo; ...@@ -20,8 +20,10 @@ import android.net.NetworkInfo;
import android.net.Uri; import android.net.Uri;
import android.net.wifi.WifiManager; import android.net.wifi.WifiManager;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.Environment; import android.os.Environment;
import android.support.annotation.RequiresApi;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
import android.view.Window; import android.view.Window;
...@@ -29,6 +31,7 @@ import android.webkit.CookieManager; ...@@ -29,6 +31,7 @@ import android.webkit.CookieManager;
import android.webkit.DownloadListener; import android.webkit.DownloadListener;
import android.webkit.JavascriptInterface; import android.webkit.JavascriptInterface;
import android.webkit.JsResult; import android.webkit.JsResult;
import android.webkit.PermissionRequest;
import android.webkit.ValueCallback; import android.webkit.ValueCallback;
import android.webkit.WebChromeClient; import android.webkit.WebChromeClient;
import android.webkit.WebSettings; import android.webkit.WebSettings;
...@@ -110,6 +113,9 @@ public class ChatWebviewActivity extends ParentWebViewActivity { ...@@ -110,6 +113,9 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
private final String CHAT_PAGE_URL = "file:///android_asset/chat/public_new/chat.html"; private final String CHAT_PAGE_URL = "file:///android_asset/chat/public_new/chat.html";
private final String CHAT_ROOM_PAGE_URL = "file:///android_asset/chat/public_new/chat_room.html"; private final String CHAT_ROOM_PAGE_URL = "file:///android_asset/chat/public_new/chat_room.html";
private final String PICTURE_COLLABORATION_PAGE_URL = "file:///android_asset/chat/public_new/collaboration_picture.html";
private final String VIDEO_COLLABORATION_PAGE_URL = "file:///android_asset/chat/public_new/collaboration_video.html";
private final String VOICE_COLLABORATION_PAGE_URL = "file:///android_asset/chat/public_new/collaboration_voice.html";
private final String DEFAULT_CHECKSUM = "0000000000"; private final String DEFAULT_CHECKSUM = "0000000000";
//AISDevelop //AISDevelop
...@@ -128,6 +134,9 @@ public class ChatWebviewActivity extends ParentWebViewActivity { ...@@ -128,6 +134,9 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
private Integer shopMemberId; private Integer shopMemberId;
private String selectedUserIdList; private String selectedUserIdList;
// 0:協業生成, 1:協業参加
private Integer collaborationJoinFlg = 0;
public AlertDialog myAlertDialog; public AlertDialog myAlertDialog;
private ImageButton mOperationHomeButton; // ホームボタン private ImageButton mOperationHomeButton; // ホームボタン
...@@ -267,6 +276,12 @@ public class ChatWebviewActivity extends ParentWebViewActivity { ...@@ -267,6 +276,12 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
mChatWebView.setWebChromeClient(new FullscreenableChromeClient(this) { mChatWebView.setWebChromeClient(new FullscreenableChromeClient(this) {
@Override @Override
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public void onPermissionRequest(final PermissionRequest request) {
request.grant(request.getResources());
}
@Override
public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> filePathCallback, FileChooserParams fileChooserParams) { public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> filePathCallback, FileChooserParams fileChooserParams) {
boolean result = false; boolean result = false;
// 画像が選択された場合 // 画像が選択された場合
...@@ -1281,6 +1296,29 @@ public class ChatWebviewActivity extends ParentWebViewActivity { ...@@ -1281,6 +1296,29 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
} }
communicationLogic.updateArchiveDetial(resultJson.archiveDto); communicationLogic.updateArchiveDetial(resultJson.archiveDto);
} }
@JavascriptInterface
public void joinCollaboration(String collaborationType) throws NetworkDisconnectedException, AcmsException {
collaborationJoinFlg = ABookCommConstants.FLAG.COLLABORATION_JOIN_FLG.JOIN;
AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).joinCollaboration(sid, roomId.intValue());
moveCollaborationScreen(Integer.parseInt(collaborationType));
}
@JavascriptInterface
public void startCollaboration(String collaborationType) {
collaborationJoinFlg = ABookCommConstants.FLAG.COLLABORATION_JOIN_FLG.CREATE;
moveCollaborationScreen(Integer.parseInt(collaborationType));
}
@JavascriptInterface
public String getCollaborationJoinFlg() {
return collaborationJoinFlg.toString();
}
@JavascriptInterface
public String getContentList() {
return communicationLogic.getContentList();
}
} }
/** /**
...@@ -1334,6 +1372,37 @@ public class ChatWebviewActivity extends ParentWebViewActivity { ...@@ -1334,6 +1372,37 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
return result; return result;
} }
private void moveCollaborationScreen(Integer collaborationType) {
switch (collaborationType) {
case 0:
mChatWebView.post(new Runnable() {
@Override
public void run() {
mChatWebView.loadUrl(VOICE_COLLABORATION_PAGE_URL);
}
});
break;
case 2:
mChatWebView.post(new Runnable() {
@Override
public void run() {
mChatWebView.loadUrl(PICTURE_COLLABORATION_PAGE_URL);
}
});
break;
case 3:
mChatWebView.post(new Runnable() {
@Override
public void run() {
mChatWebView.loadUrl(VIDEO_COLLABORATION_PAGE_URL);
}
});
break;
default:
break;
}
}
private boolean deleteFavoriteGroup(String groupId) throws NetworkDisconnectedException, AcmsException { private boolean deleteFavoriteGroup(String groupId) throws NetworkDisconnectedException, AcmsException {
boolean result = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter) boolean result = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter)
.deleteFavoriteGroup(sid, Integer.parseInt(groupId)); .deleteFavoriteGroup(sid, Integer.parseInt(groupId));
......
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