Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abook_check
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abook_android
abook_check
Commits
9602ed02
Commit
9602ed02
authored
Apr 15, 2022
by
onuma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#46980 通信処理をAcmsClientに移動。
parent
058b4364
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
38 deletions
+27
-38
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/AcmsClient.java
+15
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/ContractLogic.java
+2
-19
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/LoginActivity.java
+10
-19
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/AcmsClient.java
View file @
9602ed02
...
...
@@ -9,6 +9,7 @@ import java.util.ArrayList;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Locale
;
import
java.util.Observer
;
import
jp.agentec.abook.abv.bl.acms.client.json.AcmsBooleanResultJSON
;
...
...
@@ -45,6 +46,7 @@ import jp.agentec.abook.abv.bl.acms.client.json.RoomListJSON;
import
jp.agentec.abook.abv.bl.acms.client.json.SceneEntryJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.ServerTimeZoneJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.ServiceOptionsJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.TermsOfUseJson
;
import
jp.agentec.abook.abv.bl.acms.client.json.UnreadCountJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.UserInviteResultJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.WorkerGroupJSON
;
...
...
@@ -1097,6 +1099,19 @@ public class AcmsClient implements AcmsClientResponseListener {
HttpResponse
response
=
send
(
AcmsApis
.
ApiDeleteProcess
,
params
);
validateHttpResponse
(
response
,
AcmsApis
.
ApiGetPushMessages
);
}
/**
* 利用規約に同意するかの文言を取得します
* @param url 取得するためのURL
* @return 文言を格納したJSON
*/
public
TermsOfUseJson
getTermsOfServiceText
(
String
url
)
throws
NetworkDisconnectedException
,
AcmsException
{
String
requestUrl
=
url
+
"?language="
+
Locale
.
getDefault
().
getLanguage
();
HttpResponse
response
=
AcmsClient
.
getInstance
(
ABVEnvironment
.
getInstance
().
networkAdapter
).
send
(
requestUrl
,
""
,
null
);
return
new
TermsOfUseJson
(
response
.
httpResponseBody
);
}
/**********************************************************************************************/
/** 以下、共用メソッド---------------------------------------------------------------------- **/
/**********************************************************************************************/
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/ContractLogic.java
View file @
9602ed02
package
jp
.
agentec
.
abook
.
abv
.
bl
.
logic
;
import
org.json.adf.JSONObject
;
import
java.io.BufferedReader
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStreamReader
;
import
java.net.HttpURLConnection
;
import
java.net.URL
;
import
java.util.List
;
import
java.util.Locale
;
import
jp.agentec.abook.abv.bl.acms.client.AcmsClient
;
import
jp.agentec.abook.abv.bl.acms.client.json.TermsOfUseJson
;
...
...
@@ -25,8 +16,6 @@ import jp.agentec.abook.abv.bl.data.dao.AcmsDao;
import
jp.agentec.abook.abv.bl.data.dao.ServiceOptionDao
;
import
jp.agentec.abook.abv.bl.dto.AcmsDto
;
import
jp.agentec.abook.abv.bl.dto.ServiceOptionDto
;
import
jp.agentec.adf.net.http.HttpRequestSender
;
import
jp.agentec.adf.net.http.HttpResponse
;
import
jp.agentec.adf.util.NumericUtil
;
import
jp.agentec.adf.util.StringUtil
;
...
...
@@ -373,15 +362,9 @@ public class ContractLogic extends AbstractLogic {
* @return 取得した文字列(失敗したらnullが返る)
*/
public
String
getTermsOfServiceText
(
String
url
)
{
String
requestUrl
=
url
+
"?language="
+
Locale
.
getDefault
().
getLanguage
();
try
{
HttpResponse
response
=
AcmsClient
.
getInstance
(
ABVEnvironment
.
getInstance
().
networkAdapter
).
send
(
requestUrl
,
""
,
null
);
TermsOfUseJson
resultJson
=
new
TermsOfUseJson
(
response
.
httpResponseBody
);
return
resultJson
.
message
;
}
catch
(
NetworkDisconnectedException
e
)
{
Logger
.
e
(
TAG
,
""
+
e
);
}
catch
(
AcmsException
e
)
{
Logger
.
e
(
TAG
,
""
+
e
);
TermsOfUseJson
response
=
AcmsClient
.
getInstance
(
ABVEnvironment
.
getInstance
().
networkAdapter
).
getTermsOfServiceText
(
url
);
return
response
.
message
;
}
catch
(
Exception
e
)
{
Logger
.
e
(
TAG
,
""
+
e
);
}
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/LoginActivity.java
View file @
9602ed02
...
...
@@ -21,16 +21,6 @@ import android.widget.ImageButton;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
org.json.adf.JSONObject
;
import
java.io.BufferedReader
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStreamReader
;
import
java.net.HttpURLConnection
;
import
java.net.URL
;
import
java.util.Locale
;
import
jp.agentec.abook.abv.bl.acms.client.json.CmsUrlJSON
;
import
jp.agentec.abook.abv.bl.acms.type.DeleteDataType
;
import
jp.agentec.abook.abv.bl.acms.type.LoginMode
;
...
...
@@ -57,7 +47,6 @@ import jp.agentec.abook.abv.bl.dto.MemberInfoDto;
import
jp.agentec.abook.abv.bl.dto.PasswordLockInfoDto
;
import
jp.agentec.abook.abv.bl.logic.AbstractLogic
;
import
jp.agentec.abook.abv.bl.logic.CommunicationLogic
;
import
jp.agentec.abook.abv.bl.logic.ContentLogic
;
import
jp.agentec.abook.abv.bl.logic.ContractLogic
;
import
jp.agentec.abook.abv.bl.logic.OperationLogic
;
import
jp.agentec.abook.abv.bl.logic.UserAuthenticateLogic
;
...
...
@@ -73,9 +62,6 @@ import jp.agentec.abook.abv.ui.common.constant.ErrorMessage;
import
jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog
;
import
jp.agentec.abook.abv.ui.common.helper.ABVViewUnbindHelper
;
import
jp.agentec.abook.abv.ui.common.util.AlertDialogUtil
;
import
jp.agentec.adf.net.http.HttpRequestSender
;
import
jp.agentec.adf.net.http.HttpResponse
;
import
jp.agentec.adf.util.NumericUtil
;
import
jp.agentec.adf.util.StringUtil
;
/**
...
...
@@ -115,7 +101,6 @@ public class LoginActivity extends ABVLoginActivity {
private
Button
btnLoginOn
;
private
Button
btnDetail
;
private
CheckBox
chexBoxAgree
;
private
String
termsOfUseText
=
""
;
private
static
String
termsOfUseUrl
=
ABVEnvironment
.
getInstance
().
agree_to_terms_of_use_url
;
@Override
...
...
@@ -183,6 +168,12 @@ public class LoginActivity extends ABVLoginActivity {
// 非活性化したログインボタン
btnLoginOff
=
findViewById
(
R
.
id
.
btn_login_off
);
btnLoginOff
.
setVisibility
(
View
.
VISIBLE
);
btnLoginOff
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
tryLogin
();
}
});
// チェックボックス
chexBoxAgree
=
findViewById
(
R
.
id
.
check_box_agree
);
...
...
@@ -278,17 +269,17 @@ public class LoginActivity extends ABVLoginActivity {
@Override
public
void
run
()
{
// CMSより文言を取得し、ダイアログで表示する。
ContractLogic
logic
=
AbstractLogic
.
getLogic
(
ContractLogic
.
class
);
String
language
=
Locale
.
getDefault
().
getLanguage
();
termsOfUseText
=
logic
.
getTermsOfServiceText
(
termsOfUseUrl
);
final
String
termsOfUseText
=
contractLogic
.
getTermsOfServiceText
(
termsOfUseUrl
);
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
String
title
=
getString
(
R
.
string
.
error
);
String
messageText
=
getString
(
R
.
string
.
err_gert_term_of_use_text
);
if
(
termsOfUseText
!=
null
)
{
title
=
getString
(
R
.
string
.
detail
);
messageText
=
termsOfUseText
;
}
AlertDialogUtil
.
showAlertDialog
(
LoginActivity
.
this
,
getString
(
R
.
string
.
error
)
,
messageText
,
true
,
new
DialogInterface
.
OnClickListener
()
{
AlertDialogUtil
.
showAlertDialog
(
LoginActivity
.
this
,
title
,
messageText
,
true
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
dialog
.
dismiss
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment