Commit 2044e9c0 by Lee Munkyeong

Merge branch 'features/1.4.100_develop_mk' into 'features/1.4.201'

課題票75,110対応

See merge request !238
parents 47084337 1e9de99e
...@@ -130,7 +130,7 @@ public class OperationDao extends AbstractDao { ...@@ -130,7 +130,7 @@ public class OperationDao extends AbstractDao {
dto.permitCodeRequiredFlg = cursor.getInt(column); dto.permitCodeRequiredFlg = cursor.getInt(column);
} }
column = cursor.getColumnIndex("display_permission_flg "); column = cursor.getColumnIndex("display_permission_flg");
if (column != -1) { if (column != -1) {
dto.displayPermissionFlg = cursor.getInt(column); dto.displayPermissionFlg = cursor.getInt(column);
} }
......
Subproject commit 89f7f804a54cf4890189864d9384f6b3de21ccb4 Subproject commit 4b07d503bb21575b86ecea757fd8ca4323806371
...@@ -2,6 +2,7 @@ package jp.agentec.abook.abv.ui.common.activity; ...@@ -2,6 +2,7 @@ package jp.agentec.abook.abv.ui.common.activity;
import android.app.Activity; import android.app.Activity;
import android.app.Dialog; import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.ActivityNotFoundException; import android.content.ActivityNotFoundException;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
...@@ -28,17 +29,28 @@ import android.widget.Toast; ...@@ -28,17 +29,28 @@ import android.widget.Toast;
import com.google.firebase.iid.FirebaseInstanceId; import com.google.firebase.iid.FirebaseInstanceId;
import net.lingala.zip4j.exception.ZipException;
import org.json.adf.JSONObject;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.security.NoSuchAlgorithmException;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
import jp.agentec.abook.abv.bl.acms.client.AcmsClient;
import jp.agentec.abook.abv.bl.acms.client.json.DownloadedContentInfoJSON; import jp.agentec.abook.abv.bl.acms.client.json.DownloadedContentInfoJSON;
import jp.agentec.abook.abv.bl.acms.client.json.OperationDataJSON;
import jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON; import jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON;
import jp.agentec.abook.abv.bl.acms.client.parameters.GetOperationDataParameters;
import jp.agentec.abook.abv.bl.acms.type.DownloadStatusType; import jp.agentec.abook.abv.bl.acms.type.DownloadStatusType;
import jp.agentec.abook.abv.bl.common.ABVEnvironment; import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.Callback;
import jp.agentec.abook.abv.bl.common.CommonExecutor; import jp.agentec.abook.abv.bl.common.CommonExecutor;
import jp.agentec.abook.abv.bl.common.Constant; import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.Constant.AlertMessageLevel; import jp.agentec.abook.abv.bl.common.Constant.AlertMessageLevel;
...@@ -54,20 +66,29 @@ import jp.agentec.abook.abv.bl.common.util.ContentFileUtil; ...@@ -54,20 +66,29 @@ import jp.agentec.abook.abv.bl.common.util.ContentFileUtil;
import jp.agentec.abook.abv.bl.data.ABVDataCache; import jp.agentec.abook.abv.bl.data.ABVDataCache;
import jp.agentec.abook.abv.bl.data.dao.AbstractDao; import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
import jp.agentec.abook.abv.bl.data.dao.ContentDao; import jp.agentec.abook.abv.bl.data.dao.ContentDao;
import jp.agentec.abook.abv.bl.data.dao.OperationContentDao;
import jp.agentec.abook.abv.bl.data.dao.OperationDao; import jp.agentec.abook.abv.bl.data.dao.OperationDao;
import jp.agentec.abook.abv.bl.data.dao.TaskDao;
import jp.agentec.abook.abv.bl.data.dao.TaskReportDao;
import jp.agentec.abook.abv.bl.download.ContentDownloadListener; import jp.agentec.abook.abv.bl.download.ContentDownloadListener;
import jp.agentec.abook.abv.bl.download.ContentDownloader; import jp.agentec.abook.abv.bl.download.ContentDownloader;
import jp.agentec.abook.abv.bl.download.ContentFileExtractor;
import jp.agentec.abook.abv.bl.download.ContentRefresher; import jp.agentec.abook.abv.bl.download.ContentRefresher;
import jp.agentec.abook.abv.bl.download.ContentZipDownloadNotification; import jp.agentec.abook.abv.bl.download.ContentZipDownloadNotification;
import jp.agentec.abook.abv.bl.dto.ContentDto; import jp.agentec.abook.abv.bl.dto.ContentDto;
import jp.agentec.abook.abv.bl.dto.FixPushMessageDto; import jp.agentec.abook.abv.bl.dto.FixPushMessageDto;
import jp.agentec.abook.abv.bl.dto.OperationContentDto;
import jp.agentec.abook.abv.bl.dto.OperationDto; import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.bl.dto.PushMessageDto; import jp.agentec.abook.abv.bl.dto.PushMessageDto;
import jp.agentec.abook.abv.bl.dto.TaskDto;
import jp.agentec.abook.abv.bl.dto.TaskReportDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic; import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.BookmarkLogic; import jp.agentec.abook.abv.bl.logic.BookmarkLogic;
import jp.agentec.abook.abv.bl.logic.CommunicationLogic; import jp.agentec.abook.abv.bl.logic.CommunicationLogic;
import jp.agentec.abook.abv.bl.logic.ContractLogic; import jp.agentec.abook.abv.bl.logic.ContractLogic;
import jp.agentec.abook.abv.bl.logic.MemoLogic; import jp.agentec.abook.abv.bl.logic.MemoLogic;
import jp.agentec.abook.abv.bl.logic.OperationGroupMasterLogic;
import jp.agentec.abook.abv.bl.logic.OperationLogic;
import jp.agentec.abook.abv.bl.logic.PushMessageLogic; import jp.agentec.abook.abv.bl.logic.PushMessageLogic;
import jp.agentec.abook.abv.bl.logic.UserAuthenticateLogic; import jp.agentec.abook.abv.bl.logic.UserAuthenticateLogic;
import jp.agentec.abook.abv.cl.helper.ABVUncaughtExceptionHandler; import jp.agentec.abook.abv.cl.helper.ABVUncaughtExceptionHandler;
...@@ -105,13 +126,13 @@ import jp.agentec.abook.abv.ui.home.helper.ContentViewHelper; ...@@ -105,13 +126,13 @@ import jp.agentec.abook.abv.ui.home.helper.ContentViewHelper;
import jp.agentec.adf.net.http.HttpDownloadSimpleNotification; import jp.agentec.adf.net.http.HttpDownloadSimpleNotification;
import jp.agentec.adf.util.DateTimeFormat; import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil; import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.FileUtil;
import jp.agentec.adf.util.StringUtil; import jp.agentec.adf.util.StringUtil;
public abstract class ABVAuthenticatedActivity extends ABVActivity implements ContentDownloadListener { public abstract class ABVAuthenticatedActivity extends ABVActivity implements ContentDownloadListener {
private final static String TAG = "ABVAuthenticatedActivity"; private final static String TAG = "ABVAuthenticatedActivity";
public static final String FILEPATH = "FILEPATH"; public static final String FILEPATH = "FILEPATH";
//連続タップ防止用のボタン活性化するタイム //連続タップ防止用のボタン活性化するタイム
protected static final int BUTTON_ENABLE_DELAY_MILLIS = 500; protected static final int BUTTON_ENABLE_DELAY_MILLIS = 500;
...@@ -143,11 +164,19 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -143,11 +164,19 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
protected PushMessageListAdapter mPushMessageListAdapter; protected PushMessageListAdapter mPushMessageListAdapter;
protected ListView mFixPushMessageListView; protected ListView mFixPushMessageListView;
protected Dialog mPushMessageSendDialog; protected Dialog mPushMessageSendDialog;
protected ImageButton communicationButton; // コミュニケーションボタン protected ImageButton communicationButton; // コミュニケーションボタン
protected int mSelectedFixPuchMessagePosition; protected int mSelectedFixPuchMessagePosition;
protected int mSendType; protected int mSendType;
protected PushMessageLogic pushMessageLogic = AbstractLogic.getLogic(PushMessageLogic.class); protected PushMessageLogic pushMessageLogic = AbstractLogic.getLogic(PushMessageLogic.class);
protected TaskReportDao mTaskReportDao = AbstractDao.getDao(TaskReportDao.class);
protected OperationLogic mOperationLogic = AbstractLogic.getLogic(OperationLogic.class);
protected OperationGroupMasterLogic mOperationGroupMasterLogic = AbstractLogic.getLogic(OperationGroupMasterLogic.class);
protected PushMessageLogic mPushMessageLogic = AbstractLogic.getLogic(PushMessageLogic.class);
protected Date mOperationLastEditDate;
protected OperationDao mOperationDao = AbstractDao.getDao(OperationDao.class);
protected OperationContentDao mOperationContentDao = AbstractDao.getDao(OperationContentDao.class);
protected TaskDao mTaskDao = AbstractDao.getDao(TaskDao.class);
/** /**
* メッセージ表示タイプ * メッセージ表示タイプ
*/ */
...@@ -165,6 +194,8 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -165,6 +194,8 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
int CHANGED_META_INFO = 2; int CHANGED_META_INFO = 2;
int PAYMENT = 3; int PAYMENT = 3;
} }
private int DEFAULT_VALUE_ZERO = 0;
private boolean DEFAULT_VALUE_FALSE = false;
// 遷移元のアクティビティ名 // 遷移元のアクティビティ名
// PushMessage受信時に直接ChatRoomへ行かずに、ひとつまえのActivityに戻る為に使用する。 // PushMessage受信時に直接ChatRoomへ行かずに、ひとつまえのActivityに戻る為に使用する。
...@@ -180,7 +211,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -180,7 +211,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
private void sendRegistrationIdToCMS() { private void sendRegistrationIdToCMS() {
// Tokenが更新されたか確認 // Tokenが更新されたか確認
if (!PreferenceUtil.getUserPref(this, UserPrefKey.NEED_SEND_TOKEN, false)){ if (!PreferenceUtil.getUserPref(this, UserPrefKey.NEED_SEND_TOKEN, DEFAULT_VALUE_FALSE)){
// 更新されてない // 更新されてない
return; return;
} }
...@@ -940,7 +971,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -940,7 +971,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
TextView operationSelect = (TextView) mOperationSelectDialog.findViewById(R.id.tv_toolbar_title); TextView operationSelect = (TextView) mOperationSelectDialog.findViewById(R.id.tv_toolbar_title);
operationSelect.setText(PatternStringUtil.patternToInt(getApplicationContext(), operationSelect.setText(PatternStringUtil.patternToInt(getApplicationContext(),
R.string.operation_select, R.string.operation_select,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO)));
mOperationSelectDialog.findViewById(R.id.close_btn).setOnClickListener(new View.OnClickListener() { mOperationSelectDialog.findViewById(R.id.close_btn).setOnClickListener(new View.OnClickListener() {
@Override @Override
...@@ -1039,7 +1070,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -1039,7 +1070,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
// リソースパターンの適用 // リソースパターンの適用
titleTextView.setText(PatternStringUtil.patternToString(getApplicationContext(), titleTextView.setText(PatternStringUtil.patternToString(getApplicationContext(),
R.string.push_message_list, R.string.push_message_list,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO)));
} else { } else {
mPushMessageListView.setVisibility(View.GONE); mPushMessageListView.setVisibility(View.GONE);
mPushMessageListDialog.findViewById(R.id.close_btn).setVisibility(View.VISIBLE); mPushMessageListDialog.findViewById(R.id.close_btn).setVisibility(View.VISIBLE);
...@@ -1048,7 +1079,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -1048,7 +1079,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
// リソースパターンの適用 // リソースパターンの適用
titleTextView.setText(PatternStringUtil.patternToString(getApplicationContext(), titleTextView.setText(PatternStringUtil.patternToString(getApplicationContext(),
R.string.title_message_detail, R.string.title_message_detail,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO)));
} }
} }
...@@ -1112,7 +1143,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -1112,7 +1143,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
// リソースパターンの適用 // リソースパターンの適用
messageTitleTextView.setText(PatternStringUtil.patternToString(getApplicationContext(), messageTitleTextView.setText(PatternStringUtil.patternToString(getApplicationContext(),
R.string.free_input, R.string.free_input,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)) + " > "); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO)) + " > ");
TextView tvOperationName = (TextView) mPushMessageSendDialog.findViewById(R.id.operation_name); TextView tvOperationName = (TextView) mPushMessageSendDialog.findViewById(R.id.operation_name);
tvOperationName.setText(operationDto.operationName); tvOperationName.setText(operationDto.operationName);
...@@ -1157,7 +1188,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -1157,7 +1188,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
// リソースパターンの適用 // リソースパターンの適用
ABVToastUtil.showMakeText(this, PatternStringUtil.patternToString(getApplicationContext(), ABVToastUtil.showMakeText(this, PatternStringUtil.patternToString(getApplicationContext(),
R.string.push_message_input_null, R.string.push_message_input_null,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)), Toast.LENGTH_SHORT); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO)), Toast.LENGTH_SHORT);
return; return;
} }
byte[] messageByte = message.getBytes(StandardCharsets.UTF_8); byte[] messageByte = message.getBytes(StandardCharsets.UTF_8);
...@@ -1165,14 +1196,14 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -1165,14 +1196,14 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
// リソースパターンの適用 // リソースパターンの適用
ABVToastUtil.showMakeText(this, PatternStringUtil.patternToString(getApplicationContext(), ABVToastUtil.showMakeText(this, PatternStringUtil.patternToString(getApplicationContext(),
R.string.push_message_input_over, R.string.push_message_input_over,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)), Toast.LENGTH_SHORT); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO)), Toast.LENGTH_SHORT);
return; return;
} }
// リソースパターンの適用 // リソースパターンの適用
ProgressDialogHelper.showProgressPopup(this, true, PatternStringUtil.patternToString(getApplicationContext(), ProgressDialogHelper.showProgressPopup(this, true, PatternStringUtil.patternToString(getApplicationContext(),
R.string.file_initialization, R.string.file_initialization,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO)));
try { try {
boolean result = pushMessageLogic.sendPushMessageRequest(mSendType, message, operationId); boolean result = pushMessageLogic.sendPushMessageRequest(mSendType, message, operationId);
if (result) { if (result) {
...@@ -1180,19 +1211,19 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -1180,19 +1211,19 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
// リソースパターンの適用 // リソースパターンの適用
ABVToastUtil.showMakeText(this, PatternStringUtil.patternToString(getApplicationContext(), ABVToastUtil.showMakeText(this, PatternStringUtil.patternToString(getApplicationContext(),
R.string.push_message_send_success, R.string.push_message_send_success,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)), Toast.LENGTH_SHORT); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO)), Toast.LENGTH_SHORT);
} else { } else {
// リソースパターンの適用 // リソースパターンの適用
ABVToastUtil.showMakeText(this, PatternStringUtil.patternToString(getApplicationContext(), ABVToastUtil.showMakeText(this, PatternStringUtil.patternToString(getApplicationContext(),
R.string.push_message_send_fail, R.string.push_message_send_fail,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)), Toast.LENGTH_SHORT); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO)), Toast.LENGTH_SHORT);
} }
} catch (Exception e) { } catch (Exception e) {
Logger.e(TAG, e); Logger.e(TAG, e);
// リソースパターンの適用 // リソースパターンの適用
ABVToastUtil.showMakeText(this, PatternStringUtil.patternToString(getApplicationContext(), ABVToastUtil.showMakeText(this, PatternStringUtil.patternToString(getApplicationContext(),
R.string.push_message_send_fail, R.string.push_message_send_fail,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)), Toast.LENGTH_SHORT); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO)), Toast.LENGTH_SHORT);
} finally { } finally {
ProgressDialogHelper.closeProgressPopup(); ProgressDialogHelper.closeProgressPopup();
} }
...@@ -1209,14 +1240,14 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -1209,14 +1240,14 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
// リソースパターンの適用 // リソースパターンの適用
ProgressDialogHelper.showProgressPopup(this, true, PatternStringUtil.patternToString(getApplicationContext(), ProgressDialogHelper.showProgressPopup(this, true, PatternStringUtil.patternToString(getApplicationContext(),
R.string.file_initialization, R.string.file_initialization,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO)));
try { try {
List<FixPushMessageDto> fixPushMessageList = pushMessageLogic.getFixPushMessage(); List<FixPushMessageDto> fixPushMessageList = pushMessageLogic.getFixPushMessage();
FixPushMessageDto dto = new FixPushMessageDto(); FixPushMessageDto dto = new FixPushMessageDto();
// リソースパターンの適用 // リソースパターンの適用
dto.name = PatternStringUtil.patternToString(getApplicationContext(), dto.name = PatternStringUtil.patternToString(getApplicationContext(),
R.string.free_input, R.string.free_input,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO));
fixPushMessageList.add(0, dto); fixPushMessageList.add(0, dto);
mFixPushMessageListView.setAdapter(new FixPushMessageAdapter(this, fixPushMessageList, mSelectedFixPuchMessagePosition)); mFixPushMessageListView.setAdapter(new FixPushMessageAdapter(this, fixPushMessageList, mSelectedFixPuchMessagePosition));
mFixPushMessageListView.invalidate(); mFixPushMessageListView.invalidate();
...@@ -1243,7 +1274,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -1243,7 +1274,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
// リソースパターンの適用 // リソースパターンの適用
ABVToastUtil.showMakeText(this, PatternStringUtil.patternToString(getApplicationContext(), ABVToastUtil.showMakeText(this, PatternStringUtil.patternToString(getApplicationContext(),
R.string.respons_fix_push_message_fail, R.string.respons_fix_push_message_fail,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)), Toast.LENGTH_SHORT); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO)), Toast.LENGTH_SHORT);
} finally { } finally {
ProgressDialogHelper.closeProgressPopup(); ProgressDialogHelper.closeProgressPopup();
} }
...@@ -1273,6 +1304,292 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -1273,6 +1304,292 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
} }
/** /**
* 作業データ更新処理
* @param operationId 作業ID
* @param reportType 作業タイプ
* @param buttonEventFlag ボタンイベントフラグ
* @return エラー文言
*/
public String syncOperation(final long operationId, int reportType, boolean buttonEventFlag) {
final StringBuilder errorMsg = new StringBuilder();
try {
//コンテンツダウンロード関連プログレスバー値設定
progressDialogHorizontal.setProgress(20);
final Callback progressCallback = new Callback() {
@Override
public Object callback(Object ret) {
final int progress = (int)ret;
runOnUiThread(new Runnable() {
@Override
public void run() {
progressDialogHorizontal.setProgress(progressDialogHorizontal.getProgress() + progress);
}
});
return null;
}
};
// 報告送信
mOperationLogic.sendTaskReportSendData(operationId, progressCallback);
//工程全削除の送信(連続作業)
if (reportType == Constant.ReportType.ReportContinuous) {
if (!mOperationLogic.deleteProcess(operationId)) { //工程全削除送信失敗時
return PatternStringUtil.patternToString(getApplicationContext(),
R.string.msg_error_all_process_delete,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO));
}
}
progressDialogHorizontal.setProgress(60);
// 報告受信
mOperationLastEditDate = receptionTaskData(operationId, progressCallback, errorMsg);
//連続作業のみ承認データ取得
if (reportType == Constant.ReportType.ReportContinuous) {
mOperationLogic.getProcessData(operationId);
}
// mOperationLastEditDateがnullの場合、エラーと見做す
if (mOperationLastEditDate != null && reportType == Constant.ReportType.RoutineTask) {
if (buttonEventFlag) {
String dialogMsg = null;
// 定期点検の利用可能日付を取得
String avilableDateStr = mOperationLogic.getRoutineTaskOperationAvailableDateStr(operationId);
if (!StringUtil.isNullOrEmpty(avilableDateStr)) {
// 利用可能メッセージ
// リソースパターンの適用
dialogMsg = String.format(PatternStringUtil.patternToString(getApplicationContext(),
R.string.msg_routineTask_report_available_from,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO)), avilableDateStr);
} else if (!mTaskReportDao.existsToDoRoutineTaskReportData(operationId)) {
// 作業データが存在しないメッセージ
dialogMsg = PatternStringUtil.patternToString(getApplicationContext(),
R.string.msg_no_report_data,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO));
}
if (!StringUtil.isNullOrEmpty(dialogMsg)) {
errorMsg.append(dialogMsg);
}
}
putUserPref(String.format(AppDefType.UserPrefKey.SYNCED_OPERATION_ID, operationId), DateTimeUtil.toString(DateTimeUtil.getCurrentSqlDate(), DateTimeFormat.yyyyMMdd_none));
}
} catch (AcmsException e) {
//noinspection EnumSwitchStatementWhichMissesCases
switch (e.getCode()) {
case P_E_ACMS_P003:
// リソースパターンを適用
errorMsg.append(getString(PatternStringUtil.patternToInt(getApplicationContext(), R.string.P003, getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO))));
break;
case P_E_ACMS_P004:
errorMsg.append(getString(PatternStringUtil.patternToInt(getApplicationContext(), R.string.P004, getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO))));
break;
case P_E_ACMS_P005:
errorMsg.append(getString(PatternStringUtil.patternToInt(getApplicationContext(), R.string.P005, getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO))));
break;
case P_E_ACMS_P006:
errorMsg.append(getString(PatternStringUtil.patternToInt(getApplicationContext(), R.string.P006, getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO))));
break;
default:
Logger.e(TAG, "syncOperation", e);
errorMsg.append(ErrorMessage.getErrorMessage(this, ErrorMessage.getErrorCode(e)));
break;
}
mOperationLastEditDate = null;
} catch (Exception e) {
Logger.e(TAG, e);
errorMsg.append(ErrorMessage.getErrorMessage(this, ABVExceptionCode.C_E_SYSTEM_0001));
mOperationLastEditDate = null;
} finally {
handler.post(new Runnable() {
@Override
public void run() {
if (mOperationLastEditDate != null) {
mOperationLogic.finishedSyncOperation(operationId, mOperationLastEditDate);
progressDialogHorizontal.setProgress(100);
}
mOperationLastEditDate = null;
//screenRefresh();
closeProgressPopup();
}
});
}
return errorMsg.length() > 0 ? errorMsg.toString() : null;
}
/**
* 作業データ受信
* @param operationId
* @param progressCallback
* @return
* @throws NetworkDisconnectedException
* @throws ABVException
* @throws IOException
* @throws InterruptedException
* @throws NoSuchAlgorithmException
* @throws ZipException
*/
public Date receptionTaskData(long operationId, Callback progressCallback, StringBuilder errorMsg) throws NetworkDisconnectedException, ABVException, IOException, InterruptedException, NoSuchAlgorithmException, ZipException {
GetOperationDataParameters param = new GetOperationDataParameters(ABVDataCache.getInstance().getMemberInfo().sid, operationId);
OperationDto operationDto = mOperationLogic.getOperation(operationId);
OperationContentDto operationContentDto = mOperationContentDao.getOperationMainContent(operationId);
List<TaskDto> localTaskList = mTaskDao.selectAllTaskByOperationId(operationId);
Date lastEditDate;
OperationDataJSON json = AcmsClient.getInstance(ABVDataCache.getInstance().getUrlPath(), ABVEnvironment.getInstance().networkAdapter).getOpereationData(param);
//プログレスを40%進行させるための計算
int progress = 0;
if (json.taskDtoList.size() != 0) {
progress = 40 / json.taskDtoList.size();
}
boolean isRoutineTask = operationDto.reportType == Constant.ReportType.RoutineTask;
for (TaskDto serverTaskDto : json.taskDtoList) {
List<TaskReportDto> localTaskReportList = mTaskReportDao.getTaskReportListByTaskKey(serverTaskDto.taskKey);
for (TaskReportDto localTaskReportDto : localTaskReportList) {
if (!isExistsTaskReportInList(serverTaskDto.taskReportDtoList, localTaskReportDto, isRoutineTask)) {
if (isRoutineTask) {
mOperationLogic.deleteRoutineTaskReport(operationId, operationContentDto.contentId, localTaskReportDto);
} else {
// taskDtoが存在するとtaskReportLevel 0 (作業報告)が存在しないことはないので、報告(回答)のみチェックして削除
if (localTaskReportDto.taskReportLevel != Constant.TaskReportLevel.ReportType) {
// 作業報告のディレクトリ削除
mOperationLogic.deleteTaskFileData(operationId, operationContentDto.contentId, serverTaskDto.taskKey, localTaskReportDto.taskReportLevel);
mTaskReportDao.delete(localTaskReportDto);
}
}
}
}
if (isExistsTaskInList(localTaskList, serverTaskDto)) {
// 作業の報告更新
mTaskDao.update(serverTaskDto);
localTaskList.remove(serverTaskDto);
} else {
// 作業の報告登録
mTaskDao.insert(serverTaskDto);
}
// サーバーからの情報で更新
for (TaskReportDto serverTaskReportDto : serverTaskDto.taskReportDtoList) {
String attachedFileName = serverTaskReportDto.attachedFileName;
TaskReportDto localTaskReportDto;
if (operationDto.reportType == Constant.ReportType.RoutineTask) {
localTaskReportDto = mTaskReportDao.getRoutineTaskReportUtc(serverTaskReportDto.taskKey, serverTaskReportDto.taskReportId, DateTimeUtil.toString(serverTaskReportDto.reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen));
} else {
localTaskReportDto = mTaskReportDao.selectByTaskKey(serverTaskReportDto.taskKey, serverTaskReportDto.taskReportLevel);
}
if (localTaskReportDto != null && localTaskReportDto.localSavedFlg) {
// 一時保存フラグがtrueで定期点検且つ点検後修正不可の場合、添付ファイル(作業報告のディレクトリ)を削除して、localSavedFlgをfalseに変更
if (operationDto.reportType == Constant.ReportType.RoutineTask && operationDto.enableReportUpdate == Constant.EnableReportUpdate.NO) {
// 作業報告のディレクトリ削除
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(operationContentDto.contentId, localTaskReportDto.taskKey));
FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, localTaskReportDto.taskKey, localTaskReportDto.taskReportId, DateTimeUtil.toString_yyyyMMddHHmmss_none(localTaskReportDto.reportStartDate)));
localTaskReportDto.localSavedFlg = false;
} else {
// 一時保存フラグがtureだと何もしない
continue;
}
}
if (operationDto.reportType == Constant.ReportType.RoutineTask) {
serverTaskReportDto.taskKey = serverTaskDto.taskKey;
// 添付ファイルが存在する場合、取得して解凍する。
try {
refreshRoutineTaskFile(operationId, operationContentDto.contentId, serverTaskDto.taskId, serverTaskDto.taskKey, serverTaskReportDto.taskReportId, serverTaskReportDto.taskReportInfoId, serverTaskReportDto.reportStartDate, attachedFileName);
} catch (Exception e) {
Logger.e(TAG, e);
// リソースパターンの適用
errorMsg.append(getString(PatternStringUtil.patternToInt(getApplicationContext(), R.string.msg_error_task_report_receiving_failed, getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO))));
return null;
}
if (localTaskReportDto != null) {
// 報告データが存在すると作業報告を更新する
mOperationLogic.updateRoutineTaskReport(serverTaskDto.operationId, operationContentDto.contentId, serverTaskReportDto, false, false, localTaskReportDto.localSavedFlg);
} else {
mOperationLogic.insertRoutineTaskReport(serverTaskDto.operationId, operationContentDto.contentId, serverTaskReportDto, false, false);
}
} else {
JSONObject taskReportJson = null;
// 添付ファイルが存在する場合、取得して解凍する。
try {
refreshTaskFile(operationId, serverTaskReportDto.taskReportLevel, operationContentDto.contentId, serverTaskDto.taskId, serverTaskDto.taskKey, serverTaskReportDto.attachedFileName, serverTaskDto.processKey, serverTaskDto.phaseNo);
} catch (Exception e) {
Logger.e(TAG, e);
// リソースパターンの適用
errorMsg.append(getString(PatternStringUtil.patternToInt(getApplicationContext(), R.string.msg_error_task_report_receiving_failed, getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, DEFAULT_VALUE_ZERO))));
return null;
}
if (!serverTaskReportDto.jsonData.isEmpty()) {
taskReportJson = new JSONObject(serverTaskReportDto.jsonData);
if (serverTaskReportDto.taskReportLevel == Constant.TaskReportLevel.ReportType) {
taskReportJson.put(ABookKeys.TASK_STATUS, serverTaskDto.taskStatus);
}
}
if (localTaskReportDto == null) {
// 登録
mOperationLogic.insertTaskReport(serverTaskDto.taskKey, operationId, operationContentDto.contentId,
serverTaskReportDto.taskReportLevel, serverTaskReportDto.enableReport,
taskReportJson, attachedFileName, false, false, false, serverTaskDto.processKey, serverTaskDto.phaseNo);
} else {
// 更新
// jsonDataが空で入る場合、taskReportJsonをnullで登録
mOperationLogic.updateTaskReport(serverTaskDto.taskKey, operationId, operationContentDto.contentId,
serverTaskReportDto.taskReportLevel, serverTaskReportDto.enableReport,
taskReportJson, attachedFileName, false, false, localTaskReportDto.localSavedFlg, serverTaskDto.processKey, serverTaskDto.phaseNo);
}
}
}
if (progressCallback != null) {
progressCallback.callback(new Integer(progress));
}
}
// サーバーから取得した作業情報がローカルに存在しないので削除する
for (TaskDto taskDto : localTaskList) {
mOperationLogic.deleteTaskFileData(operationId, operationContentDto.contentId, taskDto.taskKey, Constant.TaskReportLevel.ReportType);
mTaskDao.delete(taskDto);
}
lastEditDate = json.lastEditDate;
if (progressCallback != null) {
progressCallback.callback(new Integer(40));
}
return lastEditDate;
}
/**
* 報告存在チェック
* @param listDto
* @param rDto
* @return
*/
protected boolean isExistsTaskReportInList(List<TaskReportDto> listDto, TaskReportDto rDto, boolean isRoutineTask) {
for (TaskReportDto lDto : listDto) {
if (isRoutineTask) {
// 定期点検の場合、taskKey,taskReportId,reportStartDateで判定
if (lDto.taskKey.equals(rDto.taskKey) &&
lDto.taskReportId == rDto.taskReportId &&
lDto.reportStartDate.equals(rDto.reportStartDate)) {
return true;
}
} else {
// taskKeyと作業報告階層で判定
if (lDto.taskKey.equals(rDto.taskKey) &&
lDto.taskReportLevel == rDto.taskReportLevel) {
return true;
}
}
}
return false;
}
/**
* プッシュメッセージがあるので、チャットルームに遷移する。 * プッシュメッセージがあるので、チャットルームに遷移する。
*/ */
public boolean goChatRoom(final Intent intent, final String targetActivityName, final String baseActivityName) { public boolean goChatRoom(final Intent intent, final String targetActivityName, final String baseActivityName) {
...@@ -1283,20 +1600,20 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -1283,20 +1600,20 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
@Override @Override
public void run() { public void run() {
if (StringUtil.isNullOrEmpty(intent.getStringExtra(AppDefType.ChatPushMessageKey.collaborationType))) { if (StringUtil.isNullOrEmpty(intent.getStringExtra(AppDefType.ChatPushMessageKey.collaborationType))) {
ActivityHandlingHelper.getInstance().startChatWebViewActivity( ActivityHandlingHelper.getInstance().startChatWebViewActivity(
intent.getLongExtra(AppDefType.ChatPushMessageKey.roomId, '0'), intent.getLongExtra(AppDefType.ChatPushMessageKey.roomId, '0'),
intent.getStringExtra(AppDefType.ChatPushMessageKey.roomName), intent.getStringExtra(AppDefType.ChatPushMessageKey.roomName),
targetActivityName, targetActivityName,
baseActivityName); baseActivityName);
} else { } else {
// roomTypeと、collaborationType が存在する場合は、協業を開始する。 // roomTypeと、collaborationType が存在する場合は、協業を開始する。
ActivityHandlingHelper.getInstance().startChatWebViewActivityWithCollaboration( ActivityHandlingHelper.getInstance().startChatWebViewActivityWithCollaboration(
intent.getLongExtra(AppDefType.ChatPushMessageKey.roomId, '0'), intent.getLongExtra(AppDefType.ChatPushMessageKey.roomId, '0'),
intent.getStringExtra(AppDefType.ChatPushMessageKey.roomName), intent.getStringExtra(AppDefType.ChatPushMessageKey.roomName),
intent.getStringExtra(AppDefType.ChatPushMessageKey.collaborationType), intent.getStringExtra(AppDefType.ChatPushMessageKey.collaborationType),
intent.getStringExtra(AppDefType.ChatPushMessageKey.roomType), intent.getStringExtra(AppDefType.ChatPushMessageKey.roomType),
targetActivityName, targetActivityName,
baseActivityName); baseActivityName);
} }
} }
}, 500); }, 500);
...@@ -1307,6 +1624,96 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -1307,6 +1624,96 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
} }
/** /**
* listDtoの中に第2引数のdtoが存在するかチェックメソッド
* @param listDto リストDto
* @param dto ターゲットDto
* @return
*/
protected boolean isExistsTaskInList(List<TaskDto> listDto, TaskDto dto) {
for (TaskDto lDto : listDto) {
if (lDto.taskKey.equals(dto.taskKey)) {
return true;
}
}
return false;
}
/**
* 定期点検用ファイル更新
* @param operationId
* @param contentId
* @param taskId
* @param taskKey
* @param taskReportId
* @param reportStartDate
* @param reportAttachedFileName
* @throws ABVException
* @throws InterruptedException
* @throws ZipException
* @throws NoSuchAlgorithmException
* @throws IOException
*/
public void refreshRoutineTaskFile(final long operationId, final long contentId, final long taskId, final String taskKey, final int taskReportId, final int taskReportInfoId, final Date reportStartDate, final String reportAttachedFileName) throws Exception {
String reportStartDateHypn = DateTimeUtil.toString(reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen);
final String reportStartDateNone = DateTimeUtil.toString_yyyyMMddHHmmss_none(reportStartDate);
// 既存の添付ディレクトリ削除
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey));
String reportLocalAttachedFileName = mTaskReportDao.getRoutineTaskReportAttachedFileName(taskKey, taskReportId, reportStartDateHypn);
boolean getReportFileFlg = !StringUtil.isNullOrEmpty(reportAttachedFileName) && !reportAttachedFileName.equals(reportLocalAttachedFileName);
if (getReportFileFlg) {
Logger.i(TAG, "[Get Task Report Files] operationId=%s, taskKey=%s, taskId=%s, attachedFileName=%s", operationId, taskKey, taskId, reportAttachedFileName);
// #32926 start
int taskReportLevel = 0;
FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, taskKey, taskReportId, reportStartDateNone));
// #32926 end
String outputFilePath = mOperationLogic.getRoutineTaskReportFile(operationId, taskKey, taskId, taskReportId, taskReportInfoId, reportStartDateNone, reportAttachedFileName);
// #32926 start
ContentFileExtractor.getInstance().extractZipFile(contentId, outputFilePath,
ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, taskKey, taskReportId, reportStartDateNone), null, true);
// #32926 end
}
}
/**
* 添付ファイルが存在する場合、取得して解凍する。
* @param operationId
* @param taskReportLevel
* @param contentId
* @param taskId
* @param taskKey
* @param attachedFileName
* @param processKey 固定キー
* @param phaseNo 固定NO
* @throws ABVException
* @throws InterruptedException
* @throws ZipException
* @throws NoSuchAlgorithmException
* @throws IOException
*/
protected void refreshTaskFile(final long operationId, final int taskReportLevel, long contentId,
final long taskId, final String taskKey, final String attachedFileName,
final String processKey, final Integer phaseNo) throws Exception {
// 既存の添付ディレクトリ削除
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey));
String reportLocalAttachedFileName = mTaskReportDao.getTaskReportAttachedFileName(taskKey, taskReportLevel);
if (attachedFileName != null && !attachedFileName.equals(reportLocalAttachedFileName)) {
Logger.i(TAG, "[Get Task Report Files] operationId=%s, taskKey=%s, taskId=%s, attachedFileName=%s", operationId, taskKey, taskId, attachedFileName);
// #32926 start
String saveAttacedFilePath = ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, taskReportLevel);
if (processKey != null && phaseNo != 0) {
saveAttacedFilePath = ABVEnvironment.getInstance().getOperationDirectionOrContinuousReportDirPath(operationId, taskKey, taskReportLevel, processKey, phaseNo);
}
FileUtil.delete(saveAttacedFilePath);
// #32926 end
String outputFilePath = mOperationLogic.getTaskFile(operationId, taskKey, taskId, attachedFileName, taskReportLevel);
ContentFileExtractor.getInstance().extractZipFile(contentId, outputFilePath, saveAttacedFilePath,null, true);
}
}
/**
* プッシュメッセージ受信後のダイアログを表示する。 * プッシュメッセージ受信後のダイアログを表示する。
* @param context コンテキスト * @param context コンテキスト
* @param messageMap プッシュメッセージ * @param messageMap プッシュメッセージ
......
...@@ -100,46 +100,46 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -100,46 +100,46 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
protected String contentType; protected String contentType;
protected ABVPopupListWindow mShowedPopupWindow = null; protected ABVPopupListWindow mShowedPopupWindow = null;
protected int readingLogId; protected int readingLogId;
protected String path; // PanoViewController protected String path; // PanoViewController
protected boolean readingLogFlg = true; // HTMLWebViewActivity,PreviewActivityがPDFのアクションとして呼び出されることがあるので、その場合ログは記録しない protected boolean readingLogFlg = true; // HTMLWebViewActivity,PreviewActivityがPDFのアクションとして呼び出されることがあるので、その場合ログは記録しない
protected ImageButton subMenuBtn; protected ImageButton subMenuBtn;
protected ImageButton exitMeetingBtn; protected ImageButton exitMeetingBtn;
protected ConcurrentHashMap<Long, Object> objectIdPopupMap = new ConcurrentHashMap<>(); protected ConcurrentHashMap<Long, Object> objectIdPopupMap = new ConcurrentHashMap<>();
protected int mCurrentPageNumber = 0; // 表示中のページ番号(0からスタート) protected int mCurrentPageNumber = 0; // 表示中のページ番号(0からスタート)
public Long mOperationId; public Long mOperationId;
protected int mXWalkOpenType = -1; protected int mXWalkOpenType = -1;
protected int mOperationType; protected int mOperationType;
private int mReportType; private int mReportType;
protected int mEnableReportHistory; //0:履歴無し 1:履歴可 protected int mEnableReportHistory; //0:履歴無し 1:履歴可
// 報告可能区分 // 報告可能区分
protected int mEnableReportEdit; //0:報告無し 1:報告可 protected int mEnableReportEdit; //0:報告無し 1:報告可
protected String mContentPath; protected String mContentPath;
protected int mStatusCode; protected int mStatusCode;
protected boolean isOperationPdf = false; protected boolean isOperationPdf = false;
protected OperationDto operationDto = null; protected OperationDto operationDto = null;
protected String linkUrl; protected String linkUrl;
private String mReportFileName; private String mReportFileName;
protected TextView operationNameTitle; protected TextView operationNameTitle;
protected ImageButton operationHomeButton; protected ImageButton operationHomeButton;
protected ImageButton taskListButton; protected ImageButton taskListButton;
protected ImageButton quickReportPrintButton; protected ImageButton quickReportPrintButton;
// protected ImageButton helpButton; // protected ImageButton helpButton;
protected boolean isPageFinished; protected boolean isPageFinished;
protected Double latitude; protected Double latitude;
protected Double longitude; protected Double longitude;
protected String mCmd; protected String mCmd;
protected String mTaskKey; protected String mTaskKey;
protected String mAttachedFileName; protected String mAttachedFileName;
protected File mLocalFile; protected File mLocalFile;
public boolean isLinkedContent; public boolean isLinkedContent;
public int pageNo; public int pageNo;
public int mButtonStatus; // 保存ボタンチェック public int mButtonStatus; // 保存ボタンチェック
protected boolean mAddReport; // 作業追加区分 protected boolean mAddReport; // 作業追加区分
// 編集 // 編集
...@@ -154,68 +154,68 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -154,68 +154,68 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
Intent intent = getIntent(); Intent intent = getIntent();
contentId = intent.getLongExtra(ABookKeys.CONTENT_ID, 0); contentId = intent.getLongExtra(ABookKeys.CONTENT_ID, 0);
contentType = intent.getStringExtra(ABookKeys.CONTENT_TYPE); contentType = intent.getStringExtra(ABookKeys.CONTENT_TYPE);
objectId = intent.getLongExtra("objectId", -1); objectId = intent.getLongExtra("objectId", -1);
objectPageNumber = intent.getIntExtra("pageNumber", -1); objectPageNumber = intent.getIntExtra("pageNumber", -1);
readingLogId = intent.getIntExtra("readingLogId", -1); readingLogId = intent.getIntExtra("readingLogId", -1);
path = intent.getStringExtra("path"); path = intent.getStringExtra("path");
isLinkedContent = intent.getBooleanExtra("isLinkedContent", false); isLinkedContent = intent.getBooleanExtra("isLinkedContent", false);
mOperationId = intent.getLongExtra(ABookKeys.OPERATION_ID, -1); mOperationId = intent.getLongExtra(ABookKeys.OPERATION_ID, -1);
// 戻り先のActivity名を保存しておく // 戻り先のActivity名を保存しておく
baseActivityName = getIntent().getStringExtra(AppDefType.ChatPushMessageKey.baseActivityName); baseActivityName = getIntent().getStringExtra(AppDefType.ChatPushMessageKey.baseActivityName);
if (!isLinkedContent) { if (!isLinkedContent) {
operationDto = AbstractLogic.getLogic(OperationLogic.class).getOperation(mOperationId); operationDto = AbstractLogic.getLogic(OperationLogic.class).getOperation(mOperationId);
mXWalkOpenType = intent.getIntExtra(Constant.ABookCheck.XWALK_OPEN_TYPE, Constant.XWalkOpenType.DEFAULT); mXWalkOpenType = intent.getIntExtra(Constant.ABookCheck.XWALK_OPEN_TYPE, Constant.XWalkOpenType.DEFAULT);
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT || mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) { if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT || mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) {
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) { if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
mOperationType = operationDto.operationType; mOperationType = operationDto.operationType;
mReportType = operationDto.reportType; mReportType = operationDto.reportType;
if (mOperationType != OperationType.PDF && isNormalSize()) { if (mOperationType != OperationType.PDF && isNormalSize()) {
// 縦画面固定 // 縦画面固定
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
} }
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
// 添付ファイル表示のため、キャッシュディレクトリにコピーする // 添付ファイル表示のため、キャッシュディレクトリにコピーする
ABookCheckWebViewHelper.getInstance().allCopyTaskAttachedMovieFileToCache(mOperationId, getContentId(), operationDto); ABookCheckWebViewHelper.getInstance().allCopyTaskAttachedMovieFileToCache(mOperationId, getContentId(), operationDto);
} }
}).start(); }).start();
mStatusCode = 0; mStatusCode = 0;
} }
mEnableReportEdit = operationDto.enableReportEdit; mEnableReportEdit = operationDto.enableReportEdit;
mEnableReportHistory = operationDto.enableReportHistory; mEnableReportHistory = operationDto.enableReportHistory;
linkUrl = intent.getStringExtra("LINKURL"); // LinkURL linkUrl = intent.getStringExtra("LINKURL"); // LinkURL
if (operationDto != null && operationDto.operationType == OperationType.PDF) { if (operationDto != null && operationDto.operationType == OperationType.PDF) {
isOperationPdf = true; isOperationPdf = true;
} }
} }
} }
// 遠隔連動 // 遠隔連動
meetingManager = MeetingManager.getInstance(); meetingManager = MeetingManager.getInstance();
isCollaboration = meetingManager.isCollaboration(); isCollaboration = meetingManager.isCollaboration();
mContentDir = getIntent().getStringExtra(FILEPATH); mContentDir = getIntent().getStringExtra(FILEPATH);
// Activity登録 // Activity登録
if (objectId == -1) { if (objectId == -1) {
ActivityHandlingHelper.getInstance().setContentViewActivity(this); ActivityHandlingHelper.getInstance().setContentViewActivity(this);
ContentDto dto = contentDao.getContent(contentId); ContentDto dto = contentDao.getContent(contentId);
if (dto != null) { if (dto != null) {
// 閲覧履歴保存 // 閲覧履歴保存
contentDao.updateContentReadingDate(DateTimeUtil.getCurrentTimestamp(), getContentId()); contentDao.updateContentReadingDate(DateTimeUtil.getCurrentTimestamp(), getContentId());
} }
} else { } else {
ActivityHandlingHelper.getInstance().setObjectViewActivity(this); ActivityHandlingHelper.getInstance().setObjectViewActivity(this);
} }
contentDownloader.pauseAll(); contentDownloader.pauseAll();
showUpdateContentAlert(contentId); showUpdateContentAlert(contentId);
...@@ -233,7 +233,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -233,7 +233,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
confirmDialog.setMessage(R.string.msg_content_to_be_updated); confirmDialog.setMessage(R.string.msg_content_to_be_updated);
confirmDialog.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { confirmDialog.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int whichButton) { public void onClick(DialogInterface dialog, int whichButton) {
confirmDialog.dismiss(); confirmDialog.dismiss();
} }
}); });
...@@ -246,11 +246,11 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -246,11 +246,11 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
@Override @Override
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
try { try {
if (readingLogFlg) { if (readingLogFlg) {
readingLogId = ContentLogUtil.getInstance().startContentReadLog(this, contentId, getABVUIDataCache().getPermissionAccessLocation()); readingLogId = ContentLogUtil.getInstance().startContentReadLog(this, contentId, getABVUIDataCache().getPermissionAccessLocation());
} }
} catch (Exception e) { } catch (Exception e) {
Logger.e("Exception", e); Logger.e("Exception", e);
handleErrorMessageToast(ErrorCode.E107); handleErrorMessageToast(ErrorCode.E107);
...@@ -271,27 +271,27 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -271,27 +271,27 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
} }
@Override @Override
protected void onStart() { protected void onStart() {
super.onStart(); super.onStart();
} }
@Override @Override
protected void onPause() { protected void onPause() {
super.onPause(); super.onPause();
} }
@Override @Override
protected void onStop() { protected void onStop() {
super.onStop(); super.onStop();
if (!DeviceInfo.isForegrdound(getApplicationContext()) && readingLogFlg) { if (!DeviceInfo.isForegrdound(getApplicationContext()) && readingLogFlg) {
ContentReadingLogLogic logic = AbstractLogic.getLogic(ContentReadingLogLogic.class); ContentReadingLogLogic logic = AbstractLogic.getLogic(ContentReadingLogLogic.class);
logic.pauseContentReadLog(contentId); logic.pauseContentReadLog(contentId);
} }
} }
@Override @Override
protected void onDestroy() { protected void onDestroy() {
Logger.d(TAG, "onDestroy"); Logger.d(TAG, "onDestroy");
if (readingLogFlg) { if (readingLogFlg) {
ContentReadingLogLogic logic = AbstractLogic.getLogic(ContentReadingLogLogic.class); ContentReadingLogLogic logic = AbstractLogic.getLogic(ContentReadingLogLogic.class);
...@@ -304,14 +304,14 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -304,14 +304,14 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
meetingManager.sendWs(MeetingManager.CMD_CLOSEPOPUP, contentId, objectPageNumber, objectId, null); meetingManager.sendWs(MeetingManager.CMD_CLOSEPOPUP, contentId, objectPageNumber, objectId, null);
} }
if (meetingManager.isSubscribed()) { if (meetingManager.isSubscribed()) {
ActivityHandlingHelper.getInstance().refreshMeetingListActivity(); ActivityHandlingHelper.getInstance().refreshMeetingListActivity();
} }
if (objectId == -1) { if (objectId == -1) {
ActivityHandlingHelper.getInstance().removeContentViewActivity(this); ActivityHandlingHelper.getInstance().removeContentViewActivity(this);
} else { } else {
ActivityHandlingHelper.getInstance().removeObjectViewActivity(this); ActivityHandlingHelper.getInstance().removeObjectViewActivity(this);
} }
//キャッシュを使用しない場合、ディレクトリが残っていれば削除 //キャッシュを使用しない場合、ディレクトリが残っていれば削除
if (!getRBoolean(R.bool.use_cache) && objectId == -1) { if (!getRBoolean(R.bool.use_cache) && objectId == -1) {
...@@ -331,11 +331,11 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -331,11 +331,11 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
} }
protected boolean isCursorModeEnable() { protected boolean isCursorModeEnable() {
if (isOperationPdf()) { if (isOperationPdf()) {
return false; return false;
} else { } else {
return PreferenceUtil.get(this, DefPrefKey.CURSOR_ENABLE, false); return PreferenceUtil.get(this, DefPrefKey.CURSOR_ENABLE, false);
} }
} }
protected void initError() { protected void initError() {
...@@ -365,7 +365,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -365,7 +365,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
alert.setView(layout); alert.setView(layout);
alert.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { alert.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int whichButton) { public void onClick(DialogInterface dialog, int whichButton) {
dialog.dismiss(); dialog.dismiss();
} }
}); });
...@@ -374,7 +374,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -374,7 +374,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
// 指定ページへのジャンプ // 指定ページへのジャンプ
@Override @Override
public void startContentViewActivity(long contentId, int pageNum) { public void startContentViewActivity(long contentId, int pageNum) {
Logger.d(TAG, "startContentViewActivity:%s, pageNum=%s", contentId, pageNum); Logger.d(TAG, "startContentViewActivity:%s, pageNum=%s", contentId, pageNum);
releaseInit(); releaseInit();
Intent intent = new Intent(); Intent intent = new Intent();
...@@ -444,15 +444,15 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -444,15 +444,15 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
} }
@Override @Override
public void finish() { public void finish() {
// ホームをリロードさせる // ホームをリロードさせる
ActivityHandlingHelper.getInstance().setRequireHomeReload(true); ActivityHandlingHelper.getInstance().setRequireHomeReload(true);
super.finish(); super.finish();
Logger.d(TAG, "finish"); Logger.d(TAG, "finish");
} }
protected void commonConfigureRemote() { protected void commonConfigureRemote() {
} }
public void configureRemote() { public void configureRemote() {
} }
...@@ -475,8 +475,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -475,8 +475,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
// if (helpButton != null && helpButton.getVisibility() == View.VISIBLE) { // if (helpButton != null && helpButton.getVisibility() == View.VISIBLE) {
// helpButton.setLayoutParams(params); // helpButton.setLayoutParams(params);
// } // }
} }
else { // 会議室退室ボタン非表示 else { // 会議室退室ボタン非表示
if (exitMeetingBtn != null) { if (exitMeetingBtn != null) {
...@@ -487,9 +487,9 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -487,9 +487,9 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
params.rightMargin = (int) (getResources().getDisplayMetrics().density * 5); params.rightMargin = (int) (getResources().getDisplayMetrics().density * 5);
subMenuBtn.setLayoutParams(params); subMenuBtn.setLayoutParams(params);
} }
// if (helpButton != null && helpButton.getVisibility() == View.VISIBLE) { // if (helpButton != null && helpButton.getVisibility() == View.VISIBLE) {
// helpButton.setLayoutParams(params); // helpButton.setLayoutParams(params);
// } // }
} }
} }
}); });
...@@ -505,22 +505,22 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -505,22 +505,22 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
} }
alert.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() { alert.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int whichButton) { public void onClick(DialogInterface dialog, int whichButton) {
// 遠隔連動中に保存したマーキングファイルを削除 // 遠隔連動中に保存したマーキングファイルを削除
ContentMarkingFileHelper contentMarkingFileHelper = new ContentMarkingFileHelper(); ContentMarkingFileHelper contentMarkingFileHelper = new ContentMarkingFileHelper();
contentMarkingFileHelper.deleteRemoteMarkingFile(contentId); contentMarkingFileHelper.deleteRemoteMarkingFile(contentId);
setMeetingEnteredFlg(); setMeetingEnteredFlg();
if (meetingManager.isOwner()) { if (meetingManager.isOwner()) {
try { try {
meetingManager.deleteMeeting(); meetingManager.deleteMeeting();
} catch (Exception e) { } catch (Exception e) {
Logger.e(TAG, "showMeetingExitDialog deleteMeeting error", e); Logger.e(TAG, "showMeetingExitDialog deleteMeeting error", e);
ABVToastUtil.showMakeText(ABVContentViewActivity.this, getString(R.string.E126), Toast.LENGTH_SHORT); ABVToastUtil.showMakeText(ABVContentViewActivity.this, getString(R.string.E126), Toast.LENGTH_SHORT);
} }
} }
//会議室に参加する前のonCloseと識別するため //会議室に参加する前のonCloseと識別するため
meetingManager.close(); meetingManager.close();
configureRemote(); configureRemote();
ActivityHandlingHelper handlingHelper = ActivityHandlingHelper.getInstance(); ActivityHandlingHelper handlingHelper = ActivityHandlingHelper.getInstance();
...@@ -530,7 +530,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -530,7 +530,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}); });
alert.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() { alert.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int whichButton) { public void onClick(DialogInterface dialog, int whichButton) {
dialog.cancel(); dialog.cancel();
} }
}); });
...@@ -569,22 +569,22 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -569,22 +569,22 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
if (textView == null) { if (textView == null) {
return; return;
} }
textView.setVisibility(View.GONE); textView.setVisibility(View.GONE);
if (isVisible && !isCollaboration) { if (isVisible && !isCollaboration) {
if (meetingManager.isConnected() && meetingManager.isOwner()) { if (meetingManager.isConnected() && meetingManager.isOwner()) {
textView.setVisibility(View.VISIBLE); textView.setVisibility(View.VISIBLE);
CommonExecutor.execute(new Runnable() { CommonExecutor.execute(new Runnable() {
@Override @Override
public void run() { public void run() {
final int count = meetingManager.getParticipantCount(); final int count = meetingManager.getParticipantCount();
handler.post(new Runnable() { handler.post(new Runnable() {
@Override @Override
public void run() { public void run() {
textView.setText(getRString(R.string.meeting_participant_count) + ":" + count); textView.setText(getRString(R.string.meeting_participant_count) + ":" + count);
} }
}); });
} }
}); });
} }
} }
...@@ -609,14 +609,14 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -609,14 +609,14 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
} }
} }
public int getCurrentPageNumber() { public int getCurrentPageNumber() {
return mCurrentPageNumber; return mCurrentPageNumber;
} }
/** /**
* 戻る用コンテンツIDリストをリセット * 戻る用コンテンツIDリストをリセット
*/ */
public void resetReturnContentIdList () { public void resetReturnContentIdList () {
getABVUIDataCache().resetReturnContentIdList(); getABVUIDataCache().resetReturnContentIdList();
} }
...@@ -630,25 +630,25 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -630,25 +630,25 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
/** /**
* コンテンツビューから戻るボタンタップ時の処理 * コンテンツビューから戻るボタンタップ時の処理
*/ */
public void moveToBack() { public void moveToBack() {
//戻る用コンテンツIDの数 //戻る用コンテンツIDの数
int listSize = getReturnContentIdList().size(); int listSize = getReturnContentIdList().size();
if (listSize == 0) { if (listSize == 0) {
finish(); finish();
} else { } else {
long[] contentInfo = getReturnContentIdList().get(listSize - 1); long[] contentInfo = getReturnContentIdList().get(listSize - 1);
// 直前のコンテンツが360コンテンツか確認⇒画面遷移ではなくfinish()で廃棄することで戻る // 直前のコンテンツが360コンテンツか確認⇒画面遷移ではなくfinish()で廃棄することで戻る
if (ActivityHandlingHelper.getInstance().hasPreviousPanoContentId(contentInfo[0])) { if (ActivityHandlingHelper.getInstance().hasPreviousPanoContentId(contentInfo[0])) {
finish(); finish();
} else { } else {
ActivityHandlingHelper.getInstance().startContentActivity(contentInfo[0], (int) contentInfo[1]); ActivityHandlingHelper.getInstance().startContentActivity(contentInfo[0], (int) contentInfo[1]);
} }
if (this instanceof HTMLXWalkWebViewActivity) { if (this instanceof HTMLXWalkWebViewActivity) {
return; return;
} }
getReturnContentIdList().remove(listSize - 1); getReturnContentIdList().remove(listSize - 1);
} }
} }
/** /**
* コンテンツビューから戻るボタンタップ時の処理(ABookCheck専用) * コンテンツビューから戻るボタンタップ時の処理(ABookCheck専用)
...@@ -658,29 +658,29 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -658,29 +658,29 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
finish(); finish();
} }
protected void createCheckToolbar() { protected void createCheckToolbar() {
final RelativeLayout fl; final RelativeLayout fl;
if (operationDto != null && operationDto.operationType == OperationType.PDF && mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) { if (operationDto != null && operationDto.operationType == OperationType.PDF && mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
fl = (RelativeLayout) findViewById(R.id.RelativeLayout2); fl = (RelativeLayout) findViewById(R.id.RelativeLayout2);
} else { } else {
fl = (RelativeLayout) findViewById(R.id.frameTopbar); fl = (RelativeLayout) findViewById(R.id.frameTopbar);
} }
fl.setBackgroundColor(getResources().getColor(R.color.operation_color)); fl.setBackgroundColor(getResources().getColor(R.color.operation_color));
operationHomeButton = (ImageButton) findViewById(R.id.btn_operation_home); operationHomeButton = (ImageButton) findViewById(R.id.btn_operation_home);
quickReportPrintButton = (ImageButton) findViewById(R.id.btn_operation_print); quickReportPrintButton = (ImageButton) findViewById(R.id.btn_operation_print);
operationHomeButton.setOnClickListener(new View.OnClickListener() { operationHomeButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
if (mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) { if (mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) {
showConfirmSavePanoEdit(); showConfirmSavePanoEdit();
} else { } else {
// 作業終了する時、作業ID設定して作業一覧で使用するメソットを行う。 // 作業終了する時、作業ID設定して作業一覧で使用するメソットを行う。
putUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, mOperationId); putUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, mOperationId);
finishActivity(); // 開いてる画面を閉じる finishActivity(); // 開いてる画面を閉じる
} }
} }
}); });
operationHomeButton.setVisibility(View.VISIBLE); operationHomeButton.setVisibility(View.VISIBLE);
if(operationDto != null && operationDto.operationType == OperationType.PDF){ if(operationDto != null && operationDto.operationType == OperationType.PDF){
// 簡易帳票印刷ボタン // 簡易帳票印刷ボタン
...@@ -701,58 +701,58 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -701,58 +701,58 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
} }
} }
taskListButton = (ImageButton) findViewById(R.id.btn_show_task_list); taskListButton = (ImageButton) findViewById(R.id.btn_show_task_list);
taskListButton.setOnClickListener(new View.OnClickListener() { taskListButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
// 作業一覧表示 // 作業一覧表示
showTaskList(); showTaskList();
} }
}); });
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT || mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) { if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT || mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) {
if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) { if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
if (mOperationType != OperationType.PDF && isNormalSize()) { if (mOperationType != OperationType.PDF && isNormalSize()) {
// 縦画面固定 // 縦画面固定
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
} }
mOperationType = operationDto.operationType; mOperationType = operationDto.operationType;
String cacheDirPath = ABVEnvironment.getInstance().getContentCacheDirectoryPath(getContentId()); String cacheDirPath = ABVEnvironment.getInstance().getContentCacheDirectoryPath(getContentId());
if (operationDto.operationType == OperationType.LIST) { if (operationDto.operationType == OperationType.LIST) {
mContentPath = ABVEnvironment.getInstance().getTaskListDirName(cacheDirPath); mContentPath = ABVEnvironment.getInstance().getTaskListDirName(cacheDirPath);
if (operationDto.reportType == Constant.ReportType.ReportContinuous) { if (operationDto.reportType == Constant.ReportType.ReportContinuous) {
mContentPath = ABVEnvironment.getInstance().getProcessListDirName(cacheDirPath); mContentPath = ABVEnvironment.getInstance().getProcessListDirName(cacheDirPath);
} }
} else if (operationDto.operationType == OperationType.PDF) { } else if (operationDto.operationType == OperationType.PDF) {
mContentPath = ABVEnvironment.getInstance().getTaskPdfDirName(cacheDirPath); mContentPath = ABVEnvironment.getInstance().getTaskPdfDirName(cacheDirPath);
} else { } else {
mContentPath = ABVEnvironment.getInstance().getPanoImageDirName(cacheDirPath); mContentPath = ABVEnvironment.getInstance().getPanoImageDirName(cacheDirPath);
} }
mStatusCode = 0; mStatusCode = 0;
} }
operationNameTitle = (TextView) findViewById(R.id.title); operationNameTitle = (TextView) findViewById(R.id.title);
operationNameTitle.setText(operationDto.operationName); operationNameTitle.setText(operationDto.operationName);
if (isNormalSize()) { if (isNormalSize()) {
operationNameTitle.setWidth(getRDimensionSize(R.dimen.operation_title_normal_width)); operationNameTitle.setWidth(getRDimensionSize(R.dimen.operation_title_normal_width));
} else { } else {
operationNameTitle.setWidth(getRDimensionSize(R.dimen.operation_title_large_width)); operationNameTitle.setWidth(getRDimensionSize(R.dimen.operation_title_large_width));
} }
operationNameTitle.setVisibility(View.VISIBLE); operationNameTitle.setVisibility(View.VISIBLE);
} }
} }
/** /**
* 簡易帳票印刷対象選択画面表示 * 簡易帳票印刷対象選択画面表示
*/ */
private void showPrintTargetSelect(OperationDto operationDto) { private void showPrintTargetSelect(OperationDto operationDto) {
Intent intent = new Intent(); Intent intent = new Intent();
intent.setClass(ABVContentViewActivity.this, OnlineHTMLWebViewActivity.class); intent.setClass(ABVContentViewActivity.this, OnlineHTMLWebViewActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
intent.putExtra("LINKURL", AcmsApis.getApiUrl(ABVEnvironment.getInstance().acmsAddress, ABVDataCache.getInstance().getUrlPath(), AcmsApis.ApiQuickReportRevision) + "?isNative=1"); intent.putExtra("LINKURL", AcmsApis.getApiUrl(ABVEnvironment.getInstance().acmsAddress, ABVDataCache.getInstance().getUrlPath(), AcmsApis.ApiQuickReportRevision) + "?isNative=1");
intent.putExtra("operationId", mOperationId); intent.putExtra("operationId", mOperationId);
startActivity(intent, NaviConsts.Right); startActivity(intent, NaviConsts.Right);
} }
/** /**
...@@ -808,124 +808,124 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -808,124 +808,124 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
protected void finishActivity() {} protected void finishActivity() {}
protected void webViewLoadUrl(String url){} protected void webViewLoadUrl(String url){}
public void onClickOperationHome(View v) { public void onClickOperationHome(View v) {
if (mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) { if (mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) {
// リソースパターンの適用 // リソースパターンの適用
ABookAlertDialog alertDialog = AlertDialogUtil.createAlertDialog(ABVContentViewActivity.this, PatternStringUtil.patternToString(getApplicationContext(), ABookAlertDialog alertDialog = AlertDialogUtil.createAlertDialog(ABVContentViewActivity.this, PatternStringUtil.patternToString(getApplicationContext(),
R.string.pano_edit, R.string.pano_edit,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
// リソースパターンの適用 // リソースパターンの適用
alertDialog.setMessage(PatternStringUtil.patternToString(getApplicationContext(), alertDialog.setMessage(PatternStringUtil.patternToString(getApplicationContext(),
R.string.msg_confirm_save_pano_edit, R.string.msg_confirm_save_pano_edit,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
alertDialog.setNegativeButton(R.string.cancel, null); alertDialog.setNegativeButton(R.string.cancel, null);
alertDialog.setPositiveButton(R.string.ok, alertDialog.setPositiveButton(R.string.ok,
new DialogInterface.OnClickListener() { new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
callUnloadAuth(); callUnloadAuth();
dialog.dismiss(); dialog.dismiss();
finish(); finish();
} }
}); });
alertDialog.show(); alertDialog.show();
} else { } else {
// 作業終了する時、作業ID設定して作業一覧で使用するメソットを行う。 // 作業終了する時、作業ID設定して作業一覧で使用するメソットを行う。
putUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, mOperationId); // 作業IDの設定 putUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, mOperationId); // 作業IDの設定
finishActivity(); // 開いてる画面を閉じる finishActivity(); // 開いてる画面を閉じる
} }
} }
/** /**
* Be override * Be override
*/ */
protected void onActionOperationPdfWebView(Map<String, String> checkParam, OperationTaskDto operationTaskDto) {} protected void onActionOperationPdfWebView(Map<String, String> checkParam, OperationTaskDto operationTaskDto) {}
// public void onClickShowHelpView(View v) { // public void onClickShowHelpView(View v) {
// int helpViewType = 0; // int helpViewType = 0;
// switch (mStatusCode) { // switch (mStatusCode) {
// case Constant.XWalkWebViewDisplayStatus.InitView: // case Constant.XWalkWebViewDisplayStatus.InitView:
// if (mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) { // if (mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) {
// helpViewType = Constant.HelpViewType.PanoContentEdit; // helpViewType = Constant.HelpViewType.PanoContentEdit;
// } else { // } else {
// switch (mOperationType) { // switch (mOperationType) {
// case OperationType.LIST: // case OperationType.LIST:
// switch (mXWalkOpenType) { // switch (mXWalkOpenType) {
// case Constant.XWalkOpenType.TASK_DERECTION: // case Constant.XWalkOpenType.TASK_DERECTION:
// helpViewType = Constant.HelpViewType.ListOperationDirector; // helpViewType = Constant.HelpViewType.ListOperationDirector;
// break; // break;
// case Constant.XWalkOpenType.TASK_REPORT: // case Constant.XWalkOpenType.TASK_REPORT:
// if (operationDto.reportType == Constant.ReportType.RoutineTask) { // if (operationDto.reportType == Constant.ReportType.RoutineTask) {
// helpViewType = Constant.HelpViewType.RoutineTaskOperation; // helpViewType = Constant.HelpViewType.RoutineTaskOperation;
// } else { // } else {
// helpViewType = Constant.HelpViewType.ListOperationReporter; // helpViewType = Constant.HelpViewType.ListOperationReporter;
// } // }
// break; // break;
// } // }
// break; // break;
// case OperationType.DRAWING: // case OperationType.DRAWING:
// case OperationType.PDF: // case OperationType.PDF:
// switch (mXWalkOpenType) { // switch (mXWalkOpenType) {
// case Constant.XWalkOpenType.TASK_DERECTION: // case Constant.XWalkOpenType.TASK_DERECTION:
// helpViewType = Constant.HelpViewType.DrawingOperationDirector; // helpViewType = Constant.HelpViewType.DrawingOperationDirector;
// break; // break;
// case Constant.XWalkOpenType.TASK_REPORT: // case Constant.XWalkOpenType.TASK_REPORT:
// helpViewType = Constant.HelpViewType.DrawingOperationReporter; // helpViewType = Constant.HelpViewType.DrawingOperationReporter;
// break; // break;
// } // }
// break; // break;
// case OperationType.PANO: // case OperationType.PANO:
// switch (mXWalkOpenType) { // switch (mXWalkOpenType) {
// case Constant.XWalkOpenType.TASK_DERECTION: // case Constant.XWalkOpenType.TASK_DERECTION:
// helpViewType = Constant.HelpViewType.PanoOperationDirector; // helpViewType = Constant.HelpViewType.PanoOperationDirector;
// break; // break;
// case Constant.XWalkOpenType.TASK_REPORT: // case Constant.XWalkOpenType.TASK_REPORT:
// helpViewType = Constant.HelpViewType.PanoOperationReporter; // helpViewType = Constant.HelpViewType.PanoOperationReporter;
// break; // break;
// } // }
// //
// break; // break;
// } // }
// } // }
// break; // break;
// case Constant.XWalkWebViewDisplayStatus.TaskView: // case Constant.XWalkWebViewDisplayStatus.TaskView:
// if (mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION) { // if (mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION) {
// helpViewType = Constant.HelpViewType.DirectorTask; // helpViewType = Constant.HelpViewType.DirectorTask;
// } else if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) { // } else if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
// if (operationDto.reportType == Constant.ReportType.RoutineTask) { // if (operationDto.reportType == Constant.ReportType.RoutineTask) {
// helpViewType = Constant.HelpViewType.RoutineTaskOperationReport; // helpViewType = Constant.HelpViewType.RoutineTaskOperationReport;
// } else { // } else {
// helpViewType = Constant.HelpViewType.ReportTask; // helpViewType = Constant.HelpViewType.ReportTask;
// } // }
// } // }
// break; // break;
// case Constant.XWalkWebViewDisplayStatus.ReportPreView: // case Constant.XWalkWebViewDisplayStatus.ReportPreView:
// helpViewType = Constant.HelpViewType.ReportPreview; // helpViewType = Constant.HelpViewType.ReportPreview;
// break; // break;
// case Constant.XWalkWebViewDisplayStatus.TaskListView: // case Constant.XWalkWebViewDisplayStatus.TaskListView:
// if (mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION) { // if (mXWalkOpenType == Constant.XWalkOpenType.TASK_DERECTION) {
// helpViewType = Constant.HelpViewType.DirectorTaskList; // helpViewType = Constant.HelpViewType.DirectorTaskList;
// } else if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) { // } else if (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) {
// helpViewType = Constant.HelpViewType.ReportTaskList; // helpViewType = Constant.HelpViewType.ReportTaskList;
// } // }
// break; // break;
// } // }
// //
// showHelpViewDialog(helpViewType); // showHelpViewDialog(helpViewType);
// } // }
public void commonShouldOverrideUrlLoading (Uri uri, OperationTaskDto operationTaskDto) { public void commonShouldOverrideUrlLoading (Uri uri, OperationTaskDto operationTaskDto) {
Logger.d(TAG, "Uri : %s", uri); Logger.d(TAG, "Uri : %s", uri);
//parent method //parent method
Map<String, String> abookCheckParam = new HashMap<String, String>(); Map<String, String> abookCheckParam = new HashMap<String, String>();
for (String key : uri.getQueryParameterNames()) { for (String key : uri.getQueryParameterNames()) {
abookCheckParam.put(key, uri.getQueryParameter(key)); abookCheckParam.put(key, uri.getQueryParameter(key));
} }
mCmd = abookCheckParam.get(ABookKeys.CMD); mCmd = abookCheckParam.get(ABookKeys.CMD);
if (abookCheckParam.containsKey(ABookKeys.TASK_KEY)) { if (abookCheckParam.containsKey(ABookKeys.TASK_KEY)) {
mTaskKey = abookCheckParam.get(ABookKeys.TASK_KEY); mTaskKey = abookCheckParam.get(ABookKeys.TASK_KEY);
} }
int taskReportLevel = 0; // 作業報告レベル(0:報告、1:報告(回答)、2:報告(回答)) int taskReportLevel = 0; // 作業報告レベル(0:報告、1:報告(回答)、2:報告(回答))
if (abookCheckParam.containsKey(ABookKeys.TASK_REPORT_LEVEL)) { if (abookCheckParam.containsKey(ABookKeys.TASK_REPORT_LEVEL)) {
taskReportLevel = Integer.parseInt(abookCheckParam.get(ABookKeys.TASK_REPORT_LEVEL)); // 作業報告レベル taskReportLevel = Integer.parseInt(abookCheckParam.get(ABookKeys.TASK_REPORT_LEVEL)); // 作業報告レベル
...@@ -959,24 +959,25 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -959,24 +959,25 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
if (StringUtil.equalsAny(mCmd, ABookKeys.CMD_MOVE_HOT_SPOT, ABookKeys.CMD_INSERT_TASK_REPORT, ABookKeys.CMD_UPDATE_TASK_REPORT, if (StringUtil.equalsAny(mCmd, ABookKeys.CMD_MOVE_HOT_SPOT, ABookKeys.CMD_INSERT_TASK_REPORT, ABookKeys.CMD_UPDATE_TASK_REPORT,
ABookKeys.CMD_DELETE_TASK_REPORT, ABookKeys.CMD_CANCEL_TASK_REPORT, ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT, ABookKeys.CMD_CHANGE_TASK_REPORT, ABookKeys.CMD_DELETE_PROCESS)) { ABookKeys.CMD_DELETE_TASK_REPORT, ABookKeys.CMD_CANCEL_TASK_REPORT, ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT, ABookKeys.CMD_CHANGE_TASK_REPORT, ABookKeys.CMD_DELETE_PROCESS)) {
try { try {
if (StringUtil.equalsAny(mCmd, ABookKeys.CMD_INSERT_TASK_REPORT, ABookKeys.CMD_UPDATE_TASK_REPORT)) { if (StringUtil.equalsAny(mCmd, ABookKeys.CMD_INSERT_TASK_REPORT, ABookKeys.CMD_UPDATE_TASK_REPORT)) {
// リソースパターンの適用 // リソースパターンの適用
showProgressPopup(PatternStringUtil.patternToString(getApplicationContext(), showProgressPopup(PatternStringUtil.patternToString(getApplicationContext(),
R.string.file_initialization, R.string.file_initialization,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
} }
//連続作業の全削除ボタンタップ時のインジケーター表示 //連続作業の全削除ボタンタップ時のインジケーター表示
if (StringUtil.equalsAny(mCmd, ABookKeys.CMD_DELETE_PROCESS)) { if (StringUtil.equalsAny(mCmd, ABookKeys.CMD_DELETE_PROCESS)) {
showProgressPopup(PatternStringUtil.patternToString(getApplicationContext(), showProgressPopup(PatternStringUtil.patternToString(getApplicationContext(),
R.string.msg_common_processing, R.string.msg_common_processing,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
} }
if (isOperationPdf && operationTaskDto != null && StringUtil.equalsAny(mCmd, if (isOperationPdf && operationTaskDto != null && StringUtil.equalsAny(mCmd,
ABookKeys.CMD_INSERT_TASK_REPORT, ABookKeys.CMD_INSERT_TASK_REPORT,
ABookKeys.CMD_UPDATE_TASK_REPORT, ABookKeys.CMD_UPDATE_TASK_REPORT,
ABookKeys.CMD_MOVE_HOT_SPOT, ABookKeys.CMD_MOVE_HOT_SPOT,
ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT)) { ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT)) {
String taskCode = ""; String taskCode = "";
...@@ -1012,6 +1013,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1012,6 +1013,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
public Object callback(Object ret) { public Object callback(Object ret) {
final boolean isError = (boolean)ret; final boolean isError = (boolean)ret;
closeProgressPopup(); closeProgressPopup();
syncOperation(mOperationId, mOperationType, false);
// 報告・報告(回答)の切り替えボタンタップ、連続作業の全削除ボタンタップ // 報告・報告(回答)の切り替えボタンタップ、連続作業の全削除ボタンタップ
if (mCmd.equals(ABookKeys.CMD_CHANGE_TASK_REPORT) || mCmd.equals(ABookKeys.CMD_DELETE_PROCESS)) { if (mCmd.equals(ABookKeys.CMD_CHANGE_TASK_REPORT) || mCmd.equals(ABookKeys.CMD_DELETE_PROCESS)) {
afterABookCheckApi(mCmd, mTaskKey, 0, "", null, isOperationPdf()); afterABookCheckApi(mCmd, mTaskKey, 0, "", null, isOperationPdf());
...@@ -1100,47 +1102,47 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1100,47 +1102,47 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
mReportFileName = abookCheckParam.get(ABookKeys.REPORT_FILE_NAME); mReportFileName = abookCheckParam.get(ABookKeys.REPORT_FILE_NAME);
// 作業報告画面改善 // 作業報告画面改善
ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, true, taskReportId, reportStartDate, mReportFileName, false, true, taskReportLevel, processKey, phaseNo); ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, true, taskReportId, reportStartDate, mReportFileName, false, true, taskReportLevel, processKey, phaseNo);
} else if (mCmd.equals(ABookKeys.CMD_CONTENT_EDIT_CLOSE)) { } else if (mCmd.equals(ABookKeys.CMD_CONTENT_EDIT_CLOSE)) {
showProgressPopup(); showProgressPopup();
handler.postDelayed(new Runnable() { handler.postDelayed(new Runnable() {
@Override @Override
public void run() { public void run() {
closeProgressPopup(); closeProgressPopup();
finish(); finish();
} }
}, 5000); }, 5000);
} else if (mCmd.equals(ABookKeys.CMD_GET_GPS_INFO)) { } else if (mCmd.equals(ABookKeys.CMD_GET_GPS_INFO)) {
// #32926 作業報告画面改善 start // #32926 作業報告画面改善 start
setLocation((Integer.valueOf(abookCheckParam.get(ABookKeys.GPS_TYPE)) != 1)); setLocation((Integer.valueOf(abookCheckParam.get(ABookKeys.GPS_TYPE)) != 1));
// #32926 作業報告画面改善 end // #32926 作業報告画面改善 end
} else if (mCmd.equals(ABookKeys.CMD_SCENE_REGIST)) { } else if (mCmd.equals(ABookKeys.CMD_SCENE_REGIST)) {
String successFlg = abookCheckParam.get(ABookKeys.SUCCESS_FLG); String successFlg = abookCheckParam.get(ABookKeys.SUCCESS_FLG);
if(Integer.parseInt(successFlg) == 0) { if(Integer.parseInt(successFlg) == 0) {
// リソースパターンの適用 // リソースパターンの適用
ABookAlertDialog alertDialog = AlertDialogUtil.createAlertDialog(this, PatternStringUtil.patternToInt(getApplicationContext(), ABookAlertDialog alertDialog = AlertDialogUtil.createAlertDialog(this, PatternStringUtil.patternToInt(getApplicationContext(),
R.string.pano_edit, R.string.pano_edit,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
alertDialog.setMessage(PatternStringUtil.patternToInt(getApplicationContext(), alertDialog.setMessage(PatternStringUtil.patternToInt(getApplicationContext(),
R.string.msg_sence_regist_failed, R.string.msg_sence_regist_failed,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0))); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
alertDialog.setPositiveButton(R.string.ok, alertDialog.setPositiveButton(R.string.ok,
new DialogInterface.OnClickListener() { new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
dialog.dismiss(); dialog.dismiss();
} }
}); });
alertDialog.show(); alertDialog.show();
} else { } else {
progressDialog.setProgress(100); progressDialog.setProgress(100);
// 成功 // 成功
Logger.i(TAG, ABookKeys.CMD_SCENE_REGIST + "is success"); Logger.i(TAG, ABookKeys.CMD_SCENE_REGIST + "is success");
progressDialog.setProgress(0); progressDialog.setProgress(0);
} }
closeProgressPopup(); closeProgressPopup();
} else if (mCmd.equals(ABookKeys.CMD_MOVE_PAGE)) { } else if (mCmd.equals(ABookKeys.CMD_MOVE_PAGE)) {
onActionOperationPdfWebView(abookCheckParam, operationTaskDto); onActionOperationPdfWebView(abookCheckParam, operationTaskDto);
} else if (mCmd.equals(ABookKeys.CMD_SHOW_RELATED_CONTENT)) { } else if (mCmd.equals(ABookKeys.CMD_SHOW_RELATED_CONTENT)) {
try { try {
long linkedContentId = Long.valueOf(abookCheckParam.get(ABookKeys.CONTENT_ID)); long linkedContentId = Long.valueOf(abookCheckParam.get(ABookKeys.CONTENT_ID));
...@@ -1169,40 +1171,40 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1169,40 +1171,40 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
finishActivity(); // 開いてる画面を閉じる finishActivity(); // 開いてる画面を閉じる
} }
} }
} }
public void commonAttachedDataUrl (String taskKey, String data) { public void commonAttachedDataUrl (String taskKey, String data) {
boolean isError = false; boolean isError = false;
if (data != null) { if (data != null) {
try { try {
String imagePath = ABVEnvironment.getInstance().getTempFilePath(getContentId(), taskKey, mAttachedFileName); String imagePath = ABVEnvironment.getInstance().getTempFilePath(getContentId(), taskKey, mAttachedFileName);
ABookCheckWebViewHelper.getInstance().decodeToImage(data, imagePath); ABookCheckWebViewHelper.getInstance().decodeToImage(data, imagePath);
//アプリ内のファイルのみ削除(Galleryファイルは削除しない) //アプリ内のファイルのみ削除(Galleryファイルは削除しない)
if (mLocalFile != null && mLocalFile.getPath().contains(getPackageName())) { if (mLocalFile != null && mLocalFile.getPath().contains(getPackageName())) {
FileUtil.delete(mLocalFile); FileUtil.delete(mLocalFile);
} }
mLocalFile = null; mLocalFile = null;
//編集可能可否をチェックする。 //編集可能可否をチェックする。
if (mEnablePhotoEdit.equals("1")) { //編集の場合、編集画面を開ける。 if (mEnablePhotoEdit.equals("1")) { //編集の場合、編集画面を開ける。
commonOpenEditPage(); commonOpenEditPage();
} }
} catch (Exception e) { } catch (Exception e) {
isError = true; isError = true;
Logger.e(TAG, e); Logger.e(TAG, e);
} }
} }
afterABookCheckApi(mCmd, taskKey, isError ? 1 : 0, "", null); afterABookCheckApi(mCmd, taskKey, isError ? 1 : 0, "", null);
} }
protected Uri attachmentImageProcessing(Uri uri) throws Exception { protected Uri attachmentImageProcessing(Uri uri) throws Exception {
if (uri == null) { if (uri == null) {
return null; return null;
} }
String[] operationion = {MediaStore.MediaColumns.DATA}; String[] operationion = {MediaStore.MediaColumns.DATA};
Cursor cursor = getContentResolver().query(uri, operationion, null, null, null); Cursor cursor = getContentResolver().query(uri, operationion, null, null, null);
String photoFilePath = ABookCheckWebViewHelper.getInstance().contentSchemeUriToFilePath(cursor); String photoFilePath = ABookCheckWebViewHelper.getInstance().contentSchemeUriToFilePath(cursor);
try { try {
int rotationAngle = ABookCheckWebViewHelper.getInstance().rotateBitmapOrientation(photoFilePath); int rotationAngle = ABookCheckWebViewHelper.getInstance().rotateBitmapOrientation(photoFilePath);
if (rotationAngle == 0) { if (rotationAngle == 0) {
mLocalFile = new File(photoFilePath); mLocalFile = new File(photoFilePath);
...@@ -1215,106 +1217,106 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1215,106 +1217,106 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
Logger.e(TAG, "image file is not found", e); Logger.e(TAG, "image file is not found", e);
} }
return null; return null;
} }
public void afterABookCheckApi(final String cmd, final String taskKey, final int result, final String message, final String extParam) { public void afterABookCheckApi(final String cmd, final String taskKey, final int result, final String message, final String extParam) {
afterABookCheckApi(cmd, taskKey, result, message, extParam, false); afterABookCheckApi(cmd, taskKey, result, message, extParam, false);
} }
public void afterABookCheckApi(final String cmd, final String taskKey, final int result, final String message, final String extParam, final boolean isParent) { public void afterABookCheckApi(final String cmd, final String taskKey, final int result, final String message, final String extParam, final boolean isParent) {
Logger.v(TAG, "run javaScript for ABookCheck : cmd=%s, taskKey=%s, result=%s, message=%s", cmd, taskKey, result, message); Logger.v(TAG, "run javaScript for ABookCheck : cmd=%s, taskKey=%s, result=%s, message=%s", cmd, taskKey, result, message);
final String finalParent = isParent ? "window.parent." : ""; final String finalParent = isParent ? "window.parent." : "";
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
if (extParam != null) { if (extParam != null) {
Logger.i(TAG, String.format("javascript:%sCHK.afterABookCheckApi('%s', '%s', '%s', '%s', %s)", finalParent, cmd, taskKey, result, message, extParam)); Logger.i(TAG, String.format("javascript:%sCHK.afterABookCheckApi('%s', '%s', '%s', '%s', %s)", finalParent, cmd, taskKey, result, message, extParam));
webViewLoadUrl(String.format("javascript:%sCHK.afterABookCheckApi('%s', '%s', '%s', '%s', %s)", finalParent, cmd, taskKey, result, message, extParam)); webViewLoadUrl(String.format("javascript:%sCHK.afterABookCheckApi('%s', '%s', '%s', '%s', %s)", finalParent, cmd, taskKey, result, message, extParam));
} else { } else {
Logger.i(TAG, String.format("javascript:%sCHK.afterABookCheckApi('%s', '%s', '%s', '%s')", finalParent, cmd, taskKey, result, message)); Logger.i(TAG, String.format("javascript:%sCHK.afterABookCheckApi('%s', '%s', '%s', '%s')", finalParent, cmd, taskKey, result, message));
webViewLoadUrl(String.format("javascript:%sCHK.afterABookCheckApi('%s', '%s', '%s', '%s')", finalParent, cmd, taskKey, result, message)); webViewLoadUrl(String.format("javascript:%sCHK.afterABookCheckApi('%s', '%s', '%s', '%s')", finalParent, cmd, taskKey, result, message));
} }
} }
}); });
} }
protected void commonConfigureHeader() { protected void commonConfigureHeader() {
} }
/** /**
* 添付ファイルのBase64文字列取得 * 添付ファイルのBase64文字列取得
*/ */
public void getAttachedDataUrl(final String taskKey) { public void getAttachedDataUrl(final String taskKey) {
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
webViewLoadUrl("javascript:android.getAttachedDataUrl('" + taskKey + "', CHK.getAttachedDataUrl())"); webViewLoadUrl("javascript:android.getAttachedDataUrl('" + taskKey + "', CHK.getAttachedDataUrl())");
} }
}); });
} }
public void openEditPage(){ public void openEditPage(){
webViewLoadUrl("javascript:android.openEditPage()"); webViewLoadUrl("javascript:android.openEditPage()");
} }
/** /**
* 位置情報取得 * 位置情報取得
* @param showPermissionDialogFlg * @param showPermissionDialogFlg
*/ */
// #32926 作業報告画面改善 start // #32926 作業報告画面改善 start
protected void setLocation(final boolean showPermissionDialogFlg) { protected void setLocation(final boolean showPermissionDialogFlg) {
// #32926 作業報告画面改善 end // #32926 作業報告画面改善 end
ABookPermissionHelper helper = new ABookPermissionHelper(this, Constant.ABookPermissionType.AccessFineLocation, null); ABookPermissionHelper helper = new ABookPermissionHelper(this, Constant.ABookPermissionType.AccessFineLocation, null);
if (helper.checkMultiPermissions(showPermissionDialogFlg)) { if (helper.checkMultiPermissions(showPermissionDialogFlg)) {
// 位置情報取得 // 位置情報取得
LocationManagerUtil locationManagerUtil = new LocationManagerUtil(this, new LocationManagerUtil.LocationManagerUtilListener() { LocationManagerUtil locationManagerUtil = new LocationManagerUtil(this, new LocationManagerUtil.LocationManagerUtilListener() {
@Override @Override
public void onGetLocationFailed() { public void onGetLocationFailed() {
Logger.w(TAG, "onGetLocationFailed"); Logger.w(TAG, "onGetLocationFailed");
// #32926 作業報告画面改善 end // #32926 作業報告画面改善 end
afterABookCheckApi(mCmd, "", 1, PatternStringUtil.patternToString(getApplicationContext(), afterABookCheckApi(mCmd, "", 1, PatternStringUtil.patternToString(getApplicationContext(),
R.string.msg_location_search_fail, R.string.msg_location_search_fail,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)), null); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)), null);
} }
@Override @Override
public void onGetLocation(final Location location) { public void onGetLocation(final Location location) {
latitude = location.getLatitude(); latitude = location.getLatitude();
longitude = location.getLongitude(); longitude = location.getLongitude();
Logger.v(TAG, "location latitude(%s), longitude(%s)", latitude, longitude); Logger.v(TAG, "location latitude(%s), longitude(%s)", latitude, longitude);
CommonExecutor.execute(new Runnable() { CommonExecutor.execute(new Runnable() {
@Override @Override
public void run() { public void run() {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("latitude", latitude); json.put("latitude", latitude);
json.put("longitude", longitude); json.put("longitude", longitude);
afterABookCheckApi(mCmd, "", 0, "", json.toString()); afterABookCheckApi(mCmd, "", 0, "", json.toString());
}; };
}); });
} }
}); });
locationManagerUtil.startLocationService(); locationManagerUtil.startLocationService();
} else { } else {
Logger.w(TAG,"onGetLocationFailed AccessFineLocation false"); Logger.w(TAG,"onGetLocationFailed AccessFineLocation false");
// リソースパターンの適用 // リソースパターンの適用
afterABookCheckApi(mCmd, "", 1, PatternStringUtil.patternToString(getApplicationContext(), afterABookCheckApi(mCmd, "", 1, PatternStringUtil.patternToString(getApplicationContext(),
R.string.msg_location_search_fail, R.string.msg_location_search_fail,
getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)), null); getUserPref(AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)), null);
} }
} }
protected boolean isOperationPdf() { protected boolean isOperationPdf() {
return isOperationPdf; return isOperationPdf;
} }
/** /**
* 報告可能フラグ * 報告可能フラグ
* @return * @return
*/ */
public boolean isReportEdit() { public boolean isReportEdit() {
return mEnableReportEdit == Constant.EnableReportEdit.YES; return mEnableReportEdit == Constant.EnableReportEdit.YES;
} }
/** /**
* PDF操作インスタンスを作成 * PDF操作インスタンスを作成
......
...@@ -240,6 +240,35 @@ public abstract class ABVUIActivity extends ABVAuthenticatedActivity { ...@@ -240,6 +240,35 @@ public abstract class ABVUIActivity extends ABVAuthenticatedActivity {
// ログ送信可否を確認 // ログ送信可否を確認
LogUtil.checkSendLogFlag(); LogUtil.checkSendLogFlag();
} }
} catch (ABVException e) {
stopUpdateAnimation();
switch (e.getCode()) {
case C_I_CONTENT_0001:
handleErrorMessageToast(ABVExceptionCode.C_I_CONTENT_0001);
break;
case S_E_ACMS_1403:
// 再ログイン
onAuthenticationFailed();
break;
case C_I_CONTENT_0002:
// コンテンツダウンロード中は自動更新を行わない。
if (!isAutoRefresh) {
handleErrorMessageToast(ABVExceptionCode.C_I_CONTENT_0002);
}
break;
case S_E_ACMS_0500:
handleErrorMessageToast(ABVExceptionCode.S_E_ACMS_0500);
break;
case S_E_ACMS_INVALID_RESPONSE:
// サーバー通信エラー時、エラーメッセージ表示
handleErrorMessageToast(ABVExceptionCode.S_E_ACMS_INVALID_RESPONSE);
break;
default:
Logger.e(TAG, "Exception DataRefresh", e);
handleErrorMessageToast(ErrorCode.E107);
break;
}
throw e;
} catch (Exception e) { } catch (Exception e) {
stopUpdateAnimation(); stopUpdateAnimation();
if (startRefresh) { if (startRefresh) {
......
...@@ -54,6 +54,7 @@ public enum ErrorCode { ...@@ -54,6 +54,7 @@ public enum ErrorCode {
L121(R.string.L121), L121(R.string.L121),
L122(R.string.L122), L122(R.string.L122),
L124(R.string.L124), L124(R.string.L124),
L125(R.string.L125),
C_E_SYSTEM_0001(R.string.C_E_SYSTEM_0001), C_E_SYSTEM_0001(R.string.C_E_SYSTEM_0001),
C_E_SYSTEM_0002(R.string.C_E_SYSTEM_0002), C_E_SYSTEM_0002(R.string.C_E_SYSTEM_0002),
......
...@@ -133,17 +133,6 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -133,17 +133,6 @@ public class OperationListActivity extends ABVUIActivity {
private TextView mEndDate; // 検索画面の作業終了日 private TextView mEndDate; // 検索画面の作業終了日
private Dialog mSearchDialog; private Dialog mSearchDialog;
private Date mOperationLastEditDate;
private OperationDao mOperationDao = AbstractDao.getDao(OperationDao.class);
private OperationContentDao mOperationContentDao = AbstractDao.getDao(OperationContentDao.class);
private TaskReportDao mTaskReportDao = AbstractDao.getDao(TaskReportDao.class);
private OperationLogic mOperationLogic = AbstractLogic.getLogic(OperationLogic.class);
private OperationGroupMasterLogic mOperationGroupMasterLogic = AbstractLogic.getLogic(OperationGroupMasterLogic.class);
private PushMessageLogic mPushMessageLogic = AbstractLogic.getLogic(PushMessageLogic.class);
private TaskDao mTaskDao = AbstractDao.getDao(TaskDao.class);
private boolean activityResultFlg; private boolean activityResultFlg;
...@@ -922,6 +911,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -922,6 +911,7 @@ public class OperationListActivity extends ABVUIActivity {
* @param buttonEventFlag * @param buttonEventFlag
* @return result errorMessage * @return result errorMessage
*/ */
@Override
public String syncOperation(final long operationId, int reportType, boolean buttonEventFlag) { public String syncOperation(final long operationId, int reportType, boolean buttonEventFlag) {
final StringBuilder errorMsg = new StringBuilder(); final StringBuilder errorMsg = new StringBuilder();
Logger.i(TAG, "---sync start"); Logger.i(TAG, "---sync start");
...@@ -1082,6 +1072,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1082,6 +1072,7 @@ public class OperationListActivity extends ABVUIActivity {
* @throws NoSuchAlgorithmException * @throws NoSuchAlgorithmException
* @throws ZipException * @throws ZipException
*/ */
@Override
public Date receptionTaskData(long operationId, Callback progressCallback, StringBuilder errorMsg) throws NetworkDisconnectedException, ABVException, IOException, InterruptedException, NoSuchAlgorithmException, ZipException { public Date receptionTaskData(long operationId, Callback progressCallback, StringBuilder errorMsg) throws NetworkDisconnectedException, ABVException, IOException, InterruptedException, NoSuchAlgorithmException, ZipException {
GetOperationDataParameters param = new GetOperationDataParameters(ABVDataCache.getInstance().getMemberInfo().sid, operationId); GetOperationDataParameters param = new GetOperationDataParameters(ABVDataCache.getInstance().getMemberInfo().sid, operationId);
OperationDto operationDto = mOperationLogic.getOperation(operationId); OperationDto operationDto = mOperationLogic.getOperation(operationId);
...@@ -1216,80 +1207,9 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1216,80 +1207,9 @@ public class OperationListActivity extends ABVUIActivity {
return lastEditDate; return lastEditDate;
} }
/**
* 添付ファイルが存在する場合、取得して解凍する。
* @param operationId
* @param taskReportLevel
* @param contentId
* @param taskId
* @param taskKey
* @param attachedFileName
* @param processKey 固定キー
* @param phaseNo 固定NO
* @throws ABVException
* @throws InterruptedException
* @throws ZipException
* @throws NoSuchAlgorithmException
* @throws IOException
*/
public void refreshTaskFile(final long operationId, final int taskReportLevel, long contentId,
final long taskId, final String taskKey, final String attachedFileName,
final String processKey, final Integer phaseNo) throws Exception {
// 既存の添付ディレクトリ削除
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey));
String reportLocalAttachedFileName = mTaskReportDao.getTaskReportAttachedFileName(taskKey, taskReportLevel);
if (attachedFileName != null && !attachedFileName.equals(reportLocalAttachedFileName)) {
Logger.i(TAG, "[Get Task Report Files] operationId=%s, taskKey=%s, taskId=%s, attachedFileName=%s", operationId, taskKey, taskId, attachedFileName);
// #32926 start
String saveAttacedFilePath = ABVEnvironment.getInstance().getOperationTaskReportLevelDirPath(operationId, taskKey, taskReportLevel);
if (processKey != null && phaseNo != 0) {
saveAttacedFilePath = ABVEnvironment.getInstance().getOperationDirectionOrContinuousReportDirPath(operationId, taskKey, taskReportLevel, processKey, phaseNo);
}
FileUtil.delete(saveAttacedFilePath);
// #32926 end
String outputFilePath = mOperationLogic.getTaskFile(operationId, taskKey, taskId, attachedFileName, taskReportLevel);
ContentFileExtractor.getInstance().extractZipFile(contentId, outputFilePath, saveAttacedFilePath,null, true);
}
}
/**
* 定期点検用ファイル更新
* @param operationId
* @param contentId
* @param taskId
* @param taskKey
* @param taskReportId
* @param reportStartDate
* @param reportAttachedFileName
* @throws ABVException
* @throws InterruptedException
* @throws ZipException
* @throws NoSuchAlgorithmException
* @throws IOException
*/
public void refreshRoutineTaskFile(final long operationId, final long contentId, final long taskId, final String taskKey, final int taskReportId, final int taskReportInfoId, final Date reportStartDate, final String reportAttachedFileName) throws Exception {
String reportStartDateHypn = DateTimeUtil.toString(reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen);
final String reportStartDateNone = DateTimeUtil.toString_yyyyMMddHHmmss_none(reportStartDate);
// 既存の添付ディレクトリ削除
FileUtil.delete(ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey));
String reportLocalAttachedFileName = mTaskReportDao.getRoutineTaskReportAttachedFileName(taskKey, taskReportId, reportStartDateHypn);
boolean getReportFileFlg = !StringUtil.isNullOrEmpty(reportAttachedFileName) && !reportAttachedFileName.equals(reportLocalAttachedFileName);
if (getReportFileFlg) {
Logger.i(TAG, "[Get Task Report Files] operationId=%s, taskKey=%s, taskId=%s, attachedFileName=%s", operationId, taskKey, taskId, reportAttachedFileName);
// #32926 start
int taskReportLevel = 0;
FileUtil.delete(ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, taskKey, taskReportId, reportStartDateNone));
// #32926 end
String outputFilePath = mOperationLogic.getRoutineTaskReportFile(operationId, taskKey, taskId, taskReportId, taskReportInfoId, reportStartDateNone, reportAttachedFileName);
// #32926 start
ContentFileExtractor.getInstance().extractZipFile(contentId, outputFilePath,
ABVEnvironment.getInstance().getRoutineTaskReportDirFilePath(operationId, taskKey, taskReportId, reportStartDateNone), null, true);
// #32926 end
}
}
/** /**
* 360コンテンツ登録ダイアログ * 360コンテンツ登録ダイアログ
...@@ -1373,47 +1293,6 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1373,47 +1293,6 @@ public class OperationListActivity extends ABVUIActivity {
} }
/** /**
* listDtoの中に第2引数のdtoが存在するかチェックメソッド
* @param listDto リストDto
* @param dto ターゲットDto
* @return
*/
private boolean isExistsTaskInList(List<TaskDto> listDto, TaskDto dto) {
for (TaskDto lDto : listDto) {
if (lDto.taskKey.equals(dto.taskKey)) {
return true;
}
}
return false;
}
/**
* 報告存在チェック
* @param listDto
* @param rDto
* @return
*/
private boolean isExistsTaskReportInList(List<TaskReportDto> listDto, TaskReportDto rDto, boolean isRoutineTask) {
for (TaskReportDto lDto : listDto) {
if (isRoutineTask) {
// 定期点検の場合、taskKey,taskReportId,reportStartDateで判定
if (lDto.taskKey.equals(rDto.taskKey) &&
lDto.taskReportId == rDto.taskReportId &&
lDto.reportStartDate.equals(rDto.reportStartDate)) {
return true;
}
} else {
// taskKeyと作業報告階層で判定
if (lDto.taskKey.equals(rDto.taskKey) &&
lDto.taskReportLevel == rDto.taskReportLevel) {
return true;
}
}
}
return false;
}
/**
* 作業報告画面に移動 * 作業報告画面に移動
* @param operationDto * @param operationDto
*/ */
......
...@@ -4957,7 +4957,7 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -4957,7 +4957,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
// 空き容量が足りない // 空き容量が足りない
handleErrorMessageToast(ErrorCode.STORAGE_ERROR); handleErrorMessageToast(ErrorCode.STORAGE_ERROR);
} else { } else {
handleErrorMessageToast(ErrorCode.L120); handleErrorMessageToast(ErrorCode.L125);
} }
} }
}); });
......
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