From c833f77b5dfc926d48f07c302c9fe49b3c096788 Mon Sep 17 00:00:00 2001 From: S-6203-ATLED Date: Wed, 8 Jun 2022 12:12:37 +0900 Subject: [PATCH 1/3] =?UTF-8?q?#85=20=E3=80=8CPDF=E3=82=92=E9=96=8B?= =?UTF-8?q?=E3=81=8F=E3=80=8D=E3=81=A7=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB?= =?UTF-8?q?=E5=90=8D=E3=81=8C=E6=96=87=E5=AD=97=E5=8C=96=E3=81=91=E3=80=81?= =?UTF-8?q?=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=81=8C=E9=96=8B=E3=81=91?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../agileworks/view/ui/documentweb/DocumentWebDownload.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/jp/atled/agileworks/view/ui/documentweb/DocumentWebDownload.kt b/app/src/main/java/jp/atled/agileworks/view/ui/documentweb/DocumentWebDownload.kt index 630466cb..aca7260c 100644 --- a/app/src/main/java/jp/atled/agileworks/view/ui/documentweb/DocumentWebDownload.kt +++ b/app/src/main/java/jp/atled/agileworks/view/ui/documentweb/DocumentWebDownload.kt @@ -199,7 +199,7 @@ class DocumentWebDownloader(private val handlingFragment: Fragment, private val if (it is HttpURLConnection) { val serverHost = LoginRepository().loadServerUrl() // セッション情報を外に漏らさないよう、 url のホストとパスを確認。 - if ((url.host == serverHost) && url.path.contains("/Broker/Download")) { + if ((url.host == serverHost) && (url.path.contains("/Broker/Download") || url.path.contains("/Broker/WebForm"))) { it.setRequestProperty("Cookie", "JSESSIONID=$sessionId") } } @@ -246,7 +246,11 @@ object DownloadHelper { .toMap() val fileNameStar = params["filename"]?.let { tryParseFileNameStar(it) } return if (fileNameStar.isNullOrEmpty()) { - params["filename"]?.let { decodeBase64(it) } + if (params["filename"].equals("WebForm")){ + params["filename"] + } else { + params["filename"]?.let { decodeBase64(it) } + } } else { fileNameStar } -- GitLab From 8cb2d2f418d004a69e5fe17eceb8e3e15a431b78 Mon Sep 17 00:00:00 2001 From: S-6203-ATLED Date: Wed, 8 Jun 2022 14:01:24 +0900 Subject: [PATCH 2/3] =?UTF-8?q?#85=20=E4=B8=8D=E8=A6=81=E3=81=AA=E3=82=AF?= =?UTF-8?q?=E3=83=A9=E3=82=B9=E5=A4=89=E6=95=B0=E3=80=81=E3=82=AA=E3=83=96?= =?UTF-8?q?=E3=82=B8=E3=82=A7=E3=82=AF=E3=83=88=E3=81=AE=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../view/ui/documentweb/DocumentWebClient.kt | 9 ----- .../view/ui/documentweb/DocumentWebShare.kt | 33 +------------------ 2 files changed, 1 insertion(+), 41 deletions(-) diff --git a/app/src/main/java/jp/atled/agileworks/view/ui/documentweb/DocumentWebClient.kt b/app/src/main/java/jp/atled/agileworks/view/ui/documentweb/DocumentWebClient.kt index 3e3ad9d2..14e84188 100644 --- a/app/src/main/java/jp/atled/agileworks/view/ui/documentweb/DocumentWebClient.kt +++ b/app/src/main/java/jp/atled/agileworks/view/ui/documentweb/DocumentWebClient.kt @@ -26,12 +26,6 @@ class DocumentWebViewClient(private val webShare: DocumentWebShare): WebViewClie override fun onPageFinished(view: WebView?, url: String?) { super.onPageFinished(view, url) webShare.presenter.hideLoadingProgressBar() - if ((view != null) && (url != null) && FORM_URL_PATTERN.containsMatchIn(url)) { - webShare.history.putHistoryIndex(view.copyBackForwardList().currentIndex) - webShare.inDocumentView = true - } else { - webShare.inDocumentView = false - } webShare.presenter.updateAutoReloadState(false) } @@ -82,9 +76,6 @@ class DocumentWebViewClient(private val webShare: DocumentWebShare): WebViewClie // ネットワーク切断時Viewを表示する必要があるか設定する(URL変更時) url?.let { webShare.presenter.updateDisconnectViewDisplayState(it) } } - companion object { - private val FORM_URL_PATTERN = Regex("/xpoint/form\\.do\\b") - } } /** diff --git a/app/src/main/java/jp/atled/agileworks/view/ui/documentweb/DocumentWebShare.kt b/app/src/main/java/jp/atled/agileworks/view/ui/documentweb/DocumentWebShare.kt index c92bc7c5..3f306ac3 100644 --- a/app/src/main/java/jp/atled/agileworks/view/ui/documentweb/DocumentWebShare.kt +++ b/app/src/main/java/jp/atled/agileworks/view/ui/documentweb/DocumentWebShare.kt @@ -6,36 +6,5 @@ package jp.atled.agileworks.view.ui.documentweb * @param presenter 各種表示を担当するインスタンス * @param downloader ファイルのダウンロードを担当するインスタンス */ -class DocumentWebShare(val presenter: DocumentWebPresenter, val downloader: DocumentWebDownloader) { - /** 今見ているページは書類ビューか */ - var inDocumentView = false - /** 履歴インデックス管理 */ - val history = DocumentWebHistory() -} +class DocumentWebShare(val presenter: DocumentWebPresenter, val downloader: DocumentWebDownloader) -/** - * 関連書類などから前のページに戻れるように履歴のインデックスを管理するクラス。 - */ -class DocumentWebHistory { - // 次に詰まれたインデックスを新しい履歴用インデックスとして管理するか。 - // false の場合、indexStack に必ずひとつ以上の要素がなければならない。 - private var waitingNewPage = true - // 履歴インデックス (WebBackForwardList から得られるインデックス) のスタック。各要素が戻るべきインデックス。 - private val indexStack = mutableListOf() - - /** - * 指定されたインデックスを戻るべきインデックスとして設定する。 - * - * 新規ページを待っている場合は新しい要素としてそのインデックスを積み、そうでなければ最新の要素を上書きする。 - * - * @param index 新たに設定するインデックス - */ - fun putHistoryIndex(index: Int) { - if (waitingNewPage) { - indexStack.add(index) - waitingNewPage = false - } else { - indexStack[indexStack.lastIndex] = index - } - } -} -- GitLab From bd9b28a2cec905c92a85a91b78f0aeaf418af7da Mon Sep 17 00:00:00 2001 From: S-6203-ATLED Date: Thu, 9 Jun 2022 12:24:27 +0900 Subject: [PATCH 3/3] =?UTF-8?q?#89=20PDF=E3=82=92=E9=96=8B=E3=81=8F?= =?UTF-8?q?=E3=80=81=E3=81=A7=E9=96=8B=E3=81=8F=E9=9A=9B=E3=81=AE=E5=87=A6?= =?UTF-8?q?=E7=90=86=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/documentweb/DocumentWebDownload.kt | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/jp/atled/agileworks/view/ui/documentweb/DocumentWebDownload.kt b/app/src/main/java/jp/atled/agileworks/view/ui/documentweb/DocumentWebDownload.kt index aca7260c..63f4605d 100644 --- a/app/src/main/java/jp/atled/agileworks/view/ui/documentweb/DocumentWebDownload.kt +++ b/app/src/main/java/jp/atled/agileworks/view/ui/documentweb/DocumentWebDownload.kt @@ -195,12 +195,17 @@ class DocumentWebDownloader(private val handlingFragment: Fragment, private val */ private fun openDownloadConnection(urlString: String, sessionId: String): URLConnection { val url = URL(urlString) + val urlPath = listOf("/Broker/Download","/Broker/WebForm") return url.openConnection().also { if (it is HttpURLConnection) { val serverHost = LoginRepository().loadServerUrl() // セッション情報を外に漏らさないよう、 url のホストとパスを確認。 - if ((url.host == serverHost) && (url.path.contains("/Broker/Download") || url.path.contains("/Broker/WebForm"))) { - it.setRequestProperty("Cookie", "JSESSIONID=$sessionId") + if (url.host == serverHost) { + urlPath.forEach { p -> + if (url.path.contains(p)){ + it.setRequestProperty("Cookie", "JSESSIONID=$sessionId") + } + } } } if (it is HttpsURLConnection) { @@ -246,10 +251,12 @@ object DownloadHelper { .toMap() val fileNameStar = params["filename"]?.let { tryParseFileNameStar(it) } return if (fileNameStar.isNullOrEmpty()) { - if (params["filename"].equals("WebForm")){ - params["filename"] - } else { - params["filename"]?.let { decodeBase64(it) } + params["filename"]?.let { + if (it.startsWith("\"=?UTF-8?B?")){ + decodeBase64(it) + } else { + it + } } } else { fileNameStar -- GitLab