Commit 7d4a7326 by Lee Jaebin

シーン追加用の素材API修正

parent b6d05e31
......@@ -619,22 +619,24 @@ public class AcmsClient implements AcmsClientResponseListener {
/**
* パノラマで使用するシーンを登録
* @param sid
* @param contentId
* @param FormFile シーンで使用する画像
* @return
* @throws IOException
* @throws AcmsException
*/
public SceneEntryJSON sceneEntry(String sid, File FormFile) throws IOException, AcmsException, NetworkDisconnectedException {
public SceneEntryJSON sceneEntry(String sid, Long contentId, File FormFile) throws IOException, AcmsException, NetworkDisconnectedException {
if (networkAdapter != null && !networkAdapter.isNetworkConnected()) { // NWのチェック
throw new NetworkDisconnectedException();
}
String apiUrl = AcmsApis.getApiUrl(env.acmsAddress, urlPath, AcmsApis.ApiSceneEntry);
HttpMultipart part1 = new HttpMultipart(ABookKeys.SID, sid);
HttpMultipart part2 = new HttpMultipart(ABookKeys.FORM_FILE, FormFile);
HttpResponse result = HttpRequestSender.post(apiUrl, new HttpMultipart[]{part1, part2});
HttpMultipart part2 = new HttpMultipart(ABookKeys.CONTENT_ID, StringUtil.toString(contentId));
HttpMultipart part3 = new HttpMultipart(ABookKeys.FORM_FILE, FormFile);
HttpResponse result = HttpRequestSender.post(apiUrl, new HttpMultipart[]{part1, part2, part3});
SceneEntryJSON json = new SceneEntryJSON(result.httpResponseBody);
if (json.httpStatus != 200) {
throw new AcmsException(ABVExceptionCode.fromResponseCode(result.httpResponseCode), null);
throw new AcmsException(ABVExceptionCode.fromResponseCode(result.httpResponseCode), new AcmsMessageJSON(result.httpResponseBody));
}
Logger.d(TAG, "sceneEntry res: %s", json.toString());
......
......@@ -1378,11 +1378,12 @@ public class OperationLogic extends AbstractLogic {
/**
* シーンの登録
* @param file
* @param contentId
* @throws IOException
* @throws AcmsException
*/
public Integer sendScene(File file) throws IOException, AcmsException, NetworkDisconnectedException {
SceneEntryJSON json = AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).sceneEntry(cache.getMemberInfo().sid, file);
public Integer sendScene(File file, Long contentId) throws IOException, AcmsException, NetworkDisconnectedException {
SceneEntryJSON json = AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).sceneEntry(cache.getMemberInfo().sid, contentId, file);
return json.resourceId;
}
......
......@@ -73,6 +73,7 @@ public class OperationGroupMasterListHelper extends HierarchyOperationListHelper
} else {
// 表示する作業種別が既に削除された場合、最上位階層に戻る(リセット)
popList(breadCrumbList.size() - 1, false);
// クリアフラグをfalseにセット
ABVEnvironment.getInstance().setOperationGroupMasterClearFlg(false);
// 作業種別の選択画面を閉じる
mAppActivity.closeOperationGroupMasterDialog();
......
......@@ -277,7 +277,7 @@ public class ParentWebViewActivity extends ABVContentViewActivity {
if (responseUri != null && responseUri.getPath() != null) {
File file = new File(responseUri.getPath());
try {
final Integer resourceId = AbstractLogic.getLogic(OperationLogic.class).sendScene(file);
final Integer resourceId = AbstractLogic.getLogic(OperationLogic.class).sendScene(file, contentId);
if (resourceId != null) {
runOnUiThread(new Runnable() {
@Override
......@@ -320,13 +320,24 @@ public class ParentWebViewActivity extends ABVContentViewActivity {
}
} catch (Exception e) {
Logger.e(TAG, e);
handler.post(new Runnable() {
@Override
public void run() {
closeProgressPopup();
showFailedSceneApiDialog();
}
});
// ロック中である場合以下のエラーメッセージで判定
if (e.getMessage().equals("C018")) {
runOnUiThread(new Runnable() {
@Override
public void run() {
closeProgressPopup();
webViewLoadUrl(String.format("javascript:EDC.handleError({ 'status' : 400 }, '', {'message' : 'C018'})"));
}
});
} else {
handler.post(new Runnable() {
@Override
public void run() {
closeProgressPopup();
showFailedSceneApiDialog();
}
});
}
} finally {
//アプリ内のファイルのみ削除(Galleryファイルは削除しない)
if (mLocalFile != null && mLocalFile.getPath().contains(getPackageName())) {
......
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