Commit b35eb4a4 by Jeong Gilmo

Merge branch 'feature/1.0.1' into feature/1.0.1_33006

parents 8d189837 167e720e
......@@ -135,7 +135,7 @@ public class ABVEnvironment {
// #32926 作業報告画面改善 start
// 作業報告レベル(taskReportLevel)によってディレクトリを追加する
public static final String TaskReportLevelDir = "/%s";
public static final String SavedOzFileFormat = OperationDirectionOrReportDirFormat + TaskReportLevelDir + "/%s";
public static final String SavedOzFileFormat = OperationDirectionOrReportDirFormat + TaskReportLevelDir;
public static final String RoutineTaskSavedOzFileFormat = OperationDirectionOrReportDirFormat + TaskReportLevelDir + "/%d/%s/%s";
public static final String OperationTaskKeyReportSendDirFormat = OperationTaskKeyDirFormat + TaskReportLevelDir + "/reportSend/%d";
public static final String OperationTaskKeyRoutineTaskReportSendDirFormat = OperationTaskKeyDirFormat + "/reportSend/%d/%s/%d";
......@@ -603,7 +603,7 @@ public class ABVEnvironment {
* @return ファイルパス
*/
public String getSavedOzFileTaskReportLevelPath(long operationId, String taskKey, String fileName, String taskReportLevel) {
return String.format(SavedOzFileFormat, rootDirectory, operationId, taskKey, taskReportLevel, "report", fileName);
return String.format(SavedOzFileFormat, rootDirectory, operationId, taskKey, taskReportLevel, fileName);
}
// #32926 作業報告画面改善 end
......
......@@ -111,11 +111,9 @@ public class ABookKeys {
public static final String URI = "uri";
public static final String OK = "OK";
// #32861 作業情報追加 start
public static final String LOCAL_SAVE = "localSave"; // 一時保存情報
public static final String ADD_REPORT = "addReport"; // 作業追加区分
public static final String CMD_LOCAL_SAVE_TASK_REPORT = "localSaveTaskReport"; // 一時保存
// #32861 作業情報追加 end
// #32926 作業報告画面改善 start
public static final String HAS_AUTHORITY = "hasAuthority";
// #32926 作業報告画面改善 end
......

488 Bytes | W: | H:

607 Bytes | W: | H:

ABVJE_Res_Default_Android/res/drawable-xhdpi/ic_delete.png
ABVJE_Res_Default_Android/res/drawable-xhdpi/ic_delete.png
ABVJE_Res_Default_Android/res/drawable-xhdpi/ic_delete.png
ABVJE_Res_Default_Android/res/drawable-xhdpi/ic_delete.png
  • 2-up
  • Swipe
  • Onion skin
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -178,12 +178,11 @@
<string name="access_location_message">"%1$s"は現在の位置情報を使用します。よろしいですか?</string>
<!-- #32861 作業情報追加 start -->
<string name="temp_save">一時保存</string>
<string name="temp_save_info">一時保存しますか?</string>
<string name="save_info">保存してサーバへ送信しますか?</string>
<string name="msg_temp_save_result">保存されました。</string>
<!-- #32861 作業情報追加 end -->
<string name="delete_info">保存されたデータを削除しますか?</string>
<!-- Error Message -->
<string name="E000">事業者IDを入力してください。</string>
......
......@@ -179,12 +179,11 @@
<string name="access_location_message">"%1$s"에서 현재 위치 정보를 사용하고자 합니다.</string>
<!-- #32861 作業情報追加 start -->
<string name="temp_save">임시저장</string>
<string name="temp_save_info">임시저장 하시겠습니까?</string>
<string name="save_info">저장하시고 서버로 송신하시겠습니까?</string>
<string name="msg_temp_save_result">저장되었습니다.</string>
<!-- #32861 作業情報追加 end -->
<string name="delete_info">저장된 데이터를 삭제하시겠습니까?</string>
<!-- Error Message -->
<string name="E000">어카운트패스 입력해 주십시오.</string>
......
......@@ -178,12 +178,11 @@
<string name="access_location_message">"%1$s" Would Like to Use Your Current Location</string>
<!-- #32861 作業情報追加 start -->
<string name="temp_save">Temporarily saved</string>
<string name="temp_save_info">Do you want to temporarily save it?</string>
<string name="save_info">Save it and send it to the server?</string>
<string name="msg_temp_save_result">It has been saved.</string>
<!-- #32861 作業情報追加 end -->
<string name="delete_info">Do you want to delete the saved data?</string>
<!-- Error Message -->
<string name="E000">Please enter company ID.</string>
......
......@@ -11,7 +11,6 @@
style="@style/OperationSearchToolBar"
android:minHeight="50dp">
<!-- #32861 作業情報追加 start -->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......@@ -38,7 +37,6 @@
android:background="@drawable/ic_operation_home" />
</LinearLayout>
<!-- #32861 作業情報追加 end -->
<LinearLayout
android:layout_width="wrap_content"
......@@ -64,7 +62,14 @@
android:layout_alignParentRight="true"
android:layout_centerVertical="true">
<!-- #32861 作業情報追加 start -->
<Button
android:id="@+id/btn_delete"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginRight="5dp"
android:background="@drawable/ic_delete" />
<Button
android:id="@+id/btn_temp_save"
android:layout_width="30dp"
......@@ -72,7 +77,7 @@
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginRight="5dp"
android:background="@drawable/ic_download_off" />
android:background="@drawable/ic_local_save" />
<Button
android:id="@+id/btn_save"
android:layout_width="30dp"
......@@ -80,8 +85,7 @@
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginRight="5dp"
android:background="@drawable/ic_download_on" />
<!-- #32861 作業情報追加 end -->
android:background="@drawable/ic_save" />
</LinearLayout>
</RelativeLayout>
......
......@@ -73,6 +73,7 @@ import jp.agentec.abook.abv.ui.home.helper.ABookCheckWebViewHelper;
import jp.agentec.abook.abv.ui.home.helper.ABookPermissionHelper;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.viewer.activity.CheckOZDViewActivity;
import jp.agentec.abook.abv.ui.viewer.activity.HTMLWebViewActivity;
import jp.agentec.abook.abv.ui.viewer.activity.HTMLXWalkWebViewActivity;
import jp.agentec.abook.abv.ui.viewer.activity.NoPdfViewActivity;
import jp.agentec.abook.abv.ui.viewer.foxitPdf.FoxitPdfCore;
......@@ -133,16 +134,14 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
public boolean isLinkedContent;
public int pageNo;
// #32861 作業情報追加 start
public int mButtonStatus; // 保存ボタンチェック
protected boolean mLocalSave; // 一時保存情報
protected boolean mAddReport; // 作業追加区分
// #32861 作業情報追加 end
protected int mTaskReportLevel; // 作業報告レベル
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = getIntent();
contentId = intent.getLongExtra(ABookKeys.CONTENT_ID, 0);
contentType = intent.getStringExtra(ABookKeys.CONTENT_TYPE);
......@@ -674,9 +673,10 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
});
alertDialog.show();
} else {
putUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, mOperationId);
finishActivity();
}
// 作業終了する時、作業ID設定して作業一覧で使用するメソットを行う。
putUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, mOperationId);
finishActivity(); // 開いてる画面を閉じる
}
}
});
operationHomeButton.setVisibility(View.VISIBLE);
......@@ -764,8 +764,9 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
});
alertDialog.show();
} else {
putUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, mOperationId);
finishActivity();
// 作業終了する時、作業ID設定して作業一覧で使用するメソットを行う。
putUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, mOperationId); // 作業IDの設定
finishActivity(); // 開いてる画面を閉じる
}
}
......@@ -856,23 +857,28 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
mCmd = abookCheckParam.get(ABookKeys.CMD);
mTaskKey = abookCheckParam.get(ABookKeys.TASK_KEY);
int taskReportLevel = 0; // 作業報告レベル(0:報告、1:報告(回答)、2:報告(回答))
mTaskReportLevel = 0; // 作業報告レベル(0:報告、1:報告(回答)、2:報告(回答))
if (abookCheckParam.containsKey(ABookKeys.TASK_REPORT_LEVEL)) {
taskReportLevel = Integer.parseInt(abookCheckParam.get(ABookKeys.TASK_REPORT_LEVEL)); // 作業報告レベル
mTaskReportLevel = Integer.parseInt(abookCheckParam.get(ABookKeys.TASK_REPORT_LEVEL)); // 作業報告レベル
}
int taskReportId = 0;
String reportStartDate = "";
if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK && abookCheckParam.get(ABookKeys.TASK_REPORT_ID) != null && abookCheckParam.get(ABookKeys.REPORT_START_DATE) != null) {
// 作業追加区分の値を取得する
mAddReport = true;
if (abookCheckParam.containsKey(ABookKeys.ADD_REPORT)) {
mAddReport = Integer.parseInt(abookCheckParam.get(ABookKeys.ADD_REPORT)) > 0 ? true : false;
}
if (operationDto.reportType == Constant.OperationReportType.ROUTINE_TASK && abookCheckParam.get(ABookKeys.TASK_REPORT_ID) != null && abookCheckParam.get(ABookKeys.REPORT_START_DATE) != null) {
taskReportId = Integer.parseInt(abookCheckParam.get(ABookKeys.TASK_REPORT_ID));
reportStartDate = abookCheckParam.get(ABookKeys.REPORT_START_DATE);
}
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)) {
boolean isError = false;
try {
try {
if (StringUtil.equalsAny(mCmd, ABookKeys.CMD_INSERT_TASK_REPORT, ABookKeys.CMD_UPDATE_TASK_REPORT)) {
showProgressPopup(getString(R.string.file_initialization));
}
......@@ -916,9 +922,26 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
public Object callback(Object ret) {
final boolean isError = (boolean)ret;
closeProgressPopup();
// #32861 作業情報追加 start
afterABookCheckApi(mCmd, mTaskKey, isNetWorkError(isError), "", null, isOperationPdf());
// #32861 作業情報追加 end
int ozViewCloseFlag = 0;
// OZD作業でエラーが発生する場合ozViewCloseFlagの値を設定する。
if (isError && ActivityHandlingHelper.getInstance().searchOzdActivityStack()) {
ozViewCloseFlag = 1;
}
if (mAddReport) { // 作業追加区分あり
if (ozViewCloseFlag == 0) { // エラーなし
// コールバック処理のみ行う。
afterABookCheckApi(mCmd, mTaskKey, 0, "", null, isOperationPdf());
} else { // エラーあり
// OZD作業以外の場合
if (!ActivityHandlingHelper.getInstance().searchOzdActivityStack()) {
// コールバック処理のみ行う。
afterABookCheckApi(mCmd, mTaskKey, 0, "", null, isOperationPdf());
}
}
}
// エラーがない場合のみ画面遷移処理を行う。
if (ozViewCloseFlag == 0) closeCurrentScreen(mOperationType);
return null;
}
};
......@@ -926,7 +949,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
ABookCheckWebViewHelper.getInstance().doABookCheckParam(ABVContentViewActivity.this,
mCmd, mTaskKey, mEnableReportHistory, abookCheckParam, mOperationId, mContentPath, getContentId(),
operationDto.reportType, finishCallback,
taskReportLevel);
mTaskReportLevel);
} catch(Exception e) {
Logger.e(TAG, "doABookCheckParam error", e);
......@@ -951,21 +974,17 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, true, true, mReportFileName);
} else if (mCmd.equals(ABookKeys.CMD_SHOW_REPORT_OZD)) {
mReportFileName = abookCheckParam.get(ABookKeys.REPORT_FILE_NAME);
// #32861 作業情報追加 start
// #32926 作業報告画面改善 start
boolean mLocalSave = false; // 一時保存情報
if (abookCheckParam.containsKey(ABookKeys.LOCAL_SAVE)) {
mLocalSave = Integer.parseInt(abookCheckParam.get(ABookKeys.LOCAL_SAVE)) > 0 ? true : false;
}
if (abookCheckParam.containsKey(ABookKeys.ADD_REPORT)) {
mAddReport = Integer.parseInt(abookCheckParam.get(ABookKeys.ADD_REPORT)) > 0 ? true : false;
}
// #32926 作業報告画面改善 start
ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, false, taskReportId, reportStartDate, mReportFileName, mLocalSave, mAddReport, taskReportLevel);
ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, false, taskReportId, reportStartDate, mReportFileName, mLocalSave, mAddReport, mTaskReportLevel);
// #32926 作業報告画面改善 end
// #32861 作業情報追加 end
} else if (mCmd.equals(ABookKeys.CMD_PREVIEW_REPORT_OZD)) {
mReportFileName = abookCheckParam.get(ABookKeys.REPORT_FILE_NAME);
// #32926 作業報告画面改善 start
ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, true, taskReportId, reportStartDate, mReportFileName, false, false, taskReportLevel);
ActivityHandlingHelper.getInstance().startOZViewerActivity(this, mOperationId, getContentId(), mTaskKey, true, taskReportId, reportStartDate, mReportFileName, false, false, mTaskReportLevel);
// #32926 作業報告画面改善 end
} else if (mCmd.equals(ABookKeys.CMD_CONTENT_EDIT_CLOSE)) {
showProgressPopup();
......@@ -978,7 +997,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}, 5000);
} else if (mCmd.equals(ABookKeys.CMD_GET_GPS_INFO)) {
// #32926 作業報告画面改善 start
setLocation((Integer.valueOf(abookCheckParam.get(ABookKeys.GPS_TYPE)) != 1), taskReportLevel);
setLocation((Integer.valueOf(abookCheckParam.get(ABookKeys.GPS_TYPE)) != 1), mTaskReportLevel);
// #32926 作業報告画面改善 end
} else if (mCmd.equals(ABookKeys.CMD_SCENE_REGIST)) {
String successFlg = abookCheckParam.get(ABookKeys.SUCCESS_FLG);
......@@ -1090,9 +1109,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
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));
}
// #32861 作業情報追加 start
doneProcess(result); // HTML側の処理が終わった後の処理を行う
// #32861 作業情報追加 end
}
});
}
......@@ -1205,14 +1221,13 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
return new FoxitPdfCore(this, filepath);
}
// #32861 作業情報追加 start
// 保存処理
public void ozdSaveProcess() {
runOnUiThread(new Runnable() {
@Override
public void run () {
// 実行Javascript - 保存
webViewLoadUrl("javascript:CHK.saveOzReport()");
ActivityHandlingHelper.getInstance().callOzdHtmlScript("javascript:CHK.saveOzReport()");
Logger.d(TAG, "ozdSaveProcess");
}
});
......@@ -1224,7 +1239,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
@Override
public void run () {
// 実行Javascript - 一時保存
webViewLoadUrl("javascript:CHK.localSaveOzReport()");
ActivityHandlingHelper.getInstance().callOzdHtmlScript("javascript:CHK.localSaveOzReport()");
Logger.d(TAG, "ozdLocalSaveProcess");
}
});
......@@ -1236,55 +1251,64 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
@Override
public void run () {
// 実行Javascript - 閉じる
webViewLoadUrl("javascript:CHK.cancelOzReport()");
ActivityHandlingHelper.getInstance().callOzdHtmlScript("javascript:CHK.cancelOzReport()");
Logger.d(TAG, "ozdCancelProcess");
}
});
}
// 削除処理
public void ozdDeleteProcess() {
runOnUiThread(new Runnable() {
@Override
public void run () {
// 実行Javascript - 閉じる
ActivityHandlingHelper.getInstance().callOzdHtmlScript("javascript:CHK.deleteOzReport()");
Logger.d(TAG, "ozdDeleteProcess");
}
});
}
// 作業一覧画面に遷移
public void goToMain() {
ActivityHandlingHelper.getInstance().finishAllContentViewActivity(); // 一覧画面に遷移
}
// 押したボタンによってHTML側の処理を行う
public void doProcess() {
// #32861 作業情報追加 start
// 押したボタンによってHTML側の処理を行う
if (this instanceof CheckOZDViewActivity) {
if (mButtonStatus == R.id.btn_close) {
super.finish();
ozdCancelProcess(); // 閉じる
} else if (mButtonStatus == R.id.btn_temp_save) {
ozdLocalSaveProcess(); // 一時保存
} else if (mButtonStatus == R.id.btn_save){
} else if (mButtonStatus == R.id.btn_save) {
ozdSaveProcess(); // 保存
doneProcess(1);
} else if (mButtonStatus == R.id.btn_delete) {
ozdDeleteProcess(); // 削除
}
}
// #32861 作業情報追加 end
}
public void doneProcess(int isError) {
// 押したボタンによってHTML側の処理が終わった後の処理を行う
if (this instanceof CheckOZDViewActivity) {
if (mButtonStatus == R.id.btn_save || mButtonStatus == R.id.btn_close){
// 作業追加区分ありの場合
if (mAddReport) {
super.finish();
if (isError == 0) ozdCancelProcess(); // 通信成功の場合だけHTML側の処理を行う
} else {
// 作業終了する時、作業ID設定し、画面遷移処理
public void closeCurrentScreen(int operationType) {
putUserPref(AppDefType.UserPrefKey.SYNC_TARGET_OPERATION_ID, mOperationId); // 作業IDの設定
if (mAddReport) { // 作業追加あり
if (ActivityHandlingHelper.getInstance().searchOzdActivityStack()) { // OZD画面で画面遷移処理
ActivityHandlingHelper.getInstance().selectedOzdActivityClose(); // 開いてる画面を閉じる
}
} else { // 作業追加なし
if (operationType == Constant.ReportType.Report) { // 報告タイプ
if (ActivityHandlingHelper.getInstance().searchOzdActivityStack()) { // OZD画面で画面遷移処理
goToMain(); // 一覧画面に遷移
} else {
finishActivity(); // 一覧画面に遷移
}
} else { // 報告タイプ以外
if (ActivityHandlingHelper.getInstance().searchOzdActivityStack()) { // OZD画面で画面遷移処理
ActivityHandlingHelper.getInstance().selectedOzdActivityClose(); // 開いてる画面を閉じる
}
}
}
}
// ネットワークの非接続の場合の処理(OZ作業報告だけ)
protected int isNetWorkError(boolean isError) {
if (this instanceof CheckOZDViewActivity) {
return isError ? 0 : 1;
}
return 0;
}
// #32861 作業情報追加 end
}
......@@ -33,6 +33,7 @@ import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.OperationLogic;
import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.activity.ABVContentViewActivity;
import jp.agentec.abook.abv.ui.viewer.activity.CheckOZDViewActivity;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.FileUtil;
......@@ -74,6 +75,11 @@ public class ABookCheckWebViewHelper extends ABookHelper {
int taskReportSendId = 0;
mFinishCallback = finishCallback;
// ActivityであるClassからCheckOZDViewActivityを確認してContextの値を変更する。
if (ActivityHandlingHelper.getInstance().searchOzdActivityStack()) {
context = (ABVContentViewActivity) ActivityHandlingHelper.getInstance().selectedOzdAtivityContext();
}
switch (cmd) {
case ABookKeys.CMD_INSERT_TASK_REPORT:
insertOrUpdateTaskReport(taskKey, enableReportHistory, operationId, contentId, param, contentPath, true, reportType, taskReportLevel);
......@@ -163,6 +169,7 @@ public class ABookCheckWebViewHelper extends ABookHelper {
public void run() {
OperationDto operationDto = mOperationLogic.getOperation(operationId);
boolean isError = false;
try {
mOperationLogic.updateSyncOperation(operationId, true);
if (mOperationLogic.sendTaskReportSendData(operationId, taskKey, taskReportLevel, progressCallback)) {
......
......@@ -1547,7 +1547,6 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
* @param addReport
* @param taskReportLevel
*/
// #32861 作業情報追加 start
public void startOZViewerActivity(Context context, long operationId, long contentId, String taskKey, boolean isReadOnly, int taskReportId, String reportStartDate, String reportFileName, boolean localSave, boolean addReport, int taskReportLevel) {
reportStartDate = reportStartDate.replace("T", " ");
String strReportStartDate = DateTimeUtil.toString(DateTimeUtil.toDate(reportStartDate, DateTimeFormat.yyyyMMddHHmmss_hyphen), DateTimeFormat.yyyyMMddHHmm_none);
......@@ -1562,17 +1561,15 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
intent.putExtra(ABookKeys.TASK_REPORT_ID, taskReportId);
intent.putExtra(ABookKeys.REPORT_START_DATE, strReportStartDate);
intent.putExtra(ABookKeys.REPORT_FILE_NAME, reportFileName);
// #32861 作業情報追加 start
intent.putExtra(ABookKeys.LOCAL_SAVE, localSave); // 一時保存情報
intent.putExtra(ABookKeys.ADD_REPORT, addReport); // 作業追加区分
// #32861 作業情報追加 end
// #32926 作業報告画面改善 start
intent.putExtra(ABookKeys.TASK_REPORT_LEVEL, taskReportLevel); // 作業報告レベル(0:報告、1:報告(回答)、2:報告(回答))
// #32926 作業報告画面改善 end
context.startActivity(intent);
}
// #32861 作業情報追加 end
public boolean isMeetingConnected() {
return meetingManager.isConnected();
......@@ -1594,4 +1591,53 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
@Override
public void onAuthenticationFailed() {
} // ignore : not come here
// 上位のClassからHTML側のコールを行うための処理
public void callOzdHtmlScript(String url) {
if (!currentActivityStack.isEmpty()) {
for (final ABVAuthenticatedActivity activity : currentActivityStack) {
final String scriptUrl = url;
if (activity instanceof ParentWebViewActivity) {
((ParentWebViewActivity) activity).callViewLoadUrl(scriptUrl);
}
}
}
}
// ActivityであるClassからCheckOZDViewActivityを確認する処理
public boolean searchOzdActivityStack() {
if (!currentActivityStack.isEmpty()) {
for (final ABVAuthenticatedActivity activity : currentActivityStack) {
if (activity instanceof CheckOZDViewActivity) {
return true;
}
}
}
return false;
}
// ActivityであるClassからCheckOZDViewActivityを確認して画面を閉じる処理
public void selectedOzdActivityClose() {
if (!currentActivityStack.isEmpty()) {
for (final ABVAuthenticatedActivity activity : currentActivityStack) {
if (activity instanceof CheckOZDViewActivity) {
((CheckOZDViewActivity) activity).finishActivity();
}
}
}
}
// ActivityであるClassからCheckOZDViewActivityを確認してContextの値を変更する。
public Context selectedOzdAtivityContext() {
Context context = null;
if (!currentActivityStack.isEmpty()) {
for (final ABVAuthenticatedActivity activity : currentActivityStack) {
if (activity instanceof CheckOZDViewActivity) {
context = activity;
return context;
}
}
}
return context;
}
}
......@@ -27,11 +27,12 @@ public class OzdFileHelper {
/**
* OZDファイルをPDFに変換したファイルをCMSへアップロードする。
* @param pdfFile String
* @param jsonData String
*
* @param pdfFile String
* @param jsonData String
* @param contentId long
* @param objectId long
* @param sendTime String(GMT)
* @param objectId long
* @param sendTime String(GMT)
* @throws Exception
*/
public static final void sendOzdToAcms(final File pdfFile, final String jsonData, final long contentId, final long objectId, final String sendTime, final int fileType) throws AcmsException, NetworkDisconnectedException, IOException {
......@@ -48,6 +49,7 @@ public class OzdFileHelper {
/**
* 優先的なOZDファイルのフォルダを返す。
* 保存先のファイルを優先する。
*
* @param contentId
* @param ozdFileName
* @return
......@@ -63,6 +65,7 @@ public class OzdFileHelper {
/**
* OZDファイルの日付取得する。
*
* @param contentId
* @param objectId
* @return
......@@ -81,6 +84,7 @@ public class OzdFileHelper {
// GetOzdFileDateParameters parameters = new GetOzdFileDateParameters(sId, contentId, objectId);
// AcmsClient.getInstance(URL_PATH, ABVEnvironment.getInstance().networkAdapter).downloadOzdFile(parameters, outputFilePath);
}
public static final String getSaveOzFileName(boolean directionFlg, String reportFileName) {
if (reportFileName != null) {
String replacedFileName = replaceFileName(reportFileName);
......@@ -141,8 +145,8 @@ public class OzdFileHelper {
}
public static final String replaceFileName(String fileName) {
String editingName=fileName.replace("Ozr", "Ozd");
String replacedName=editingName.replace("ozr", "ozd");
String editingName = fileName.replace("Ozr", "Ozd");
String replacedName = editingName.replace("ozr", "ozd");
return replacedName;
}
......@@ -153,7 +157,7 @@ public class OzdFileHelper {
}
}
public static final String getTempTaskDirPath(long contentId, String taskKey) {
public static final String getTempTaskDirPath(long contentId, String taskKey) {
return ABVEnvironment.getInstance().getTempTaskDirPath(contentId, taskKey);
}
......@@ -167,4 +171,30 @@ public class OzdFileHelper {
}
return FileUtil.move(tempOzdFilePath, ozdFilePath, true);
}
// 削除するOZDファイルがあるかを確認する
public static final boolean checkOzFilePath(long operationId, String taskKey, int taskReportId, String reportStartDate, String reportFileName, int taskReportLevel) {
String ozdFileName = null;
if (reportFileName != null) {
ozdFileName = reportFileName;
} else {
if (taskReportLevel == 0) {
ozdFileName = DIRECTION_OZD_FILE_NAME;
} else {
ozdFileName = REPORT_OZD_FILE_NAME;
}
}
String ozFilePath = null;
if (taskReportId > 0 && !StringUtil.isNullOrEmpty(reportStartDate)) {
ozFilePath = ABVEnvironment.getInstance().getRoutineTaskSavedOzFilePath(operationId, taskKey, taskReportId, reportStartDate, ozdFileName, String.valueOf(taskReportLevel));
} else {
ozFilePath = ABVEnvironment.getInstance().getSavedOzFileTaskReportLevelPath(operationId, taskKey, ozdFileName, String.valueOf(taskReportLevel));
}
if (FileUtil.exists(ozFilePath)) {
return true;
}
return false;
}
}
\ No newline at end of file
......@@ -76,6 +76,8 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
// #32926 作業報告画面改善 start
private int mTaskReportLevel; // 作業報告レベル
boolean mIsOzFilePath; // 削除処理のフラグ
boolean mLocalSave; // 一時保存フラグ
// #32926 作業報告画面改善 end
@Override
......@@ -118,7 +120,6 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
TextView tvTitle = (TextView) findViewById(R.id.tv_title);
tvTitle.setText(frontTitle + rearTitle);
// #32861 作業情報追加 start
// OZ閲覧画面に表示するボタン表示の可否設定
// 一時保存情報についてボタン表示:「0:false、一時保存ボタン非表示」「1:ture、一時保存ボタン表示」
mLocalSave = intent.getBooleanExtra(ABookKeys.LOCAL_SAVE, false);
......@@ -129,12 +130,17 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
final Button closeButton = (Button) findViewById(R.id.btn_close);
final Button tempSaveButton = (Button) findViewById(R.id.btn_temp_save);
final Button saveButton = (Button) findViewById(R.id.btn_save);
final Button deleteButton = (Button) findViewById(R.id.btn_delete);
// 一時ボタン表示可否判断
homeButton.setVisibility(mAddReport ? View.GONE : View.VISIBLE);
closeButton.setVisibility(mAddReport ? View.VISIBLE : View.GONE);
tempSaveButton.setVisibility(mLocalSave ? View.VISIBLE : View.GONE);
// 削除ボタン表示可否判断
mIsOzFilePath = OzdFileHelper.checkOzFilePath(mOperationId, mTaskKey, mTaskReportId, mReportStartDate, mReportFileName, mTaskReportLevel);
deleteButton.setVisibility(mIsOzFilePath ? View.VISIBLE : View.GONE);
// 作業一覧へ戻るボタン
homeButton.setOnClickListener(new OnClickListener() {
@Override
......@@ -169,7 +175,15 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
showSaveConfirmAlert(R.string.save, R.string.save_info);
}
});
// #32861 作業情報追加 end
// 削除ボタン
deleteButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mButtonStatus = R.id.btn_delete; // HTML側の分岐処理を行うため変数に値を渡す
showSaveConfirmAlert(R.string.delete, R.string.delete_info);
}
});
// #32926 作業報告画面改善 start
mOzFilePath = OzdFileHelper.getOzFilePath(mOperationId, contentId, mTaskKey, mDirectionFlg, mTaskReportId, mReportStartDate, mReportFileName, mTaskReportLevel);
......@@ -301,13 +315,11 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
// #32861 作業情報追加 start
if (!mAddReport) {
if (!mAddReport) { // 作業追加区分がなしの場合
goToMain(); // 一覧画面に遷移
} else {
finishActivity(); // Ozd作業画面を閉じる
}
// #32861 作業情報追加 end
} else {
return super.onKeyUp(keyCode, event);
}
......@@ -537,7 +549,7 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
param.append("export.mode=silent#");
param.append("export.filename=" + FileUtil.getFilenameWithoutExt(mSaveOzdTempFileName) + "#");
// #32926 作業報告画面改善 start
param.append("export.path=" + OzdFileHelper.getTempTaskDirPath(contentId, mTaskKey) + "/" + mTaskReportLevel + "#");
param.append("export.path=" + OzdFileHelper.getTempTaskDirPath(contentId, mTaskKey) + "#"); //OzdFileHelper.getTempTaskDirPath(contentId, mTaskKey) + "/" + mTaskReportLevel + "#");
// #32926 作業報告画面改善 end
param.append("export.confirmsave=false#");
param.append("export.format=ozd");
......@@ -555,7 +567,6 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
return true;
}
// #32861 作業情報追加 start
// アラート表示処理
private void showSaveConfirmAlert(final int dialogTitle, int dialogMessage) {
ABookAlertDialog logoutAkert = AlertDialogUtil.createAlertDialog(this, dialogTitle);
......@@ -563,7 +574,11 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
logoutAkert.setButton(DialogInterface.BUTTON_POSITIVE, getResources().getString(R.string.confirm), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
tempSaved(); // 一時保存処理
// 削除ボタン以外には臨時保存処理を行う
if (mButtonStatus != R.id.btn_delete) {
tempSaved(); // 臨時保存処理
}
doProcess(); // HTML側の処理を行う
}
});
logoutAkert.setButton(DialogInterface.BUTTON_NEGATIVE, getResources().getString(R.string.cancel), (DialogInterface.OnClickListener) null);
......@@ -579,7 +594,5 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
return;
}
}
doProcess(); // HTML側の処理を行う
}
// #32861 作業情報追加 end
}
\ No newline at end of file
......@@ -63,7 +63,9 @@ import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
public class HTMLWebViewActivity extends ParentWebViewActivity {
private static final String TAG = "HTMLWebViewActivity";
/** Called when the activity is first created. */
/**
* Called when the activity is first created.
*/
boolean forwardCheckFlg = false;
boolean backCheckFlg = false;
......@@ -74,6 +76,7 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
private WebView webView;
private JsInf jsInf = new JsInf();
private ValueCallback<Uri[]> mUploadMessage;
@Override
public void onCreate(Bundle savedInstanceState) {
Logger.i(TAG, "onCreate");
......@@ -145,7 +148,7 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
@Override
public void onClick(View v) {
mShowedPopupWindow = new ABVPopupListWindow(HTMLWebViewActivity.this);
if (isNormalSize()) {
if (isNormalSize()) {
mShowedPopupWindow.setWidth(getRDimensionSize(R.dimen.popup_size_normal));
} else {
mShowedPopupWindow.setWidth(getRDimensionSize(R.dimen.popup_size_large));
......@@ -164,11 +167,11 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
switch (position) {
case 0 :
case 0:
// お気に入り
contentLogic.setFavoriteContent(getContentId(), !isExist);
break;
default :
default:
break;
}
mShowedPopupWindow.dismiss();
......@@ -278,7 +281,7 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
}
@Override
public void onReceivedError (WebView view, int errorCode, String description, String failingUrl) {
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
Logger.e(TAG, "onReceivedError errorCode=%s, description=%s, failingUrl=%s", errorCode, description, failingUrl);
}
......@@ -342,8 +345,7 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
Logger.d(TAG, "ReloadUrl");
if (latitude != null && longitude != null) {
webView.loadUrl(url + "&reload=true&latitude=" + latitude + "&longitude=" + longitude);
}
else {
} else {
webView.loadUrl(url + "&reload=true");
}
}
......@@ -359,7 +361,7 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
ContentDownloader.getInstance().download(contentId);
ABVToastUtil.showMakeText(getApplicationContext(), R.string.download_start, Toast.LENGTH_SHORT);
} catch (Exception e) {
Logger.e(TAG, "Download failed." ,e);
Logger.e(TAG, "Download failed.", e);
downloadButton.setEnabled(true);
handleErrorMessageToast(e);
}
......@@ -369,8 +371,7 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
downloadButton.setVisibility(View.VISIBLE);
if (isUpdate) {
downloadButton.setBackgroundResource(R.drawable.btn_update);
}
else {
} else {
downloadButton.setBackgroundResource(R.drawable.btn_download);
}
}
......@@ -411,7 +412,7 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
historyListBtn.setVisibility(View.GONE);
if(isLinkedContent) {
if (isLinkedContent) {
ContentDto contentDto = AbstractDao.getDao(ContentDao.class).getContent(contentId);
if (ContentJSON.KEY_MOVIE_TYPE.equals(contentDto.contentType) || ContentJSON.KEY_MUSIC_TYPE.equals(contentDto.contentType)
|| ContentJSON.KEY_PANO_IMAGE_TYPE.equals(contentDto.contentType) || ContentJSON.KEY_PANO_MOVIE_TYPE.equals(contentDto.contentType)
......@@ -453,8 +454,7 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
Logger.d(TAG, "existSetLocation=%s", ret);
if (ret != null && ret.equals("true")) { // setLocationメソッドが存在する場合、ページ読み込み完了とみなす
isPageFinished = true;
}
else { // 存在しない場合、ページ読み込み未完了とみなし1秒後に再度呼出しを繰り返す
} else { // 存在しない場合、ページ読み込み未完了とみなし1秒後に再度呼出しを繰り返す
handler.postDelayed(new Runnable() {
@Override
public void run() {
......@@ -478,11 +478,11 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
}
}
});
}
else {
} else {
finishActivity();
}
}
@JavascriptInterface
public void getAttachedDataUrl(String data) {
commonAttachedDataUrl(data);
......@@ -671,7 +671,7 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
}
@Override
protected void webViewLoadUrl(String url){
protected void webViewLoadUrl(String url) {
if (webView != null) {
webView.loadUrl(url);
}
......
......@@ -401,4 +401,9 @@ public class ParentWebViewActivity extends ABVContentViewActivity {
return null;
}
// 上位のClassからHTML側のコールを行うための処理
public void callViewLoadUrl(String url) {
webViewLoadUrl(url);
}
}
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