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
62397df1
Commit
62397df1
authored
Jun 12, 2020
by
Kim Jinsung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ベースシーンとシーン登録処理追加
parent
cc209be0
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
124 additions
and
13 deletions
+124
-13
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/AcmsClient.java
+3
-5
ABVJE_BL/src/jp/agentec/abook/abv/bl/common/constant/ABookKeys.java
+1
-0
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/OperationLogic.java
+2
-3
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/util/AlertDialogUtil.java
+15
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/OperationListActivity.java
+0
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/DeviceImageListActivity.java
+0
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/ParentWebViewActivity.java
+1
-1
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/adapter/ImageGalleryAdapter.java
+14
-4
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/helper/SceneSendHelper.java
+88
-0
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/acms/client/AcmsClient.java
View file @
62397df1
...
...
@@ -616,21 +616,19 @@ public class AcmsClient implements AcmsClientResponseListener {
/**
* パノラマで使用するシーンを登録
* @param sid
* @param contentId
* @param FormFile シーンで使用する画像
* @return
* @throws IOException
* @throws AcmsException
*/
public
SceneEntryJSON
sceneEntry
(
String
sid
,
Long
contentId
,
File
FormFile
)
throws
IOException
,
AcmsException
,
NetworkDisconnectedException
{
public
SceneEntryJSON
sceneEntry
(
String
sid
,
File
FormFile
)
throws
IOException
,
AcmsException
,
NetworkDisconnectedException
{
if
(
networkAdapter
!=
null
&&
!
networkAdapter
.
isNetworkConnected
())
{
// NWのチェック
throw
new
NetworkDisconnectedException
();
}
String
apiUrl
=
AcmsApis
.
getApiUrl
(
env
.
acmsAddress
,
urlPath
,
AcmsApis
.
ApiSceneEntry
);
HttpMultipart
part1
=
new
HttpMultipart
(
ABookKeys
.
SID
,
sid
);
HttpMultipart
part2
=
new
HttpMultipart
(
ABookKeys
.
CONTENT_ID
,
StringUtil
.
toString
(
contentId
));
HttpMultipart
part3
=
new
HttpMultipart
(
ABookKeys
.
FORM_FILE
,
FormFile
);
HttpResponse
result
=
HttpRequestSender
.
post
(
apiUrl
,
new
HttpMultipart
[]{
part1
,
part2
,
part3
});
HttpMultipart
part2
=
new
HttpMultipart
(
ABookKeys
.
FORM_FILE
,
FormFile
);
HttpResponse
result
=
HttpRequestSender
.
post
(
apiUrl
,
new
HttpMultipart
[]{
part1
,
part2
});
SceneEntryJSON
json
=
new
SceneEntryJSON
(
result
.
httpResponseBody
);
if
(
json
.
httpStatus
!=
200
)
{
if
(
json
.
errorMessage
!=
null
)
{
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/common/constant/ABookKeys.java
View file @
62397df1
...
...
@@ -129,6 +129,7 @@ public class ABookKeys {
public
static
final
String
EDITABLE
=
"editable"
;
//commonAttachedDataUrl()で編集可否を判別するパラメタをWebからもらう。
public
static
final
String
FILE_PATH
=
"filePath"
;
//再編集する場合、クリックしたイマージのパスのパラメタ
public
static
final
String
BASE_CONTENT_REGISTER
=
"BaseContentRegister"
;
//THETA端末関連
public
static
final
String
THETA_FILE_ID
=
"OBJECT_ID"
;
public
static
final
String
THETA_THUMBNAIL
=
"THUMBNAIL"
;
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/logic/OperationLogic.java
View file @
62397df1
...
...
@@ -1380,12 +1380,11 @@ public class OperationLogic extends AbstractLogic {
/**
* シーンの登録
* @param file
* @param contentId
* @throws IOException
* @throws AcmsException
*/
public
Integer
sendScene
(
File
file
,
Long
contentId
)
throws
IOException
,
AcmsException
,
NetworkDisconnectedException
{
SceneEntryJSON
json
=
AcmsClient
.
getInstance
(
cache
.
getUrlPath
(),
networkAdapter
).
sceneEntry
(
cache
.
getMemberInfo
().
sid
,
contentId
,
file
);
public
Integer
sendScene
(
File
file
)
throws
IOException
,
AcmsException
,
NetworkDisconnectedException
{
SceneEntryJSON
json
=
AcmsClient
.
getInstance
(
cache
.
getUrlPath
(),
networkAdapter
).
sceneEntry
(
cache
.
getMemberInfo
().
sid
,
file
);
return
json
.
resourceId
;
}
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/util/AlertDialogUtil.java
View file @
62397df1
...
...
@@ -44,6 +44,21 @@ public class AlertDialogUtil {
}
/**
* 共通ダイアログ表示用(OKボタンコールバック、CANCELボタンコールバック)
* @param context コンテキスト
* @param title タイトル
* @param message メッセージ
* @param okOnClick OKボタンコールバック
* @param okOnClick CANCELボタンコールバック
*/
public
static
void
showAlertDialog
(
Context
context
,
int
title
,
int
message
,
DialogInterface
.
OnClickListener
okOnClick
,
DialogInterface
.
OnClickListener
canOnClick
)
{
ABookAlertDialog
alertDialog
=
createAlertDialog
(
context
,
context
.
getResources
().
getString
(
title
),
context
.
getResources
().
getString
(
message
));
alertDialog
.
setNegativeButton
(
R
.
string
.
cancel
,
canOnClick
);
alertDialog
.
setPositiveButton
(
R
.
string
.
ok
,
okOnClick
);
alertDialog
.
show
();
}
/**
* 共通ダイアログ表示用(Cancel表示・非表示、OKボタンコールバック)
* @param context コンテキスト
* @param title タイトル
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/OperationListActivity.java
View file @
62397df1
This diff is collapsed.
Click to expand it.
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/DeviceImageListActivity.java
View file @
62397df1
This diff is collapsed.
Click to expand it.
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/ParentWebViewActivity.java
View file @
62397df1
...
...
@@ -94,7 +94,7 @@ public class ParentWebViewActivity extends ABVContentViewActivity {
if
(
helper
.
checkMultiPermissions
(
true
))
{
//シーン画像選択画面表示
Intent
intent
=
new
Intent
();
intent
.
putExtra
(
ABookKeys
.
CONTENT_ID
,
contentId
);
intent
.
putExtra
(
ABookKeys
.
BASE_CONTENT_REGISTER
,
false
);
String
className
=
DeviceImageListActivity
.
class
.
getName
();
if
(
isNormalSize
()
==
false
)
{
className
+=
"Dialog"
;
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/adapter/ImageGalleryAdapter.java
View file @
62397df1
...
...
@@ -18,11 +18,12 @@ public class ImageGalleryAdapter extends BaseAdapter {
LayoutInflater
inflater
;
List
<
CustomImage
>
imageUriList
;
int
mRowHeight
;
public
ImageGalleryAdapter
(
Context
context
,
List
<
CustomImage
>
imageUriList
,
int
rowHeight
)
{
boolean
isBaseSceneUpload
;
public
ImageGalleryAdapter
(
Context
context
,
List
<
CustomImage
>
imageUriList
,
int
rowHeight
,
boolean
isBaseSceneUpload
)
{
this
.
context
=
context
;
this
.
imageUriList
=
imageUriList
;
this
.
mRowHeight
=
rowHeight
;
this
.
isBaseSceneUpload
=
isBaseSceneUpload
;
inflater
=
(
LayoutInflater
)
context
.
getSystemService
(
Context
.
LAYOUT_INFLATER_SERVICE
);
}
...
...
@@ -59,10 +60,19 @@ public class ImageGalleryAdapter extends BaseAdapter {
CustomImage
customImage
=
getItem
(
position
);
boolean
isSelected
=
((
DeviceImageListActivity
)
context
).
containsCustomImageUri
(
customImage
.
mUri
);
holder
.
mThumbnailSelected
.
setImageResource
(
R
.
drawable
.
check_mark
);
holder
.
mThumbnailSelected
.
setVisibility
(
View
.
INVISIBLE
);
//ベースシーンチェック画像設定
if
(
isBaseSceneUpload
)
{
boolean
isFirstImage
=
((
DeviceImageListActivity
)
context
).
firstCustomImageUri
(
customImage
.
mUri
);
if
(
isFirstImage
)
{
holder
.
mThumbnailSelected
.
setImageResource
(
R
.
drawable
.
icon_base_content_check
);
}
}
if
(
isSelected
)
{
holder
.
mThumbnailSelected
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
holder
.
mThumbnailSelected
.
setVisibility
(
View
.
INVISIBLE
);
}
if
(
holder
.
customImage
==
null
||
!
holder
.
customImage
.
mUri
.
equals
(
customImage
.
mUri
))
{
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/helper/SceneSendHelper.java
0 → 100644
View file @
62397df1
package
jp
.
agentec
.
abook
.
abv
.
ui
.
viewer
.
helper
;
import
android.content.Context
;
import
java.io.File
;
import
java.util.ArrayList
;
import
java.util.List
;
import
jp.agentec.abook.abv.bl.common.CommonExecutor
;
import
jp.agentec.abook.abv.bl.common.exception.ABVExceptionCode
;
import
jp.agentec.abook.abv.bl.common.exception.AcmsException
;
import
jp.agentec.abook.abv.bl.common.log.Logger
;
import
jp.agentec.abook.abv.bl.logic.AbstractLogic
;
import
jp.agentec.abook.abv.bl.logic.OperationLogic
;
import
jp.agentec.abook.abv.launcher.android.R
;
/**
* シーン画像ファイルをサーバへ登録する処理クラス
*/
public
class
SceneSendHelper
{
private
static
final
String
TAG
=
"DeviceImageListHelper"
;
private
SceneSendHelper
.
DeviceImageListSendListener
listener
;
private
Context
mContext
;
public
SceneSendHelper
(
Context
context
)
{
mContext
=
context
;
}
public
void
setListener
(
SceneSendHelper
.
DeviceImageListSendListener
listener
)
{
this
.
listener
=
listener
;
}
public
interface
DeviceImageListSendListener
{
void
sceneSendfinish
();
void
changeProgress
(
final
int
progress
);
void
sceneSendFail
(
final
String
errorMessage
);
void
sceneSendFailRetry
(
List
<
String
>
retrySendImages
);
}
/**
* シーン画像をサーバへ送信
* @param sendImages シーン画像ファイルPath配列
* @param operationId 作業ID
* @param OperationName 作業名
* @param isBaseSceneUpload ベースシーン登録フラグ(true:登録、false:登録しない)
*/
public
void
sendSceneImages
(
final
List
<
String
>
sendImages
,
final
Long
operationId
,
final
String
OperationName
,
final
boolean
isBaseSceneUpload
)
{
CommonExecutor
.
execute
(
new
Runnable
()
{
@Override
public
void
run
()
{
String
firstFilePath
=
sendImages
.
get
(
0
);
final
List
<
String
>
needSendImages
=
new
ArrayList
<>(
sendImages
);
for
(
String
filePath
:
sendImages
){
File
file
=
new
File
(
filePath
);
try
{
if
(
isBaseSceneUpload
&&
firstFilePath
.
equals
(
filePath
))
{
AbstractLogic
.
getLogic
(
OperationLogic
.
class
).
sendPanoContent
(
operationId
,
OperationName
,
file
);
}
else
{
AbstractLogic
.
getLogic
(
OperationLogic
.
class
).
sendScene
(
file
);
}
needSendImages
.
remove
(
filePath
);
//プログレスバー進捗
int
progress
=
(
int
)
(((
float
)(
sendImages
.
size
()
-
needSendImages
.
size
())
/
sendImages
.
size
())
*
100
);
listener
.
changeProgress
(
progress
);
//送信終了
if
(
needSendImages
.
size
()
==
0
)
{
listener
.
sceneSendfinish
();
}
}
catch
(
AcmsException
ex
)
{
Logger
.
e
(
TAG
,
ex
);
if
(
ex
.
getCode
()
==
ABVExceptionCode
.
P_E_ACMS_P007
)
{
listener
.
sceneSendFail
(
mContext
.
getString
(
R
.
string
.
error_msg_open_pano_edit
));
}
else
{
listener
.
sceneSendFailRetry
(
needSendImages
);
}
break
;
}
catch
(
Exception
e
)
{
Logger
.
e
(
TAG
,
e
);
listener
.
sceneSendFailRetry
(
needSendImages
);
break
;
}
}
}
});
}
}
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