Commit e5e8fc96 by Lee Jaebin

サイネージ削除

parent ba672004
......@@ -23,10 +23,8 @@ import jp.agentec.abook.abv.bl.acms.client.json.ContentVersionsJSON;
import jp.agentec.abook.abv.bl.acms.client.json.DashboardsJSON;
import jp.agentec.abook.abv.bl.acms.client.json.GetBackupFileListJSON;
import jp.agentec.abook.abv.bl.acms.client.json.GroupsJSON;
import jp.agentec.abook.abv.bl.acms.client.json.KTLoginJSON;
import jp.agentec.abook.abv.bl.acms.client.json.LogSendFlagJSON;
import jp.agentec.abook.abv.bl.acms.client.json.NewAppStoreLoginJSON;
import jp.agentec.abook.abv.bl.acms.client.json.PoscoLoginJSON;
import jp.agentec.abook.abv.bl.acms.client.json.ReaderShareUrlJSON;
import jp.agentec.abook.abv.bl.acms.client.json.RequirePasswordChangeJSON;
import jp.agentec.abook.abv.bl.acms.client.json.ResultJSON;
......@@ -58,10 +56,8 @@ import jp.agentec.abook.abv.bl.acms.client.parameters.GetContentParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.GetEnqueteReplyParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.GetProjectDataParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.GetTaskFileParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.KTLoginParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.NewAppStoreLoginParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.PasswordChangeParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.PoscoLoginParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.PostEnqueteReplyParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.ReaderShareParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.SendPushMessageParameters;
......@@ -210,58 +206,6 @@ public class AcmsClient implements AcmsClientResponseListener {
return login(param, dto, json);
}
/**
* 韓国のPOSCO社専用のログインメソッドです。
* @param param {@link EnterpriseLoginParameters} オブジェクトです。
* @return ユーザ情報を格納した {@link MemberInfoDto} オブジェクトを返します。ログイン失敗の場合はnullを返します。
*/
public MemberInfoDto poscoLogin(PoscoLoginParameters param) throws NetworkDisconnectedException, ABVException {
HttpResponse response = send(AcmsApis.ApiUrlPoscoLogin, param);
PoscoLoginJSON json = new PoscoLoginJSON(response.httpResponseBody);
lastPresentTime = json.presentTime;
MemberInfoDto dto = null;
if (json.result) {
dto = new MemberInfoDto();
dto.sid = json.sid;
dto.loginId = param.getLoginId();
dto.lastLoginDate = json.presentTime;
dto.requiredPasswordChange = RequirePasswordChangeCode.None;
dto.loginStatus = LoginStatus.LoggedIn.statusCode();
dto.invalidPasswordCount = (short) 0;
}
return dto;
}
public MemberInfoDto ktLogin(KTLoginParameters param) throws NetworkDisconnectedException, ABVException {
HttpResponse response = send(AcmsApis.ApiUrlKtLogin, param);
KTLoginJSON json = new KTLoginJSON(response.httpResponseBody);
lastPresentTime = json.presentTime;
MemberInfoDto dto = null;
if (json.result) {
dto = new MemberInfoDto();
dto.sid = json.sid;
dto.loginId = param.getUid(); // IDがないため、UUIDを保存
dto.lastLoginDate = json.presentTime;
dto.requiredPasswordChange = RequirePasswordChangeCode.None;
dto.loginStatus = LoginStatus.LoggedIn.statusCode();
dto.invalidPasswordCount = (short) 0;
dto.password = "password";
}
return dto;
}
private <P extends AbstractAcmsLoginParameters, J extends NewAppStoreLoginJSON> MemberInfoDto login(P param, MemberInfoDto dto, J json)
throws NetworkDisconnectedException, ABVException {
dto.sid = json.sid;
......@@ -750,14 +694,6 @@ public class AcmsClient implements AcmsClientResponseListener {
return json.dashboardList;
}
public String getScheduleList(FetchDateParameters param) throws AcmsException, NetworkDisconnectedException {
HttpResponse response = send(AcmsApis.ApiUrlScheduleList, param);
if (response.httpResponseCode == 304) {
return HttpResponse.NO_CHANGE;
}
return response.httpResponseBody;
}
//天気予報の情報を取得
public String getWeatherInfor(AcmsParameters param ) throws AcmsException, NetworkDisconnectedException {
HttpResponse response = send(AcmsApis.ApiGetWeather, param);
......
package jp.agentec.abook.abv.bl.acms.client.json;
import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.common.exception.JSONValidationException;
import jp.agentec.adf.util.StringUtil;
import org.json.adf.JSONObject;
public class KTLoginJSON extends AcmsBooleanResultJSON {
public static final String Sid = "sid";
public static final String UserName = "userName";
public String sid;
public String userName;
public KTLoginJSON(String jsonString) throws AcmsException {
super(jsonString);
}
@Override
protected void parse(JSONObject json) throws JSONValidationException {
super.parse(json);
sid = getString(json, Sid);
userName = getString(json, UserName, StringUtil.Empty);
}
}
package jp.agentec.abook.abv.bl.acms.client.json;
import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.common.exception.JSONValidationException;
import org.json.adf.JSONObject;
/**
* poscoLogin API에서 리턴되는 JSON을 해석하는 기능을 제공합니다.
* @author Taejin Hong
* @version 1.0.0
*/
public class PoscoLoginJSON extends AcmsBooleanResultJSON {
public static final String Sid = "sid";
public String sid;
/**
* {@link PoscoLoginJSON} 클래스의 인스턴스를 생성합니다.
* @param jsonString 해석할 JSON문자열입니다.
*/
public PoscoLoginJSON(String jsonString) throws AcmsException {
super(jsonString);
}
@Override
protected void parse(JSONObject json) throws JSONValidationException {
super.parse(json);
sid = getString(json, Sid);
}
}
package jp.agentec.abook.abv.bl.acms.client.json;
import java.util.ArrayList;
import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.common.util.JsonUtil;
import jp.agentec.abook.abv.bl.data.ABVDataCache;
import jp.agentec.abook.abv.bl.dto.ContentDto;
import jp.agentec.abook.abv.bl.dto.InteractiveInfoDto;
import jp.agentec.abook.abv.bl.dto.PlaylistDetailDto;
import jp.agentec.abook.abv.bl.dto.PlaylistDto;
import jp.agentec.abook.abv.bl.dto.ScheduleDto;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
import org.json.adf.JSONArray;
import org.json.adf.JSONObject;
public class ScheduleJSON extends AcmsCommonJSON {
// スケジュール関連
public static final String ScheduleList = "scheduleList";
public static final String ScheduleId = "scheduleId";
public static final String Start = "start";
public static final String End = "end";
public static final String ContentIds = "contentIds";
public static final String PlayListIds = "playListIds";
public static final String DefaultScheduleFlag = "defaultScheduleFlag";
// プレイリスト関連
public static final String PlayList = "playList";
public static final String PlayListId = "playListId";
public static final String PlayListName = "playListName";
public static final String UpdateDate = "updateDate";
public static final String TelopSpeed = "telopSpeed";
public static final String TelopImage = "telopImage";
public static final String ShowWeather = "showWeather";
public static final String Contents = "contents";
public static final String ContentId = "contentId";
public static final String DispOrder = "dispOrder";
public static final String Sliede = "slide";
public static final String Stay = "stay";
// インタラクティブ情報関連
public static final String InteractiveInfo = "interactiveInfo";
public static final String DstContentId = "dstContentId";
public static final String Mapping = "mapping";
// コンテンツ関連
public static final String ContentList = "contentList";
public static final String ContentName = "contentName";
public static final String ContractContentId = "contractContentId";
public ArrayList<ScheduleDto> scheduleList;
public ArrayList<PlaylistDto> playlistList;
public ArrayList<PlaylistDetailDto> playlistDetailList;
public ArrayList<InteractiveInfoDto> interactiveInfoList;
public ArrayList<ContentDto> contentList;
public ScheduleJSON(String jsonString) throws AcmsException {
super(jsonString);
}
@Override
protected void parse(JSONObject json) {
// スケジュール
JSONArray schedules = json.getJSONArray(ScheduleList);
scheduleList = new ArrayList<ScheduleDto>();
for (int i = 0; i < schedules.length(); i++) {
JSONObject schedule = schedules.getJSONObject(i);
ScheduleDto dto = new ScheduleDto();
dto.start = DateTimeUtil.toDate(schedule.getString(Start), DateTimeFormat.yyyyMMddHHmmss_slash);
dto.end = DateTimeUtil.toDate(schedule.getString(End), DateTimeFormat.yyyyMMddHHmmss_slash);
dto.defaultScheduleFlag = (JsonUtil.getInt(schedule, DefaultScheduleFlag) != 0);
JSONArray playListId = schedule.getJSONArray(PlayListIds);
for (int j = 0; j < playListId.length(); j++) {
// プレイリストは最大で2つまで設定できるのでメイン、サブのplaylistIdを順番に設定する
if (j == 0) {
dto.playlistId = playListId.getInt(j);
} else if (j == 1) {
dto.subPlaylistId = playListId.getInt(j);
}
}
scheduleList.add(dto);
}
// プレイリスト
JSONArray playLists = json.getJSONArray(PlayList);
playlistList = new ArrayList<PlaylistDto>();
playlistDetailList = new ArrayList<PlaylistDetailDto>();
interactiveInfoList = new ArrayList<InteractiveInfoDto>();
boolean isUseWeatherForecast = ABVDataCache.getInstance().serviceOption.isUseWeatherForecast();
for (int i = 0; i < playLists.length(); i++) {
JSONObject playList = playLists.getJSONObject(i);
PlaylistDto dto = new PlaylistDto();
dto.playlistId = playList.getInt(PlayListId);
dto.playlistName = playList.getString(PlayListName);
dto.updateDate = DateTimeUtil.toDate(playList.getString(UpdateDate), DateTimeFormat.yyyyMMddHHmmss_hyphen);
//CMS側でテロップの表示が設定される場合
if (playList.has(TelopImage) && !playList.getString(TelopImage).isEmpty()) {
dto.telopSpeed = playList.getInt(TelopSpeed);
dto.displayTelop = true;
dto.decodedTelopImage = playList.getString(TelopImage);
} else {
dto.displayTelop = false;
}
//CMS側で天気予報の表示が設定される場合
if (playList.has(ShowWeather)) {
dto.displayWeatherForecast = playList.getInt(ShowWeather) != 0;
//途中で天気予報表示のサービスオプションを外して、JSONファイルにshowWeatherが残っている場合対応
if (!isUseWeatherForecast) {
dto.displayWeatherForecast = false;
}
} else {
dto.displayWeatherForecast = false;
}
JSONArray contents = playList.getJSONArray(Contents);
for (int j = 0; j < contents.length(); j++) {
JSONObject content = contents.getJSONObject(j);
PlaylistDetailDto detailDto = new PlaylistDetailDto();
detailDto.playlistId = dto.playlistId;
detailDto.listOrder = content.getInt(DispOrder);
detailDto.contentId = content.getLong(ContentId);
detailDto.slide = content.getInt(Sliede);
detailDto.stay = content.getInt(Stay);
//CMS側でテロップの表示が設定される場合
if (content.has(TelopImage)) {
//テロップの内容が入力されない場合
if (content.getString(TelopImage).isEmpty()) {
detailDto.displayTelopStatus = 1;
} else {
//テロップの内容が入力された場合そのイメージを保存
detailDto.displayTelopStatus = 2;
detailDto.telopSpeed = content.getInt(TelopSpeed);
detailDto.decodedTelopImage = content.getString(TelopImage);
}
} else {
detailDto.displayTelopStatus = 0;
}
//CMS側で天気予報の表示が設定される場合
if (content.has(ShowWeather)) {
//コンテンツ毎に天気予報を非表示に設定された場合
if (content.getInt(ShowWeather) == 0) {
detailDto.weatherForecastStatus = 1;
} else {
//コンテンツ毎に天気予報を表示に設定された場合
detailDto.weatherForecastStatus = 2;
}
//途中で天気予報表示のサービスオプションを外して、JSONファイルにshowWeatherが残っている場合対応
if (!isUseWeatherForecast) {
detailDto.weatherForecastStatus = 0;
}
} else {
detailDto.weatherForecastStatus = 0;
}
playlistDetailList.add(detailDto);
// インタラクティブ情報
JSONArray interactiveInfoArray = content.getJSONArray(InteractiveInfo);
for (int k = 0; k < interactiveInfoArray.length(); k++) {
JSONObject interactiveInfo = interactiveInfoArray.getJSONObject(k);
InteractiveInfoDto interactiveInfoDto = new InteractiveInfoDto();
interactiveInfoDto.playlistId = detailDto.playlistId;
interactiveInfoDto.listOrder = detailDto.listOrder;
interactiveInfoDto.dstContentId = interactiveInfo.getLong(DstContentId);
String mapping = interactiveInfo.getString(Mapping);
String[] mappings = mapping.split(":");
// 1:1または1-3:1-3の形式
if (mappings.length >= 2) {
String[] srcPages = mappings[0].split("-");
if (srcPages.length >= 2) {
interactiveInfoDto.pageFrom = Integer.parseInt(srcPages[0]);
interactiveInfoDto.pageTo = Integer.parseInt(srcPages[1]);
} else if (srcPages.length == 1) {
interactiveInfoDto.pageFrom = Integer.parseInt(srcPages[0]);
interactiveInfoDto.pageTo = Integer.parseInt(srcPages[0]);
}
String[] dstPages = mappings[1].split("-");
if (dstPages.length >= 2) {
interactiveInfoDto.dstPageFrom = Integer.parseInt(dstPages[0]);
interactiveInfoDto.dstPageTo = Integer.parseInt(dstPages[1]);
} else if (dstPages.length >= 1) {
interactiveInfoDto.dstPageFrom = Integer.parseInt(dstPages[0]);
interactiveInfoDto.dstPageTo = Integer.parseInt(dstPages[0]);
}
}
interactiveInfoList.add(interactiveInfoDto);
}
}
playlistList.add(dto);
}
// コンテンツ
JSONArray contents = json.getJSONArray(ContentList);
contentList = new ArrayList<ContentDto>();
for (int i = 0; i < contents.length(); i++) {
JSONObject content = contents.getJSONObject(i);
ContentDto dto = new ContentDto();
dto.contentId = content.getLong(ContentId);
dto.contentName = content.getString(ContentName);
dto.contractContentId = content.getInt(ContractContentId);
contentList.add(dto);
}
}
}
package jp.agentec.abook.abv.bl.acms.client.json;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
import org.json.adf.JSONArray;
import org.json.adf.JSONObject;
public class WeatherInforJSON extends AcmsCommonJSON {
//天気予報の情報
public static final String WeatherList = "weatherList";
public static final String DispOrder = "dispOrder";
public static final String DispDate = "dispDate";
public static final String TempDay = "tempDay";
public static final String TempMin = "tempMin";
public static final String TempMax = "tempMax";
//天気の状態
public static final String Weather = "weather";
public static final String WeatherCode = "id";
public static final String WeatherName = "main";
public static final String WeatherDescription = "description";
public static final String WeatherIcon = "icon";
public static final String WeatherIconImageSmall = "iconImageSmall";
public static final String WeatherIconImageLarge = "iconImageLarge";
public static final String Humidity = "humidity";
public List<WeatherInforDto> weatherInforList;
public WeatherInforJSON(String jsonString) throws AcmsException {
super(jsonString);
}
@Override
protected void parse(JSONObject json) {
//1週間分の天気予報情報
JSONArray weatherList = json.getJSONArray(WeatherList);
weatherInforList = new ArrayList<WeatherInforJSON.WeatherInforDto>();
for (int i = 0; i < weatherList.length(); i++) {
JSONObject weatherInfor = weatherList.getJSONObject(i);
WeatherInforDto dto = new WeatherInforDto();
Date date = DateTimeUtil.toDate(weatherInfor.getString(DispDate), DateTimeFormat.yyyyMMdd_hyphen);
dto.dispDate = DateTimeUtil.toString(date, DateTimeFormat.MMdd_slash);
if (weatherInfor.has(TempMax)) {
dto.tempMax = (int) Math.round(weatherInfor.getDouble(TempMax));
} else {
dto.tempMax = null;
}
if (weatherInfor.has(TempMin)) {
dto.tempMin = (int) Math.round(weatherInfor.getDouble(TempMin));
} else {
dto.tempMin = null;
}
JSONObject weatherState = weatherInfor.getJSONObject(Weather);
dto.weatherSmallIcon = weatherState.getString(WeatherIconImageSmall);
dto.weatherLargeIcon = weatherState.getString(WeatherIconImageLarge);
weatherInforList.add(dto);
}
}
public class WeatherInforDto {
public String dispDate;
public String weatherSmallIcon;
public String weatherLargeIcon;
public Integer tempMin;
public Integer tempMax;
public String getDispDate() {
return dispDate;
}
public String getWeatherSmallIcon() {
return weatherSmallIcon;
}
public String getWeatherLargeIcon() {
return weatherLargeIcon;
}
public Integer getTempMin() {
return tempMin;
}
public Integer getTempMax() {
return tempMax;
}
}
}
package jp.agentec.abook.abv.bl.acms.client.parameters;
/**
* 天気予報の情報を取得するパラメータ
*
*/
public class GetWeatherInfoParameters extends AcmsParameters {
private double latitude;
private double longitude;
public GetWeatherInfoParameters(String sid, double latitude, double longitude) {
super(sid);
this.latitude = latitude;
this.longitude = longitude;
}
public double getLatitude() {
return latitude;
}
public double getLongitude() {
return longitude;
}
}
package jp.agentec.abook.abv.bl.acms.client.parameters;
import jp.agentec.adf.net.http.HttpParameterObject;
import jp.agentec.adf.util.StringUtil;
/**
* KT社専用のユーザ認証用のパラメータです。
* @author Jang
* @version 1.5.2KT
*/
public class KTLoginParameters extends HttpParameterObject {
private String authKey;
private String urlPath;
private int appId;
private String appVersion;
private int deviceTypeId;
private String deviceToken;
private String uid;
/**
* {@link KTLoginParameters} クラスのインスタンスを初期化します。
* @param urlPath groupIdキー
* @param authKey sessionキー
* @param appId アプリケーションIDです。
* @param appVersion アプリケーションの現在バージョンです。
* @param deviceToken デバイストークンです。
* @param deviceTypeId 端末タイプです。
* @param uid 端末のUIDです。
* @throws IllegalArgumentException 引数のどれかが半角英数字と'_'、'-'ではありません。
* @since 1.0.0
*/
public KTLoginParameters(String urlPath, String authKey, int appId, String appVersion, int deviceTypeId, String deviceToken, String uid) throws IllegalArgumentException {
if (StringUtil.isNullOrWhiteSpace(urlPath)) {
throw new IllegalArgumentException("argument urlPath not allowed null or white space.");
}
if (StringUtil.isNullOrWhiteSpace(authKey)) {
throw new IllegalArgumentException("argument authKey not allowed null or white space.");
}
this.urlPath = urlPath;
this.authKey = authKey;
this.appId = appId;
this.appVersion = appVersion;
this.deviceTypeId = deviceTypeId;
this.deviceToken = deviceToken;
this.uid = uid;
}
public String getAuthKey() {
return authKey;
}
public String getUrlPath() {
return urlPath;
}
public int getAppId() {
return appId;
}
public String getAppVersion() {
return appVersion;
}
public int getDeviceTypeId() {
return deviceTypeId;
}
public String getDeviceToken() {
return deviceToken;
}
public String getUid() {
return uid;
}
}
package jp.agentec.abook.abv.bl.acms.client.parameters;
import jp.agentec.adf.net.http.HttpParameterObject;
import jp.agentec.adf.util.StringUtil;
/**
* 포스코 전용 로그인API의 파라메터압니다.
* @author Taejin Hong
* @version 1.0.0
*/
public class PoscoLoginParameters extends HttpParameterObject {
/**
* 사용자ID입니다.
* @since 1.0.0
*/
private String loginId;
/**
* 디바이스 타입ID입니다. 1:iPad, 2:iPhone, 3:Android
* @since 1.0.0
*/
private int deviceTypeId;
/**
* 앱 ID입니다. 1:iPad, 2:iPhone, 3:Android
* @since 1.0.0
*/
private int appId;
/**
* 앱의 현재 버젼입니다.
* @since 1.0.0
*/
private String appVersion;
/**
* 이 값은 Android에서는 사용하지 않으며, 항상 null로 설정합니다.(iOS에서 푸쉬메세지를 지원하기 위한 값임)
* @since 1.0.0
*/
private String deviceToken;
/**
* 전화번호입니다.
* @since 1.0.0
*/
private String min;
/**
* IMEI입니다.
* @since 1.0.0
*/
private String udid;
/**
* POSCO인증서버에서 할당 받은 인증 토큰입니다.
* @since 1.0.0
*/
private String authToken;
/**
* {@link PoscoLoginParameters} 클래스의 인스턴스를 생성합니다.
* @param loginId 사용자ID입니다.
* @param deviceTypeId 디바이스 타입ID입니다. 1:iPad, 2:iPhone, 3:Android
* @param appId 앱 ID입니다. 1:iPad, 2:iPhone, 3:Android
* @param appVersion 앱의 현재 버젼입니다.
* @param min 전화번호입니다.
* @param udid IMEI입니다.
* @param authToken POSCO인증서버에서 할당 받은 인증 토큰입니다.
* @since 1.0.0
*/
public PoscoLoginParameters(String loginId, int deviceTypeId, int appId, String appVersion, String min, String udid, String authToken) {
this.loginId = loginId;
this.deviceTypeId = deviceTypeId;
this.appId = appId;
this.appVersion = appVersion;
this.deviceToken = StringUtil.Empty;
this.min = min;
this.udid = udid;
this.authToken = authToken;
}
/**
* 사용자ID를 반환합니다.
* @return 사용자ID입니다.
* @since 1.0.0
*/
public String getLoginId() {
return loginId;
}
/**
* 디바이스 타입ID를 반환합니다.
* @return 디바이스 타입ID입니다.
* @since 1.0.0
*/
public int getDeviceTypeId() {
return deviceTypeId;
}
/**
* 앱 ID를 반환합니다.
* @return 앱 ID입니다.
* @since 1.0.0
*/
public int getAppId() {
return appId;
}
/**
* 앱의 현재 버젼을 반환합니다.
* @return 앱의 현재 버젼입니다.
* @since 1.0.0
*/
public String getAppVersion() {
return appVersion;
}
/**
* 한상 빈 문자열을 반환합니다. 안드로이드에서는 사용하지 않는 값입니다.
* @return 빈 문자열입니다.
* @since 1.0.0
*/
public String getDeviceToken() {
return deviceToken;
}
/**
* 전화번호를 반환합니다.
* @return 전화번호입니다.
* @since 1.0.0
*/
public String getMin() {
return min;
}
/**
* IMEI를 반환합니다.
* @return IMEI입니다.
* @since 1.0.0
*/
public String getUdid() {
return udid;
}
/**
* POSCO인증서버에서 할당 받은 인증 토큰을 반환합니다.
* @return POSCO인증서버에서 할당 받은 인증 토큰입니다.
* @since 1.0.0
*/
public String getAuthToken() {
return authToken;
}
}
......@@ -43,7 +43,6 @@ public class ABVEnvironment {
public String rootDirectory;
public String externalStorageDirectory;
public String cacheDirectory;
public int productCode = ABVProductCode.AgentecPackage;
public String encryptKey;
public String screenSizeForAcmsParam;
public String websocketServerHttpUrl;
......@@ -55,8 +54,6 @@ public class ABVEnvironment {
public int cacheSize;
public String aspectType; // 16対9または4対3
public boolean kiosk; // KIOSKモード
public int signageSyncBroadcastUdpPort; // サイネージ連動用のデフォルトUDPポート
public boolean isCheckInvalidPasswordLimit = true;// パスワード失敗回数チェックを行うか否か (R.bool.is_check_invalid_password_limit)
......@@ -92,7 +89,6 @@ public class ABVEnvironment {
public static final String WebCacheDirectoryFormat = "%s/web";
public static final String Content3DzipNameFormat = "%s/images.zip";// 3Dzipファイル
// public static final String Content3DDirectoryFormat = "%s/" + Content3DViewDirectoryName; // 3Dフォルダ
public static final String PDFThumbnailDirectoryFormat = "%s/pdfThumbnail"; // PDF小サムネイルディレクトリ
public static final String ContentVersionInfoJsonName = "json.txt";
......@@ -240,9 +236,6 @@ public class ABVEnvironment {
return editionType == Constant.editionType.CHECK;
}
public boolean isSignage() {
return editionType == Constant.editionType.SIGNAGE;
}
///////////////////////////////////////     以下ファイルパス関係     ///////////////////////////////////////
......
package jp.agentec.abook.abv.bl.common;
public class ABVProductCode {
public static final int AgentecPackage = 1;
public static final int KOMAS = 2;
public static final int OllehMCM = 3;
public static final int Dreamsky = 4;
public static final int PoscoEBrochure = 11;
// public static final int SoftbankBBSaaS = 101;
// public static final int GMOSaas = 111;
// public static final int PanasonicSaaS = 121;
// public static final int SoftCatalog = 201;
// public static final int SmartPaper = 301;
public static int validateProductCode(int productCode) {
switch (productCode) {
case AgentecPackage:
case KOMAS:
case PoscoEBrochure:
case OllehMCM:
case Dreamsky:
// case SoftbankBBSaaS:
// case GMOSaas:
// case PanasonicSaaS:
// case SoftCatalog:
// case SmartPaper:
return productCode;
default:
return AgentecPackage;
}
}
}
......@@ -61,11 +61,8 @@ public class Constant {
}
}
public interface SignageMode {
int ADMIN = 0;
int INTERACTIVE = 1;
int SIGNAMGE = 2;
int UNAUTHORIZED_CONTENT = 3;
public interface ReadingLogMode {
int DEFAULT = 0;
}
public interface ExceptionDetailMessage {
......
......@@ -351,10 +351,6 @@ public class ABVDataCache {
return isServiceOptionEnable(ServiceOptionId.UsableDashboard);
}
public boolean isSignage() {
return isServiceOptionEnable(ServiceOptionId.Signage);
}
public boolean isCatalogEdition() {
return isServiceOptionEnable(ServiceOptionId.CatalogEdition);
}
......
......@@ -823,7 +823,6 @@ public class ContentDao extends AbstractDao {
delete("r_content_category", "content_id=?", keyValues);
delete("r_content_group", "content_id=?", keyValues);
delete("t_interactive_info", "dst_content_id=?", keyValues);
AbstractDao.getDao(PlaylistDetailDao.class).deleteByContentId(contentId);
if (ABVEnvironment.getInstance().isABookCheck()) {
delete("r_project_content", "content_id=?", keyValues);
}
......
......@@ -4,6 +4,7 @@ import java.util.Calendar;
import java.util.List;
import jp.agentec.abook.abv.bl.acms.type.ContentReadingStatus;
import jp.agentec.abook.abv.bl.common.Constant.ReadingLogMode;
import jp.agentec.abook.abv.bl.common.db.Cursor;
import jp.agentec.abook.abv.bl.dto.ContentReadingLogDto;
import jp.agentec.adf.util.DateTimeFormat;
......@@ -85,8 +86,8 @@ public class ContentReadingLogDao extends AbstractDao {
return rawQueryGetInt(sql.toString(), null);
}
public ContentReadingLogDto getContentReadingLog(long contentId, int mode) {
String[] args = new String[]{""+ contentId, ""+ ContentReadingStatus.reading.type(), ""+ ContentReadingStatus.suspend.type(), "" + mode};
public ContentReadingLogDto getContentReadingLog(long contentId) {
String[] args = new String[]{""+ contentId, ""+ ContentReadingStatus.reading.type(), ""+ ContentReadingStatus.suspend.type(), "" + ReadingLogMode.DEFAULT};
return rawQueryGetDto("select * from l_content_reading_log where content_id=? and status IN(?,?) and mode=?", args, ContentReadingLogDto.class);
}
......
package jp.agentec.abook.abv.bl.data.dao;
import java.util.List;
import jp.agentec.abook.abv.bl.common.db.Cursor;
import jp.agentec.abook.abv.bl.dto.InteractiveInfoDto;
public class InteractiveInfoDao extends AbstractDao {
InteractiveInfoDao() {
}
@Override
protected InteractiveInfoDto convert(Cursor cursor) {
InteractiveInfoDto dto = new InteractiveInfoDto();
int column = cursor.getColumnIndex("interactive_id");
if (column != -1) {
dto.interactiveId = cursor.getInt(column);
}
column = cursor.getColumnIndex("playlist_id");
if (column != -1) {
dto.playlistId = cursor.getInt(column);
}
column = cursor.getColumnIndex("list_order");
if (column != -1) {
dto.listOrder = cursor.getInt(column);
}
column = cursor.getColumnIndex("dst_content_id");
if (column != -1) {
dto.dstContentId = cursor.getLong(column);
}
column = cursor.getColumnIndex("page_from");
if (column != -1) {
dto.pageFrom = cursor.getInt(column);
}
column = cursor.getColumnIndex("page_to");
if (column != -1) {
dto.pageTo = cursor.getInt(column);
}
column = cursor.getColumnIndex("dst_page_from");
if (column != -1) {
dto.dstPageFrom = cursor.getInt(column);
}
column = cursor.getColumnIndex("dst_page_to");
if (column != -1) {
dto.dstPageTo = cursor.getInt(column);
}
return dto;
}
public int getNewId() {
StringBuffer sql = new StringBuffer();
sql.append(" SELECT " );
sql.append( " COALESCE(MAX(interactive_id)+1,1)");
sql.append( " FROM t_interactive_info");
return rawQueryGetInt(sql.toString(), null);
}
public InteractiveInfoDto getInteractiveInfo(int interactive_id) {
String[] args = new String[] { "" + interactive_id };
return rawQueryGetDto("select * from t_interactive_info where interactive_id=?", args, InteractiveInfoDto.class);
}
public List<InteractiveInfoDto> findByPlaylistIdAndListOrder(int playlistId, int listOrder) {
String[] args = new String[] { "" + playlistId, "" + listOrder };
return rawQueryGetDtoList("select * from t_interactive_info where playlist_id=? and list_order=?", args, InteractiveInfoDto.class);
}
public void insert(InteractiveInfoDto dto) {
insert("insert into t_interactive_info "
+ "(interactive_id, "
+ "playlist_id, "
+ "list_order, "
+ "dst_content_id, "
+ "page_from, "
+ "page_to, "
+ "dst_page_from, "
+ "dst_page_to) "
+ "values "
+ "(?,?,?,?,?,?,?,?)",
dto.getInsertValues());
}
public boolean update(InteractiveInfoDto dto) {
long count = update("update t_interactive_info "
+ "set "
+ "playlist_id=?, "
+ "list_order=?, "
+ "dst_content_id=?, "
+ "page_from=?, "
+ "page_to=?, "
+ "dst_page_from=?, "
+ "dst_page_to=? "
+ "where interactive_id=?",
dto.getUpdateValues());
return count > 0;
}
public boolean delete(InteractiveInfoDto dto) {
long ret = delete("t_interactive_info", "interactive_id=?", dto.getKeyValues());
return ret > 0;
}
public void deleteAll() {
delete("t_interactive_info", null, null);
}
}
\ No newline at end of file
package jp.agentec.abook.abv.bl.data.dao;
import jp.agentec.abook.abv.bl.common.db.Cursor;
import jp.agentec.abook.abv.bl.dto.PlaylistDto;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
public class PlaylistDao extends AbstractDao {
PlaylistDao() {
}
@Override
protected PlaylistDto convert(Cursor cursor) {
PlaylistDto dto = new PlaylistDto();
int column = cursor.getColumnIndex("playlist_id");
if (column != -1) {
dto.playlistId = cursor.getInt(column);
}
column = cursor.getColumnIndex("playlist_name");
if (column != -1) {
dto.playlistName = cursor.getString(column);
}
column = cursor.getColumnIndex("update_date");
if (column != -1) {
dto.updateDate = DateTimeUtil.toDate(cursor.getString(column), "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen);
}
column = cursor.getColumnIndex("display_telop");
if (column != -1) {
dto.displayTelop = toBool(cursor.getInt(column));
}
column = cursor.getColumnIndex("telop_speed");
if (column != -1) {
dto.telopSpeed = cursor.getInt(column);
}
column = cursor.getColumnIndex("display_weather_forecast");
if (column != -1 ) {
dto.displayWeatherForecast = toBool(cursor.getInt(column));
}
return dto;
}
public PlaylistDto getPlaylist(int playlistId) {
String[] args = new String[] { "" + playlistId };
return rawQueryGetDto("select * from t_playlist where playlist_id=?", args, PlaylistDto.class);
}
public void insert(PlaylistDto dto) {
insert("insert into t_playlist "
+ "(playlist_id, "
+ "playlist_name, "
+ "update_date, "
+ "telop_speed, "
+ "display_telop, "
+ "display_weather_forecast) "
+ "values "
+ "(?,?,?,?,?,?)",
dto.getInsertValues());
}
public boolean update(PlaylistDto dto) {
long count = update("update t_playlist "
+ "set "
+ "playlist_name=?, "
+ "update_date=? "
+ "telop_speed = ? "
+ "display_telop = ? "
+ "display_weather_forecast = ? "
+ "where playlist_id=?",
dto.getUpdateValues());
return count > 0;
}
public boolean delete(PlaylistDto dto) {
long ret = delete("t_playlist", "playlist_id=?", dto.getKeyValues());
return ret > 0;
}
public void deleteAll() {
delete("t_playlist", null, null);
}
}
\ No newline at end of file
package jp.agentec.abook.abv.bl.data.dao;
import java.util.List;
import jp.agentec.abook.abv.bl.common.db.Cursor;
import jp.agentec.abook.abv.bl.dto.PlaylistDetailDto;
public class PlaylistDetailDao extends AbstractDao {
PlaylistDetailDao() {
}
@Override
protected PlaylistDetailDto convert(Cursor cursor) {
PlaylistDetailDto dto = new PlaylistDetailDto();
int column = cursor.getColumnIndex("playlist_id");
if (column != -1) {
dto.playlistId = cursor.getInt(column);
}
column = cursor.getColumnIndex("list_order");
if (column != -1) {
dto.listOrder = cursor.getInt(column);
}
column = cursor.getColumnIndex("content_id");
if (column != -1) {
dto.contentId = cursor.getLong(column);
}
column = cursor.getColumnIndex("slide");
if (column != -1) {
dto.slide = cursor.getInt(column);
}
column = cursor.getColumnIndex("stay");
if (column != -1) {
dto.stay = cursor.getInt(column);
}
column = cursor.getColumnIndex("telop_speed");
if (column != -1) {
dto.telopSpeed = cursor.getInt(column);
}
column = cursor.getColumnIndex("display_telop_status");
if (column != -1) {
dto.displayTelopStatus = cursor.getInt(column);
}
column = cursor.getColumnIndex("weather_forecast_status");
if (column != -1) {
dto.weatherForecastStatus = cursor.getInt(column);
}
return dto;
}
public PlaylistDetailDto getPlaylistDetail(int playlistId, int listOrder) {
String[] args = new String[] { "" + playlistId, "" + listOrder };
return rawQueryGetDto("select * from t_playlist_detail where playlist_id=? and list_order=?", args, PlaylistDetailDto.class);
}
public List<PlaylistDetailDto> findByPlaylistId(int playlistId) {
String[] args = new String[] { "" + playlistId };
return rawQueryGetDtoList("select * from t_playlist_detail where playlist_id=? order by list_order asc", args, PlaylistDetailDto.class);
}
public void insert(PlaylistDetailDto dto) {
insert("insert into t_playlist_detail "
+ "(playlist_id, "
+ "list_order, "
+ "content_id, "
+ "slide, "
+ "stay, "
+ "telop_speed, "
+ "display_telop_status, "
+ "weather_forecast_status) "
+ "values "
+ "(?,?,?,?,?, ?, ?, ?)",
dto.getInsertValues());
}
public boolean update(PlaylistDetailDto dto) {
long count = update("update t_playlist_detail "
+ "set "
+ "content_id=?, "
+ "slide=?, "
+ "stay=?, "
+ "telop_speed = ? , "
+ "display_telop_status = ? , "
+ "weather_forecast_status = ? "
+ "where playlist_id=? and list_order=?",
dto.getUpdateValues());
return count > 0;
}
public boolean delete(PlaylistDetailDto dto) {
long ret = delete("t_playlist_detail", "playlist_id=? and list_order=?", dto.getKeyValues());
return ret > 0;
}
public void deleteAll() {
delete("t_playlist_detail", null, null);
}
public boolean deleteByContentId(long contentId) {
String[] args = new String[] { "" + contentId };
// インタラクティブ情報を先に削除
List<PlaylistDetailDto> detailList = rawQueryGetDtoList("select * from t_playlist_detail where content_id=?", args, PlaylistDetailDto.class);
for (PlaylistDetailDto detail : detailList) {
delete("t_interactive_info", "playlist_id=? and list_order=?", new String[] { "" + detail.playlistId, "" + detail.listOrder });
}
long ret = delete("t_playlist_detail", "content_id=?", args);
return ret > 0;
}
}
\ No newline at end of file
package jp.agentec.abook.abv.bl.data.dao;
import java.util.Date;
import java.util.List;
import jp.agentec.abook.abv.bl.common.db.Cursor;
import jp.agentec.abook.abv.bl.dto.ScheduleDto;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
public class ScheduleDao extends AbstractDao {
ScheduleDao() {
}
@Override
protected ScheduleDto convert(Cursor cursor) {
ScheduleDto dto = new ScheduleDto();
int column = cursor.getColumnIndex("schedule_id");
if (column != -1) {
dto.scheduleId = cursor.getInt(column);
}
column = cursor.getColumnIndex("start");
if (column != -1) {
dto.start = DateTimeUtil.toDate(cursor.getString(column), "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen);
if (dto.start != null) {
dto.startDate = DateTimeUtil.toString(dto.start, DateTimeFormat.yyyyMMdd_hyphen);
dto.startTime = DateTimeUtil.toString(dto.start, DateTimeFormat.HHmm_colon);
}
}
column = cursor.getColumnIndex("end");
if (column != -1) {
dto.end = DateTimeUtil.toDate(cursor.getString(column), "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen);
if (dto.end != null) {
dto.endDate = DateTimeUtil.toString(dto.end, DateTimeFormat.yyyyMMdd_hyphen);
dto.endTime = DateTimeUtil.toString(dto.end, DateTimeFormat.HHmmss_colon);
}
}
column = cursor.getColumnIndex("playlist_id");
if (column != -1) {
dto.playlistId = cursor.getInt(column);
}
column = cursor.getColumnIndex("sub_playlist_id");
if (column != -1) {
if(cursor.getInt(column) == 0){
dto.subPlaylistId = null;
} else {
dto.subPlaylistId = cursor.getInt(column);
}
}
column = cursor.getColumnIndex("default_schedule");
if(column != -1) {
dto.defaultScheduleFlag = toBool(cursor.getInt(column));
}
return dto;
}
public int getNewId() {
StringBuffer sql = new StringBuffer();
sql.append(" SELECT " );
sql.append( " COALESCE(MAX(schedule_id)+1,1)");
sql.append( " FROM t_schedule");
return rawQueryGetInt(sql.toString(), null);
}
public List<ScheduleDto> getAllSchedule() {
return rawQueryGetDtoList("select * from t_schedule order by start", null, ScheduleDto.class);
}
public ScheduleDto getSchedule(int scheduleId) {
String[] args = new String[] { "" + scheduleId };
return rawQueryGetDto("select * from t_schedule where schedule_id=?", args, ScheduleDto.class);
}
public ScheduleDto getScheduleFromDate(Date date) {
String dateString = DateTimeUtil.toStringInTimeZone(date, DateTimeFormat.yyyyMMddHHmmss_hyphen, "UTC");
String[] args = new String[] { dateString, dateString };
return rawQueryGetDto("select * from t_schedule where start <= ? and end >= ?", args, ScheduleDto.class);
}
public void insert(ScheduleDto dto) {
insert("insert into t_schedule "
+ "(schedule_id, "
+ "start, "
+ "end, "
+ "playlist_id, "
+ "sub_playlist_id, "
+ "default_schedule) "
+ "values "
+ "(?,?,?,?,?,?)",
dto.getInsertValues());
}
public boolean update(ScheduleDto dto) {
long count = update("update t_schedule "
+ "set "
+ "start=?, "
+ "end=?, "
+ "playlist_id=?, "
+ "sub_playlist_id=? "
+ "default_schedule=? "
+ "where schedule_id=?",
dto.getUpdateValues());
return count > 0;
}
public boolean delete(ScheduleDto dto) {
long ret = delete("t_schedule", "schedule_id=?", dto.getKeyValues());
return ret > 0;
}
public void deleteAll() {
delete("t_schedule", null, null);
}
public ScheduleDto getDefaultSchedule() {
return rawQueryGetDto("select * from t_schedule where default_schedule=1", null, ScheduleDto.class);
}
public boolean isNotExistNormalSchedule() {
return !(rawQueryGetInt("select count(default_schedule) from t_schedule where default_schedule=0", null) > 0);
}
}
\ No newline at end of file
......@@ -38,7 +38,6 @@ import jp.agentec.abook.abv.bl.data.dao.ContentDao;
import jp.agentec.abook.abv.bl.dto.ContentDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.ContentLogic;
import jp.agentec.abook.abv.bl.logic.ScheduleLogic;
import jp.agentec.adf.net.http.HttpDownloadNotification;
import jp.agentec.adf.net.http.HttpDownloadSimpleNotification;
import jp.agentec.adf.net.http.HttpDownloadState;
......@@ -511,10 +510,6 @@ public class ContentDownloader {
CommonExecutor.execute(new Runnable() {
@Override
public void run() {
// サイネージの場合ここではダウンロードを行わない
if (cache.serviceOption.isSignage()) {
return;
}
// コンテンツを自動DLする
Logger.d("autoDownload:" + autoDownloadList.size());
int targetCount = 0;
......@@ -1031,10 +1026,6 @@ public class ContentDownloader {
String msg = "Invalid content id. detail : " + notification.toString();
updateRefreshContentListState(HttpDownloadState.failed, null, new Exception(msg));
}
if (!ContentRefresher.getInstance().isRefreshing()) {
AbstractLogic.getLogic(ScheduleLogic.class).fetchSignageScheduleAndDownloadContent();
}
}
private void updateRefreshContentListState(HttpDownloadState state, Long contentId, Exception e) {
ContentRefresher.getInstance().removeRefreshingContentId(contentId);
......
......@@ -34,7 +34,6 @@ import jp.agentec.abook.abv.bl.logic.DashboardLogic;
import jp.agentec.abook.abv.bl.logic.EnqueteLogic;
import jp.agentec.abook.abv.bl.logic.GroupLogic;
import jp.agentec.abook.abv.bl.logic.ProjectLogic;
import jp.agentec.abook.abv.bl.logic.ScheduleLogic;
import jp.agentec.abook.abv.bl.logic.SubscriptionHistoryLogic;
import jp.agentec.adf.util.CollectionUtil;
import jp.agentec.adf.util.DateTimeUtil;
......@@ -173,7 +172,6 @@ public class ContentRefresher {
updateRefreshContentListState(-1L, null);
return;
}
isFinishedContentCheck = retrieveServerContent(localContents); // ContentVersionAPIを呼出し新規と更新の場合ContentInfoをDLする
}
......@@ -181,7 +179,6 @@ public class ContentRefresher {
initializingRefreshing = false;
if (!isRefreshing()) {
AbstractLogic.getLogic(ScheduleLogic.class).fetchSignageScheduleAndDownloadContent();
updateRefreshContentListState(-1L, null);
}
......@@ -369,17 +366,6 @@ public class ContentRefresher {
dashBoardLogic.setDashboard();
}
// サイネージオプション
if (cache.serviceOption.isSignage()) {
// サイネージの場合同時ダウンロードは1つだけにする
contentDownloader.setMaximumDownloadable(1);
ABVEnvironment.getInstance().cacheSize = 0; // キャッシュは無限にする
// 待ち受け画面の取得
AbstractLogic.getLogic(ScheduleLogic.class).downloadStandByPic();
// 下敷き画像の取得
AbstractLogic.getLogic(ScheduleLogic.class).downloadBackgroundPic(ABVEnvironment.getInstance().aspectType);
}
// 定期購読期間更新(決済ありの場合)
if (ABVDataCache.getInstance().serviceOption.isPayment() && ABVDataCache.getInstance().serviceOption.isAutoSubscriptionAll()) {
AbstractLogic.getLogic(SubscriptionHistoryLogic.class).refreshSubscription(contentDownloader.account);
......@@ -448,8 +434,6 @@ public class ContentRefresher {
resendEnquete();
// 配信ログを再送する
batchSendDownloadLog();
// 前日のサイネージログで未送信があれば再送扱いにする。
AbstractLogic.getLogic(ContentReadingLogLogic.class).modifyEndSignageLog();
// 閲覧ログを再送する
AbstractLogic.getLogic(ContentReadingLogLogic.class).batchSendReadingLog();
}
......
package jp.agentec.abook.abv.bl.dto;
public class InteractiveInfoDto extends AbstractDto {
public int interactiveId;
public int playlistId;
public int listOrder;
public long dstContentId;
public int pageFrom;
public int pageTo;
public int dstPageFrom;
public int dstPageTo;
public ContentDto content;
@Override
public Object[] getInsertValues() {
return new Object[] { interactiveId, playlistId, listOrder, dstContentId, pageFrom, pageTo, dstPageFrom, dstPageTo };
}
@Override
public Object[] getUpdateValues() {
return new Object[] { playlistId, listOrder, dstContentId, pageFrom, pageTo, dstPageFrom, dstPageTo, interactiveId };
}
@Override
public String[] getKeyValues() {
return new String[] { "" + interactiveId };
}
}
package jp.agentec.abook.abv.bl.dto;
import java.util.List;
public class PlaylistDetailDto extends AbstractDto {
public int playlistId;
public int listOrder;
public long contentId;
public int slide;
public int stay;
public int telopSpeed;
//テロップ表示する状態の値: 0:テロップの表示が設定されない場合
//1:テロップの表示が設定されたが、テロップの内容が入力されない。
//2:テロップの表示が設定されて、テロップの内容も入力された
public int displayTelopStatus;
//天気予報の状態の値: 0:テロップの表示が設定されない場合、
//1:テロップの表示が設定されたが天気予報の表示状態を非表示に設定された。
//2:テロップの表示が設定されて、天気予報を表示に設定された
public int weatherForecastStatus;
public String decodedTelopImage;
public PlaylistDto playlist;
public ContentDto content;
public List<InteractiveInfoDto> interactiveInfoList;
public boolean showPlaylistNameFlg = false;
public boolean readyToPlay = false;
@Override
public Object[] getInsertValues() {
return new Object[] { playlistId, listOrder, contentId, slide, stay, telopSpeed, displayTelopStatus,weatherForecastStatus};
}
@Override
public Object[] getUpdateValues() {
return new Object[] { contentId, slide, stay, telopSpeed, displayTelopStatus,weatherForecastStatus , playlistId, listOrder };
}
@Override
public String[] getKeyValues() {
return new String[] { "" + playlistId, "" + listOrder };
}
}
package jp.agentec.abook.abv.bl.dto;
import java.util.Date;
import java.util.List;
public class PlaylistDto extends AbstractDto {
public int playlistId;
public String playlistName;
public Date updateDate;
public int telopSpeed;
public boolean displayTelop;
public boolean displayWeatherForecast;
public String decodedTelopImage;
public List<PlaylistDetailDto> plsylistDetailList;
@Override
public Object[] getInsertValues() {
return new Object[] { playlistId, playlistName, updateDate, telopSpeed, displayTelop, displayWeatherForecast};
}
@Override
public Object[] getUpdateValues() {
return new Object[] { playlistName, updateDate, telopSpeed, displayTelop, displayWeatherForecast, playlistId };
}
@Override
public String[] getKeyValues() {
return new String[] { "" + playlistId };
}
}
package jp.agentec.abook.abv.bl.dto;
import java.util.Date;
public class ScheduleDto extends AbstractDto {
public int scheduleId;
public Date start;
public Date end;
public int playlistId; // 必須
public Integer subPlaylistId; // 必須ではない
public boolean defaultScheduleFlag;
public PlaylistDto playList;
public PlaylistDto subPlayList;
// 表示用
public String startDate;
public String startTime;
public String endDate;
public String endTime;
public boolean showDateFlg = false;
@Override
public Object[] getInsertValues() {
return new Object[] { scheduleId, start, end, playlistId, subPlaylistId, defaultScheduleFlag };
}
@Override
public Object[] getUpdateValues() {
return new Object[] { start, end, playlistId, subPlaylistId, defaultScheduleFlag, scheduleId };
}
@Override
public String[] getKeyValues() {
return new String[] { "" + scheduleId };
}
}
......@@ -8,7 +8,6 @@ import java.util.Collections;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.Locale;
import jp.agentec.abook.abv.bl.acms.client.AcmsClient;
......@@ -46,9 +45,6 @@ import jp.agentec.abook.abv.bl.dto.ContentIdConvDto;
import jp.agentec.abook.abv.bl.dto.ContentPageDto;
import jp.agentec.abook.abv.bl.dto.ContentSearchDto;
import jp.agentec.abook.abv.bl.dto.ContentTagDto;
import jp.agentec.abook.abv.bl.dto.InteractiveInfoDto;
import jp.agentec.abook.abv.bl.dto.PlaylistDetailDto;
import jp.agentec.abook.abv.bl.dto.ScheduleDto;
import jp.agentec.abook.abv.bl.dto.SubscriptionHistoryDto;
import jp.agentec.abook.abv.bl.dto.comparator.ContentPageDtoComparator;
import jp.agentec.abook.abv.bl.repo.RepoClient;
......@@ -897,41 +893,4 @@ public class ContentLogic extends AbstractLogic {
}
return false;
}
public List<ContentDto> getSignageAutoDownloadTarget() {
// 未ダウンロード、アップデート対象
List<ContentDto> downloadTargetList = contentDao.getUpdateOrNotDownloadContent();
// スケジュールの早い順のダウンロード順リストを作成する
ScheduleLogic scheduleLogic = AbstractLogic.getLogic(ScheduleLogic.class);
List<ScheduleDto> scheduleList = scheduleLogic.getAllSchedule();
List<Long> downloadOrderList = new ArrayList<Long>();
for (ScheduleDto schedule : scheduleList) {
for (PlaylistDetailDto playlistDetail : schedule.playList.plsylistDetailList) {
if (!downloadOrderList.contains(playlistDetail.contentId)) {
downloadOrderList.add(playlistDetail.contentId);
for (InteractiveInfoDto interactiveInfo : playlistDetail.interactiveInfoList) {
if (!downloadOrderList.contains(interactiveInfo.dstContentId)) {
downloadOrderList.add(interactiveInfo.dstContentId);
}
}
}
}
}
// ダウンロード順リストにあるものを前に持ってくる
// ダウンロードリストを逆順に回して順番に先頭に持ってくる
for (ListIterator<Long> it = downloadOrderList.listIterator(downloadOrderList.size()); it.hasPrevious();) {
Long contentId = it.previous();
for (ContentDto contentDto : downloadTargetList) {
if (contentDto.contentId == contentId) {
downloadTargetList.remove(contentDto);
downloadTargetList.add(0, contentDto);
break;
}
}
}
return downloadTargetList;
}
}
......@@ -10,6 +10,7 @@ import jp.agentec.abook.abv.bl.acms.client.AcmsClient;
import jp.agentec.abook.abv.bl.acms.client.parameters.ContentReadingLogParameters;
import jp.agentec.abook.abv.bl.acms.type.ContentReadingStatus;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.Constant.ReadingLogMode;
import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException;
import jp.agentec.abook.abv.bl.common.log.Logger;
......@@ -19,7 +20,6 @@ import jp.agentec.abook.abv.bl.data.dao.ContentObjectLogDao;
import jp.agentec.abook.abv.bl.data.dao.ContentPageReadingLogDao;
import jp.agentec.abook.abv.bl.data.dao.ContentReadingLogDao;
import jp.agentec.abook.abv.bl.dto.ContentReadingLogDto;
import jp.agentec.adf.util.ArrayUtil;
import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.DateTimeUtil.DateUnit;
public class ContentReadingLogLogic extends AbstractLogic {
......@@ -34,9 +34,9 @@ public class ContentReadingLogLogic extends AbstractLogic {
/*package*/ ContentReadingLogLogic() {
}
public void prepareContentReadLog(long contentId, int mode) {
public void prepareContentReadLog(long contentId) {
ContentReadingLogDto dto;
dto = contentReadingLogDao.getContentReadingLog(contentId, mode);
dto = contentReadingLogDao.getContentReadingLog(contentId);
if (dto != null) {
// 強制終了や電源OFFによって以前のログが残っている可能性があるのでページログ、オブジェクトログを削除する
......@@ -61,9 +61,9 @@ public class ContentReadingLogLogic extends AbstractLogic {
* @version 1.1.1
* @throws Exception
*/
public synchronized int startContentReadLog(long contentId, int mode) {
public synchronized int startContentReadLog(long contentId) {
ContentReadingLogDto dto;
dto = contentReadingLogDao.getContentReadingLog(contentId, mode);
dto = contentReadingLogDao.getContentReadingLog(contentId);
if (dto != null) {
if(dto.status != ContentReadingStatus.reading.type()){
......@@ -78,7 +78,7 @@ public class ContentReadingLogLogic extends AbstractLogic {
dto.startDate = DateTimeUtil.getCurrentDate();
dto.resumeDate = DateTimeUtil.getCurrentDate();
dto.duration = 0;
dto.mode = mode;
dto.mode = ReadingLogMode.DEFAULT;
dto.status = ContentReadingStatus.reading.type();
contentReadingLogDao.insertContentReadingLog(dto);
}
......@@ -91,8 +91,8 @@ public class ContentReadingLogLogic extends AbstractLogic {
* @author Minhyuk Seok
* @version 1.1.1
*/
public void pauseContentReadLog(long contentId, int mode) {
ContentReadingLogDto dto = contentReadingLogDao.getContentReadingLog(contentId, mode);
public void pauseContentReadLog(long contentId) {
ContentReadingLogDto dto = contentReadingLogDao.getContentReadingLog(contentId);
if (dto == null) {
Logger.e(TAG, "ContentReadingLogDto not found. contentId=" + contentId);
return;
......@@ -105,15 +105,6 @@ public class ContentReadingLogLogic extends AbstractLogic {
//ミリ秒から秒に変換(小数点以下切り捨て)
dto.duration = dto.duration + (int)(durationMilliSecond / 1000L);
if (ABVDataCache.getInstance().serviceOption.isSignage()) { // サイネージの場合
String today = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
String startDate = new SimpleDateFormat("yyyy-MM-dd").format(dto.startDate);
Logger.d(TAG, "pauseContentReadLog startDate=%s, today=%s, dto=%s", startDate, today, ArrayUtil.join(dto.getInsertValues(), "|"));
if (!today.equals(startDate)) { // 現在の日ではない場合
dto.status = ContentReadingStatus.readed.type(); // 終了扱いにする
}
}
contentReadingLogDao.updateContentReadingLog(dto);
if (dto.status == ContentReadingStatus.readed.type()) {
batchSendReadingLog();
......@@ -126,8 +117,8 @@ public class ContentReadingLogLogic extends AbstractLogic {
* @version 1.1.1
* @throws NetworkDisconnectedException
*/
public void endContentReadLog(long contentId, int mode) {
ContentReadingLogDto dto = contentReadingLogDao.getContentReadingLog(contentId, mode);
public void endContentReadLog(long contentId) {
ContentReadingLogDto dto = contentReadingLogDao.getContentReadingLog(contentId);
if (dto != null) {
//読み終わり
dto.status = ContentReadingStatus.readed.type();
......@@ -205,8 +196,8 @@ public class ContentReadingLogLogic extends AbstractLogic {
* @param latitude
* @param longitude
*/
public void updateLocationContentReadLog(long contentId, double latitude, double longitude, int mode) {
ContentReadingLogDto dto = contentReadingLogDao.getContentReadingLog(contentId, mode);
public void updateLocationContentReadLog(long contentId, double latitude, double longitude) {
ContentReadingLogDto dto = contentReadingLogDao.getContentReadingLog(contentId);
if (dto != null) {
// 小数第7位を四捨五入
BigDecimal bigDecimalLatitude = new BigDecimal(latitude);
......@@ -216,17 +207,4 @@ public class ContentReadingLogLogic extends AbstractLogic {
contentReadingLogDao.updateContentReadingLog(dto);
}
}
/**
* 前日のサイネージログでステータスが終了していないものを修正する
*
* @return
*/
public void modifyEndSignageLog() {
List<ContentReadingLogDto> unsentSignageLogList = contentReadingLogDao.getUnendSignageLog();
for (ContentReadingLogDto contentReadingLogDto : unsentSignageLogList) { // 未送信があれば一律読み終わりにステータスを変更する(resumeDateはチェックしない)
contentReadingLogDto.status = ContentReadingStatus.readed.type();
contentReadingLogDao.updateContentReadingLog(contentReadingLogDto);
}
}
}
......@@ -116,10 +116,6 @@ public class GroupLogic extends AbstractLogic {
isChangedUserGroupInfo = true;
}
}
if (ABVDataCache.getInstance().serviceOption.isSignage() && isChangedUserGroupInfo) {
// Signageの場合&グループ情報が更新された場合、lastFetchDateを削除する
AbstractDao.getDao(AcmsDao.class).clearFetchDate();
}
groupDao.commit();
} catch (Exception e) {
......
......@@ -12,7 +12,6 @@ import jp.agentec.abook.abv.bl.acms.client.json.ServerTimeZoneJSON;
import jp.agentec.abook.abv.bl.acms.client.parameters.AcmsParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.AppStoreNewLoginParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.EnterpriseNewLoginParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.KTLoginParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.NewAppStoreLoginParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.PasswordChangeParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.ServerTimeParameters;
......@@ -23,7 +22,6 @@ import jp.agentec.abook.abv.bl.acms.type.LoginStatus;
import jp.agentec.abook.abv.bl.acms.type.RequirePasswordChangeCode;
import jp.agentec.abook.abv.bl.acms.type.RequirePasswordChangeType;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.ABVProductCode;
import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.exception.ABVException;
import jp.agentec.abook.abv.bl.common.exception.ABVExceptionCode;
......@@ -107,25 +105,6 @@ public class UserAuthenticateLogic extends AbstractLogic {
return dto;
}
/**
* KT社用専用:ユーザ認証を行い、ユーザ情報を返す<br>
* 認証に成功したユーザの情報はキャッシュされる
* @param urlPath GroupId
* @param deviceToken GCMのキー
* @param authKey
* @return 認証に成功すると、ユーザ情報を格納した {@link MemberInfoDto} オブジェクトを返します。
* @throws NetworkDisconnectedException インターネットにつながっていないため、ログインできません。
* @throws ABVException インターネットにはつながっているが、ログインは失敗しました。失敗した原因は、{@link ABVException#getCode()} から確認できます。
* @throws Exception その他、例外です。
*/
public MemberInfoDto serverKTLogin(String urlPath, String authKey, String deviceToken) throws Exception {
MemberInfoDto dto = ktNewLogin(urlPath, authKey, deviceToken);
cache.refreshMemberInfo(dto);
contractLogic.initializeContractServiceOption();
return dto;
}
/**
* 認証なしログイン。
*
......@@ -236,14 +215,9 @@ public class UserAuthenticateLogic extends AbstractLogic {
result = DeleteDataType.All;
} else {
// 同一グループの場合
if(env.productCode == ABVProductCode.Dreamsky){
// Dreamskyの場合マイデータの情報のみ削除
result = DeleteDataType.Mydata;
} else {
// 警告なし
result = DeleteDataType.None;
}
}
} else {
// UDID上書きがfalseの場合、全て削除
result = DeleteDataType.All;
......@@ -650,90 +624,6 @@ public class UserAuthenticateLogic extends AbstractLogic {
return dto;
}
private MemberInfoDto ktNewLogin(String urlPath, String authKey, String deviceToken) throws Exception {
MemberInfoDto dto = null;
try {
AcmsClient acms = AcmsClient.getInstance(urlPath, networkAdapter);
String macAddress = ABVEnvironment.getInstance().deviceId;
if (StringUtil.isNullOrEmpty(macAddress)) {
throw new ABVException(ABVExceptionCode.C_E_SYSTEM_0004);
}
KTLoginParameters parameters = new KTLoginParameters(urlPath, authKey, ABVEnvironment.AppId, ABVEnvironment.getInstance().appVersion, ABVEnvironment.DeviceTypeId, deviceToken, macAddress);
dto = new MemberInfoDto();
cache.setUrlPath(urlPath);
dto = acms.ktLogin(parameters);
} catch (NetworkDisconnectedException e) {
// インターネットに繋がっていないため、ログインできない。
throw e;
} catch (AcmsException e) {
if (e.getMessage().equals(AcmsAuthenticationErrorCode.L001.name())) {
// ユーザID又はパスワードが違う
// UIに知らせる
setPasswordLockInfo(false);
throw new ABVException(ABVExceptionCode.S_E_ACMS_L001, e);
} else if (e.getMessage().equals(AcmsAuthenticationErrorCode.L002.name())) {
// 別のユーザが端末を利用中
// UIに知らせる
throw new ABVException(ABVExceptionCode.S_E_ACMS_L002, e);
} else if (e.getMessage().equals(AcmsAuthenticationErrorCode.L003.name())) {
// UDID未登録
// デバイストークン登録から再度行う。
// ※L003はACMS1.6でdeprecated
// if (!retry) {
// dto = newAppStoreLogin(urlPath, loginId, password, true, deviceToken);
// } else {
// // リトライは一回のみとする。
// throw new ABVException(ABVExceptionCode.C_E_SECURITY_1001, e);
// }
} else if (e.getMessage().equals(AcmsAuthenticationErrorCode.L004.name())) {
// ユーザが別の端末を使用中
// UIに知らせる
throw new ABVException(ABVExceptionCode.S_E_ACMS_L004, e);
} else if (e.getMessage().equals(AcmsAuthenticationErrorCode.L005.name())) {
// ユーザが属する事業者がサービス利用中ではない
// UIに知らせる
throw new ABVException(ABVExceptionCode.S_E_ACMS_L005, e);
} else if (e.getMessage().equals(AcmsAuthenticationErrorCode.L006.name())) {
// 端末未登録(自動登録無し)
// UIに知らせる
throw new ABVException(ABVExceptionCode.S_E_ACMS_L006, e);
} else if (e.getMessage().equals(AcmsAuthenticationErrorCode.L007.name())) {
// UDID登録済み・デバイストークン未登録(UDID自動登録あり)
// デバイストークン登録から再度行う。
// ※L007はACMS1.6でdeprecated
// if (!retry) {
// dto = newAppStoreLogin(urlPath, loginId, password, true, deviceToken);
// } else {
// // リトライは一回のみとする。
// throw new ABVException(ABVExceptionCode.C_E_SECURITY_1001, e);
// }
} else if (e.getMessage().equals(AcmsAuthenticationErrorCode.L008.name())) {
// 利用中止の事業者
throw new ABVException(ABVExceptionCode.S_E_ACMS_L008, e);
} else if (e.getMessage().equals(AcmsAuthenticationErrorCode.L009.name())) {
// ユーザが別の端末を使用中
throw new ABVException(ABVExceptionCode.S_E_ACMS_L009, e);
} else if (e.getMessage().equals(AcmsAuthenticationErrorCode.L010.name())) {
// 端末IDが特定できない。
throw new ABVException(ABVExceptionCode.S_E_ACMS_L010, e);
} else if (e.getMessage().equals(AcmsAuthenticationErrorCode.L012.name())) {
// デバイスのアクティブ数を超過。
throw new ABVException(ABVExceptionCode.S_E_ACMS_L012, e);
} else {
// 不明なエラー
throw new ABVException(ABVExceptionCode.C_E_SECURITY_1001, e);
}
} catch (Exception e) {
throw e;
}
return dto;
}
/**
* ログイン失敗情報の更新
*
......
package jp.agentec.abook.abv.bl.remote;
import java.net.InetAddress;
public class SocketAddressVO {
public InetAddress address;
public int port;
public String loginId;
public volatile int failedCount;
public SocketAddressVO(InetAddress address, int port, String loginId) {
this.address = address;
this.port = port;
this.loginId = loginId;
}
@Override
public String toString() {
return address.getHostAddress() + ":" + port + ":" + loginId;
}
@Override
public boolean equals(Object target) {
if (target instanceof SocketAddressVO) {
SocketAddressVO vo = (SocketAddressVO)target;
return address.equals(vo.address) && port == vo.port;
}
return false;
}
}
package jp.agentec.abook.abv.bl.remote;
import java.io.IOException;
import java.net.InetAddress;
import java.util.Observer;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.adf.net.socket.ServerService;
import jp.agentec.adf.net.socket.SocketUtil;
/**
* 連動(子側)の制御をするクラス
*
* @author tsukada
*
*/
public class SyncChildManager {
private static SyncChildManager instance;
private ServerService serverService;
public static SyncChildManager getInstance() {
if (instance == null) {
synchronized (SyncChildManager.class) {
if (instance == null) {
instance = new SyncChildManager();
}
}
}
return instance;
}
private SyncChildManager() {
}
public void startServer(int listenPort, Observer observer) throws IOException {
stopServer();
serverService = new ServerService(listenPort);
serverService.addObserver(observer);
serverService.startThread();
}
public void sendRegisterRequest(InetAddress address, int port, String loginId) throws IOException {
SocketUtil.sendUdpPacket(address, ABVEnvironment.getInstance().signageSyncBroadcastUdpPort, new SyncCommand(SyncCommand.REG_SYNC, port, loginId).getJsonStr(), false);
}
public void sendMsgRequest(InetAddress address, int port) throws IOException {
SocketUtil.sendUdpPacket(address, ABVEnvironment.getInstance().signageSyncBroadcastUdpPort, new SyncCommand(SyncCommand.REQ_PLAYINFO, port).getJsonStr(), false);
}
public void sendDeleteRequest(InetAddress address, int port) throws IOException {
SocketUtil.sendUdpPacket(address, ABVEnvironment.getInstance().signageSyncBroadcastUdpPort, new SyncCommand(SyncCommand.DEL_SYNC, port).getJsonStr(), false);
}
public void stopServer() {
if (serverService != null) {
serverService.stopAll();
}
}
public boolean isRunning() {
return serverService != null && serverService.isRunning();
}
}
package jp.agentec.abook.abv.bl.remote;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.common.util.JsonUtil;
import jp.agentec.adf.util.StringUtil;
import org.json.adf.JSONObject;
public class SyncCommand {
private static String TAG = "SyncCommand";
// json key
private static final String PAGE = "page";
private static final String INDEX = "index";
private static final String GROUP_ID = "groupId";
private static final String PLAYLIST_ID = "playlistId";
private static final String LOGIN_ID = "loginId";
private static final String PORT = "port";
public static final String CMD = "cmd";
// cmd
public static final String SCAN_SYNC = "SCAN_SYNC";
public static final String SCAN_OK = "SCAN_OK";
public static final String REG_SYNC = "REG_SYNC";
public static final String REG_OK = "REG_OK";
public static final String DEL_SYNC = "DEL_SYNC";
public static final String DEL_OK = "DEL_OK";
public static final String REQ_PLAYINFO = "REQ_PLAYINFO";
public static final String PLAYINFO = "PLAYINFO";
private static final String[] CMD_ARRAY = {SCAN_SYNC, SCAN_OK, REG_SYNC, REG_OK, DEL_SYNC, DEL_OK, REQ_PLAYINFO, PLAYINFO};
public String cmd;
public Integer port;
public String loginId;
public Integer groupId;
public Integer playlistId;
public Integer index;
public Integer page;
public SyncCommand() {
}
public SyncCommand(String cmd, Integer port) {
this.cmd = cmd;
this.port = port;
}
public SyncCommand(String cmd, String loginId) {
this.cmd = cmd;
this.loginId = loginId;
}
public SyncCommand(String cmd, Integer port, Integer groupId) {
this.cmd = cmd;
this.port = port;
this.groupId = groupId;
}
public SyncCommand(String cmd, String loginId, Integer groupId) {
this.cmd = cmd;
this.loginId = loginId;
this.groupId = groupId;
}
public SyncCommand(String cmd, Integer port, String loginId) {
this.cmd = cmd;
this.port = port;
this.loginId = loginId;
}
public SyncCommand(String cmd, Integer playlistId, Integer index, Integer page) {
this.cmd = cmd;
this.playlistId = playlistId;
this.index = index;
this.page = page;
}
public boolean parse(String jsonString) {
if (jsonString == null) {
Logger.e(TAG, "Invalid jsonString. ");
return false;
}
JSONObject json;
try {
json = new JSONObject(jsonString);
cmd = json.getString(CMD);
loginId = JsonUtil.getString(json, LOGIN_ID);
groupId = JsonUtil.getInt(json, GROUP_ID);
port = JsonUtil.getInt(json, PORT);
playlistId = JsonUtil.getInt(json, PLAYLIST_ID);
index = JsonUtil.getInt(json, INDEX);
page = JsonUtil.getInt(json, PAGE);
// validation
if (cmd == null || !StringUtil.contains(cmd, CMD_ARRAY)) {// コマンドのチェック
Logger.e(TAG, "Invalid command. " + cmd);
return false;
}
if (cmd.equals(SCAN_SYNC) || cmd.equals(REG_SYNC) || cmd.equals(DEL_SYNC) || cmd.equals(REQ_PLAYINFO)) { // port
if (port < 1024 || port > 65535) {
Logger.e(TAG, "Invalid port. " + jsonString);
return false;
}
}
if (cmd.equals(SCAN_SYNC)) {
if (groupId < 0) {
Logger.e(TAG, "Invalid groupId. " + jsonString);
return false;
}
}
if (cmd.equals(SCAN_OK) || cmd.equals(REG_SYNC) || cmd.equals(REG_OK)) { // loginId
if (StringUtil.isNullOrEmpty(loginId)) {
Logger.e(TAG, "Invalid loginId. " + jsonString);
return false;
}
}
if (cmd.equals(PLAYINFO)) { // playinfo
if (playlistId < 0 || index < 0 || page < 0) {
Logger.e(TAG, "Invalid playinfo. " + jsonString);
return false;
}
}
return true;
} catch (Exception e) {
Logger.e(TAG, "JSON parse error.", e);
return false;
}
}
public String getJsonStr() {
JSONObject json = new JSONObject();
if (cmd != null) {
json.put(CMD, cmd);
}
if (loginId != null) {
json.put(LOGIN_ID, loginId);
}
if (groupId != null) {
json.put(GROUP_ID, groupId);
}
if (port != null) {
json.put(PORT, port);
}
if (playlistId != null) {
json.put(PLAYLIST_ID, playlistId);
}
if (index != null) {
json.put(INDEX, index);
}
if (page != null) {
json.put(PAGE, page);
}
return json.toString();
}
}
package jp.agentec.abook.abv.bl.remote;
import java.io.IOException;
import java.net.ConnectException;
import java.net.InetAddress;
import java.util.Collections;
import java.util.Iterator;
import java.util.Observable;
import java.util.Observer;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
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.log.Logger;
import jp.agentec.adf.net.socket.ReceivePacketNotification;
import jp.agentec.adf.net.socket.SocketUtil;
import jp.agentec.adf.net.socket.UdpReceiver;
import jp.agentec.adf.util.CollectionUtil;
/**
* 連動(親側)の制御をするクラス
*
* @author tsukada
*
*/
public class SyncParentManager {
private static final String TAG = "SyncParentManager";
public static final int MAX_FAILED_COUNT = 5;
private static SyncParentManager instance;
private Set<SocketAddressVO> targetSet = Collections.newSetFromMap(new ConcurrentHashMap<SocketAddressVO, Boolean>());
private UdpReceiver udpReceiver;
private String lastMsg;
private Callback broadcastCallback;
public static SyncParentManager getInstance() {
if (instance == null) {
synchronized (SyncParentManager.class) {
if (instance == null) {
instance = new SyncParentManager();
}
}
}
return instance;
}
private SyncParentManager() {
}
/**
* ブロードキャストレシーバを起動する。
*
* スキャン要求の場合はレスポンスを返す
* 登録要求の場合、リストに追加する
*
* @param loginId スキャン要求の際にレスポンスとして付加するメッセージ
*/
public void startBroadcastReceiver(final String loginId, final int groupId, Callback callback) {
terminate();
broadcastCallback = callback;
udpReceiver = new UdpReceiver(ABVEnvironment.getInstance().signageSyncBroadcastUdpPort);
udpReceiver.addObserver(new Observer() {
@Override
public void update(Observable observable, Object msg) {
if (msg instanceof Exception) { // エラーの通知
if (broadcastCallback != null) {
broadcastCallback.callback(msg);
}
return;
}
ReceivePacketNotification notification = (ReceivePacketNotification)msg;
Logger.i(TAG, "Receive from: %s, msg=%s", notification.address, notification.msg);
if (broadcastCallback != null) { // メッセージ通知
broadcastCallback.callback(notification);
}
SyncCommand sc = new SyncCommand();
if (sc.parse(notification.msg)) {
if (sc.cmd.equals(SyncCommand.SCAN_SYNC)) { // スキャン要求
if (sc.groupId.equals(groupId)) { // グループが一致する場合のみ返す
sendResponse(notification.address, sc.port, new SyncCommand(SyncCommand.SCAN_OK, loginId).getJsonStr()); // レスポンスを返す
}
else {
Logger.w(TAG, "GroupId %s is different from mine %s. ignored.", sc.groupId, groupId);
}
}
else if (sc.cmd.equals(SyncCommand.REG_SYNC)) { // 登録要求
SocketAddressVO vo = new SocketAddressVO(notification.address, sc.port, sc.loginId);
addTarget(vo);
if (broadcastCallback != null) {
broadcastCallback.callback(vo);
}
sendResponse(notification.address, sc.port, new SyncCommand(SyncCommand.REG_OK, loginId).getJsonStr()); // レスポンスを返す
}
else if (sc.cmd.equals(SyncCommand.DEL_SYNC)) { // 削除要求
SocketAddressVO vo = new SocketAddressVO(notification.address, sc.port, sc.loginId);
removeFromTarget(vo);
if (broadcastCallback != null) {
broadcastCallback.callback(vo);
}
sendResponse(notification.address, sc.port, new SyncCommand(SyncCommand.DEL_OK, loginId).getJsonStr()); // レスポンスを返す
}
else if (sc.cmd.equals(SyncCommand.REQ_PLAYINFO)) { // 再送信要求
sendResponse(notification.address, sc.port, lastMsg); // レスポンスを返す
}
}
}
});
udpReceiver.startThread();
}
private void removeFromTarget(SocketAddressVO removedVO) {
for (Iterator<SocketAddressVO> iterator = targetSet.iterator(); iterator.hasNext();) {
SocketAddressVO vo = iterator.next();
if (vo.equals(removedVO)) {
targetSet.remove(vo);
break;
}
}
}
private void sendResponse(final InetAddress address, final int port, final String msg) {
CommonExecutor.execute(new Runnable() {
@Override
public void run() {
try {
Logger.d(TAG, "sendMessage to=%s:%s, msg=%s", address, port, msg);
SocketUtil.sendTcpMessage(address, port, msg);
} catch (ConnectException e) {
Logger.e(TAG, "sendMessage failed. " + address + ":" + port, e);
} catch (IOException e) {
Logger.e(TAG, "sendMessage failed. " + address + ":" + port, e);
}
}
});
}
/**
* デバイスのリストに対してメッセージを送信する
*
* @param msg
*/
public void distributeMessage(final String msg) {
lastMsg = msg;
if (targetSet.isEmpty()) {
Logger.w(TAG, "no target devices to distribute message " + msg);
}
for (final SocketAddressVO vo : targetSet) {
CommonExecutor.execute(new Runnable() {
@Override
public void run() {
try {
Logger.d(TAG, "sendMessage to=%s:%s, msg=%s", vo.address, vo.port, msg);
SocketUtil.sendTcpMessage(vo.address, vo.port, msg);
vo.failedCount = 0;
} catch (ConnectException e) {
Logger.e(TAG, "sendMessage failed. " + vo.address + ":" + vo.port, e);
vo.failedCount++;
} catch (IOException e) {
Logger.e(TAG, "sendMessage failed. " + vo.address + ":" + vo.port, e);
vo.failedCount++;
}
if (vo.failedCount > MAX_FAILED_COUNT) { // 指定回数以上失敗した場合削除する
Logger.w(TAG, "remove target. to=%s:%s", vo.address, vo.port);
targetSet.remove(vo);
if (broadcastCallback != null) {
broadcastCallback.callback(vo);
}
}
}
});
}
}
public void terminate() {
if (udpReceiver != null) {
udpReceiver.stopAll();
targetSet.clear();
}
}
public boolean isRunning() {
return udpReceiver != null && udpReceiver.isRunning();
}
public Set<SocketAddressVO> getChildList() {
return Collections.unmodifiableSet(targetSet);
}
public void addTarget(Set<SocketAddressVO> targetSet) {
for (SocketAddressVO vo : targetSet) {
addTarget(vo);
}
}
protected void addTarget(SocketAddressVO vo) {
if (!CollectionUtil.contains(targetSet, vo)) {
targetSet.add(vo);
}
}
}
......@@ -21,7 +21,6 @@ import jp.agentec.abook.abv.bl.acms.client.parameters.SubscriptionHistorySendPar
import jp.agentec.abook.abv.bl.acms.type.DownloadStatusType;
import jp.agentec.abook.abv.bl.acms.type.InstallType;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.Constant.SignageMode;
import jp.agentec.abook.abv.bl.common.db.SQLiteOpenHelper;
import jp.agentec.abook.abv.bl.common.db.impl.JDBCSQLiteOpenHelper;
import jp.agentec.abook.abv.bl.common.exception.ABVException;
......@@ -154,7 +153,7 @@ public class AcmsClientTest {
HttpRequestSender.testUserAgent = "Android";
ABVEnvironment.getInstance().isReader = true;
ABVEnvironment.getInstance().acmsAddress = "http://localhost:28080/acms";
ContentReadingLogParameters param = new ContentReadingLogParameters(null, 10000004694L, new Timestamp(System.currentTimeMillis()), new Timestamp(System.currentTimeMillis()), 1234, 3, null, null, SignageMode.ADMIN, null, null, null);
ContentReadingLogParameters param = new ContentReadingLogParameters(null, 10000004694L, new Timestamp(System.currentTimeMillis()), new Timestamp(System.currentTimeMillis()), 1234, 3, null, null, ReadingLogMode.DEFAULT, null, null, null);
boolean result = AcmsClient.getInstance(new PCNetworkAdapter()).contentReadingLog(param);
System.out.println(" result=" + result);
......
......@@ -9,9 +9,6 @@ import jp.agentec.abook.abv.bl.common.db.impl.JDBCSQLiteOpenHelper;
import jp.agentec.abook.abv.bl.data.DBConnector;
import jp.agentec.abook.abv.bl.dto.ContentDto;
import jp.agentec.abook.abv.bl.dto.ContentPageDto;
import jp.agentec.abook.abv.bl.dto.InteractiveInfoDto;
import jp.agentec.abook.abv.bl.dto.PlaylistDetailDto;
import jp.agentec.abook.abv.bl.dto.PlaylistDto;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
import junit.framework.TestCase;
......
......@@ -4,7 +4,6 @@ import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.db.SQLiteOpenHelper;
import jp.agentec.abook.abv.bl.common.db.impl.JDBCSQLiteOpenHelper;
import jp.agentec.abook.abv.bl.data.DBConnector;
import jp.agentec.abook.abv.bl.dto.PlaylistDto;
import jp.agentec.adf.util.DateTimeUtil;
import junit.framework.TestCase;
import junit.framework.TestSuite;
......
......@@ -9,9 +9,6 @@ import jp.agentec.abook.abv.bl.common.db.impl.JDBCSQLiteOpenHelper;
import jp.agentec.abook.abv.bl.data.DBConnector;
import jp.agentec.abook.abv.bl.dto.ContentDto;
import jp.agentec.abook.abv.bl.dto.ContentPageDto;
import jp.agentec.abook.abv.bl.dto.InteractiveInfoDto;
import jp.agentec.abook.abv.bl.dto.PlaylistDetailDto;
import jp.agentec.abook.abv.bl.dto.PlaylistDto;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
import junit.framework.TestCase;
......
......@@ -4,8 +4,6 @@ import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.db.SQLiteOpenHelper;
import jp.agentec.abook.abv.bl.common.db.impl.JDBCSQLiteOpenHelper;
import jp.agentec.abook.abv.bl.data.DBConnector;
import jp.agentec.abook.abv.bl.dto.PlaylistDto;
import jp.agentec.abook.abv.bl.dto.ScheduleDto;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
import junit.framework.TestCase;
......
......@@ -72,10 +72,4 @@ public class ContentLogicTest extends TestCase {
Logger.d("" + contentDto.contentName);
}
}
public void testGetSignageAutoDownloadTarget(){
for(ContentDto dto : logic.getSignageAutoDownloadTarget()){
System.out.println(dto.contentName);
}
}
}
package jp.agentec.abook.abv.bl.remote;
import java.util.ArrayList;
import java.util.List;
import java.util.Observable;
import java.util.Observer;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.Callback;
import jp.agentec.abook.abv.bl.common.log.LogLevel;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.adf.net.socket.ReceivePacketNotification;
import jp.agentec.adf.net.socket.SocketUtil;
import org.junit.Test;
public class SyncParentManagerTest {
@Test
public void exec() throws InterruptedException {
ABVEnvironment.getInstance().setLogLevel(LogLevel.debug);
ABVEnvironment.getInstance().signageSyncBroadcastUdpPort = 6222;
Thread parentThread = new Thread() {
@Override
public void run() {
SyncParentManager.getInstance().startBroadcastReceiver("myLoginIdAA", 1223, new Callback() {
@Override
public void callback(Object ret) {
System.out.println("callback: " + ret);
}
}); // ログインID(子側が親を選択するのにリストに表示する文字列)をパラメータで指定
SyncCommand sc = new SyncCommand(SyncCommand.PLAYINFO, 123, 456, 0);
SyncParentManager.getInstance().distributeMessage(sc.getJsonStr()); // メッセージを子に配信
sleepThread(1000);
sc.page++;
SyncParentManager.getInstance().distributeMessage(sc.getJsonStr());
sleepThread(1000);
sc.page++;
SyncParentManager.getInstance().distributeMessage(sc.getJsonStr());
sleepThread(1000);
sc.page++;
SyncParentManager.getInstance().distributeMessage(sc.getJsonStr());
sleepThread(1000);
sc.page++;
SyncParentManager.getInstance().distributeMessage(sc.getJsonStr());
sleepThread(3000);
sc.page++;
SyncParentManager.getInstance().distributeMessage(sc.getJsonStr());
}
public void sleepThread(long l) {
try {
Thread.sleep(l);
} catch (InterruptedException e) {
}
}
};
Thread childThread = new Thread() {
@Override
public void run() {
int listenPort = 22334; // 子側のListenポート(設定画面で指定)
final List<ReceivePacketNotification> parentList = new ArrayList<ReceivePacketNotification>(); // 親
parentList.clear();
try {
SyncChildManager.getInstance().startServer(listenPort, new Observer() {
private String TAG = "";
@Override
public void update(Observable observable, Object obj) {
Logger.d(TAG , "update: %s", obj);
ReceivePacketNotification notif = (ReceivePacketNotification)obj;
SyncCommand sc = new SyncCommand();
sc.parse(notif.msg);
if (sc.cmd.equals(SyncCommand.SCAN_OK)) {
parentList.add(notif);
for (ReceivePacketNotification notification : parentList) {
Logger.i(TAG , "Response from Parent: %s msg=%s", notification.address, notification.msg);
}
}
else {
Logger.i(TAG , "Message from Parent: %s", notif.msg);
}
}
});
Thread.sleep(1000);
String msg = new SyncCommand(SyncCommand.SCAN_SYNC, listenPort, 1223).getJsonStr();
System.out.println("sendUdpBroadcast " + ABVEnvironment.getInstance().signageSyncBroadcastUdpPort + ")" + msg);
SocketUtil.sendUdpBroadcast(ABVEnvironment.getInstance().signageSyncBroadcastUdpPort, msg, true);
Thread.sleep(3000);
for (ReceivePacketNotification notif : parentList) {
System.out.println("sendRegisterRequest " + notif.address);
SyncChildManager.getInstance().sendRegisterRequest(notif.address, listenPort, "hoge");
break;
}
} catch (Exception e) {
e.printStackTrace();
}
}
};
parentThread.start();
childThread.start();
parentThread.join();
childThread.join();
}
}
......@@ -28,10 +28,6 @@
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" />
<!-- Signage -->
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
<!-- QRCode -->
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.FLASHLIGHT"/>
......@@ -62,8 +58,6 @@
<service android:name="jp.agentec.abook.abv.cl.beacon.BeaconIntentService" />
<service android:name="jp.agentec.abook.abv.cl.beacon.BeaconPeriodicService" />
<service android:name="jp.agentec.abook.abv.ui.signage.service.SlideshowService" />
<service android:name="jp.agentec.abook.abv.ui.signage.service.AutoRestartService" />
<service android:name="jp.agentec.abook.abv.cl.push.ABVFcmListenerService">
<intent-filter>
......@@ -112,13 +106,6 @@
</intent-filter>
</receiver>
<receiver android:enabled="true" android:name="jp.agentec.abook.abv.launcher.android.BootUpReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
......@@ -262,14 +249,6 @@
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
</activity>
<activity
android:name="jp.agentec.abook.abv.ui.signage.activity.SlideShowActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:launchMode="singleTask"
android:label="SlideShowActivity"
android:hardwareAccelerated="false"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
</activity>
<activity
android:name="jp.agentec.abook.abv.ui.viewer.activity.PanoViewActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
......@@ -283,23 +262,14 @@
<activity android:name="jp.agentec.abook.abv.ui.home.activity.MeetingListActivityDialog" android:theme="@style/Theme.MyTheme.ModalDialog"/>
<activity android:name="jp.agentec.abook.abv.ui.home.activity.ShowQrcodeActivity"/>
<activity android:name="jp.agentec.abook.abv.ui.home.activity.ShowQrcodeActivityDialog" android:theme="@style/Theme.MyTheme.ModalDialog"/>
<activity android:name="jp.agentec.abook.abv.ui.home.activity.SignageSyncActivity" android:windowSoftInputMode="stateHidden"/>
<activity android:name="jp.agentec.abook.abv.ui.home.activity.SignageSyncActivityDialog" android:theme="@style/Theme.MyTheme.ModalDialog" android:windowSoftInputMode="stateHidden"/>
<activity android:name="jp.agentec.abook.abv.ui.home.activity.ABookSettingActivity" android:theme="@android:style/Theme.NoTitleBar"/>
<activity android:name="jp.agentec.abook.abv.ui.home.activity.ChangePasswordActivity" android:theme="@android:style/Theme.NoTitleBar.Fullscreen"/>
<activity android:name="jp.agentec.abook.abv.ui.home.activity.ChangePasswordActivityDialog" android:theme="@style/Theme.MyTheme.ModalDialog"/>
<activity android:name="jp.agentec.abook.abv.ui.home.activity.ScheduleListActivity" android:configChanges="orientation|screenSize"/>
<activity android:name="jp.agentec.abook.abv.ui.home.activity.ScheduleListActivityDialog" android:theme="@style/Theme.MyTheme.ModalDialog" android:configChanges="orientation|screenSize"/>
<activity android:name="jp.agentec.abook.abv.ui.home.activity.HelpActivity" android:configChanges="orientation|screenSize"/>
<activity android:name="jp.agentec.abook.abv.ui.home.activity.GuideViewActivity" android:configChanges="orientation|screenSize"/>
<activity android:name="jp.agentec.abook.abv.ui.home.activity.HelpActivityDialog" android:theme="@style/Theme.MyTheme.ModalDialog" android:configChanges="orientation|screenSize"/>
<activity android:name="jp.agentec.abook.abv.ui.signage.activity.ReadySlideShowActivity" android:launchMode="singleTask"/>
<activity android:name="jp.agentec.abook.abv.ui.signage.activity.InteractiveReadyActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:launchMode="singleInstance"
android:hardwareAccelerated="false" />
<activity android:name="jp.agentec.abook.abv.ui.viewer.activity.AudioPlayActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
......
# This file is used to override default values used by the Ant build system.
#
# This file must be checked into Version Control Systems, as it is
# integral to the build system of your project.
# This file is only used by the Ant script.
# You can use this to override default values such as
# 'source.dir' for the location of your java source folder and
# 'out.dir' for the location of your output folder.
# You can also use it define how the release builds are signed by declaring
# the following properties:
# 'key.store' for the location of your keystore and
# 'key.alias' for the name of the key to use.
# The password will be asked during the build when you use the 'release' target.
#alias
#ABook:ABook4AndroidReleaseKey
#SmartCatalog:SmartCatalogReleaseKey
#GMO:GmoSaaSReleaseKey
#Panasonic:PanasonicSaaSReleaseKey
#HKViewer:hkviewerreleaseKey
key.store=ABVJE_Android_Release.keystore
key.alias=ABook4AndroidReleaseKey
key.store.password=+ag2ntEc1?
key.alias.password=micrOSoft_!sa1ko
#Google Play
app_versioncode=1
app_custompackagename=jp.agentec.abookplus
app_customappname=ABook Biz
scheme_url=abookplus
acms_address=https://abookplus.agentec.jp/acms
download_server_address=https://abookplus.agentec.jp/acms
websocket_server_http_url=https://abookplus.agentec.jp/v1
websocket_server_ws_url=wss://abookplus.agentec.jp/v1
login_mode=2
account_path=agtcatalog
check_app_update=1
store_version=false
version_name=1.6.3
release_date=2015/7/28
log_level=2
repository_fqdn=s.abook.bz
google_public_key1=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4ZRmkZgLL9b5IzZplGDZWh5qCXR52CWo9aRvrB6sjbTWlW9Ra99hokKKZZChAMINpaKb61BkT7bX3sMD1T8+d8yC/
google_public_key2=jtdSzewQsnaXsnVfwUiqZMa5I7feBfs6FZ61LvnUWI6VTAQgwogI9Xa3DcfCfW404tdRJqozpaYFAbT0YQoOZip7jDDkITRVGaMI+m/gOVy2zGN/5+9iLn5XdS+UFEXB97
google_public_key3=LShEIudH7Q7jLZERczfa0PknZCC5I3G0bTNa/EndTMLIR6/W3DLHToDk5L5Nkhx8Nl6V12WGIgHKSLh9OrGZGNnlM8DBmG6ACLm0CXW7KPoSWasiXI7MW6CIs2wIDAQAB
hope_page=http://www.agentec.jp
contact_email=abook-appsupport@agentec.jp
copyright=&#169;2015 AGENTEC Co.,Ltd. All rights reserved.
not_use_widget=true
interactive_timer_enquete=600
interactive_timer_beacon=60
signage_ready_slideshow_interval=10
signage_content_refresh_interval=300
signage_pano_monitor_interval=60
cache_size=5
auto_restart=false
kiosk=false
repeat_default=false
error_report_flg=3
error_report_email=abook-appsupport@agentec.jp
hprof=false
app_log_retention=7
download_service_start_time=24:00
set_random_time=3
ext_monitor=false
signage_sync_broadcast_udp_port=41112
signage_sync_default_port=6261
isHomeApp=false
use_movie_thumbnail=false
isStoreProduct=false
......@@ -30,14 +30,9 @@ android {
versionCode app_versioncode as int;
versionName version_name
buildConfigField("boolean", "isHomeApp", "${isHomeApp}")
buildConfigField("boolean", "isStoreProduct", "${isStoreProduct}")
if (isHomeApp.toBoolean()) {
manifestPlaceholders = [HOME_APP: "android.intent.category.HOME"]
} else {
manifestPlaceholders = [HOME_APP: "android.intent.category.DEFAULT"]
}
}
dexOptions {
preDexLibraries = true
......
......@@ -53,24 +53,11 @@ android {
resValue("string", "error_report_email", "${error_report_email}")
resValue("integer", "app_log_retention", "${app_log_retention}")
resValue("bool", "hprof", "${hprof}")
resValue("integer", "interactive_timer_enquete", "${interactive_timer_enquete}")
resValue("integer", "interactive_timer_beacon", "${interactive_timer_beacon}")
resValue("integer", "signage_ready_slideshow_interval", "${signage_ready_slideshow_interval}")
resValue("integer", "signage_content_refresh_interval", "${signage_content_refresh_interval}")
resValue("bool", "kiosk", "${kiosk}")
resValue("bool", "auto_restart", "${auto_restart}")
resValue("bool", "show_init_admin", "${show_init_admin}")
resValue("bool", "ext_monitor", "${ext_monitor}")
resValue("integer", "fix_orientation_default", "${fix_orientation_default}")
resValue("bool", "use_movie_thumbnail", "${use_movie_thumbnail}")
resValue("integer", "signage_sync_broadcast_udp_port", "${signage_sync_broadcast_udp_port}")
resValue("integer", "signage_sync_default_port", "${signage_sync_default_port}")
resValue("bool", "reader_mode", "${reader_mode}")
resValue("string", "repository_fqdn", "${repository_fqdn}")
resValue("string", "default_content_key", "${default_content_key}")
resValue("array", "Beacon_UUID", "${Beacon_UUID}")
resValue("integer", "beacon_scan_interval", "${beacon_scan_interval}")
resValue("integer", "signage_pano_monitor_interval", "${signage_pano_monitor_interval}")
//abvFunctionOptions
resValue("integer", "login_mode", "${login_mode}")
......@@ -109,7 +96,6 @@ android {
resValue("integer", "setting_menu_app_info", "${setting_menu_app_info}")
resValue("integer", "setting_menu_url_path", "${setting_menu_url_path}")
resValue("integer", "setting_menu_loginId", "${setting_menu_loginId}")
resValue("integer", "setting_menu_signage_sync", "${setting_menu_signage_sync}")
resValue("integer", "viewer_menu_exit", "${viewer_menu_exit}")
resValue("integer", "viewer_menu_history", "${viewer_menu_history}")
resValue("integer", "viewer_menu_index", "${viewer_menu_index}")
......@@ -137,11 +123,6 @@ android {
resValue("string", "custom_uri_id", "${custom_uri_id}")
resValue("string", "custom_uri_pwd", "${custom_uri_pwd}")
resValue("string", "custom_uri_fixed_pwd", "${custom_uri_fixed_pwd}")
resValue("bool", "enable_linkcontent_cache", "${enable_linkcontent_cache}")
resValue("bool", "enable_toast_message", "${enable_toast_message}")
resValue("integer", "monitor_version", "${monitor_version}")
resValue("string", "monitor_package", "${monitor_package}")
resValue("integer", "default_touch_mode", "${default_touch_mode}")
resValue("integer", "edition_type", "${edition_type}")
}
sourceSets {
......
<?xml version="1.0" encoding="UTF-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_pressed="true"
android:drawable="@drawable/ic_schedule_list_on"/>
<item
android:drawable="@drawable/ic_schedule_list_off"/>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_pressed="true"
android:drawable="@drawable/ic_signage_mode_on"/>
<item
android:drawable="@drawable/ic_signage_mode_off"/>
</selector>
\ No newline at end of file
......@@ -223,7 +223,6 @@
<string name="no_search_history">検索履歴がありません。</string>
<string name="name_change">名前変更</string>
<string name="viewer_setting">ビューア</string>
<string name="signage_setting">サイネージ設定</string>
<string name="contractor">事業者</string>
<string name="showPassword">パスワードを表示する</string>
<string name="data_mgt">データ管理</string>
......@@ -589,7 +588,6 @@
<string name="parent_device">マスタ・デバイス</string>
<string name="start">開始</string>
<string name="terminate">停止</string>
<string name="ext_monitor">外部モニタ</string>
<string name="ext_monitor_summary">外部モニタを使用します。スレーブモードで使用する場合もONにしてください。</string>
<string name="parent_device_list">マスタ・デバイスリスト</string>
<string name="child_device_list">スレーブ・デバイスリスト</string>
......@@ -601,8 +599,6 @@
<string name="msg_master_select">以下のリストからマスタを選択してください。リストに対象マスタが表示されない場合、マスタの起動を確認の上、このダイアローグを閉じて、停止・開始を実行してください。</string>
<string name="waiting_master_info">マスタからの通知待ち</string>
<string name="cannot_show_ext_monitor">お使いのAndroid端末は、バージョン4.2.2未満であるため、外部出力はできません。待受画面のみ表示します。</string>
<string name="auto_restart">自動再起動</string>
<string name="auto_restart_summary">端末の起動時やアプリの異常終了時にアプリを自動的に再起動します。</string>
<string name="init_admin_mode">起動時管理者画面表示設定</string>
<string name="init_admin_mode_summary">端末の起動時管理者画面を表示します。</string>
<string name="pdf_image_size">外部モニタ解像度設定</string>
......
......@@ -223,7 +223,6 @@
<string name="no_search_history">검색 기록이 없습니다.</string>
<string name="name_change">이름변경</string>
<string name="viewer_setting">콘텐츠 열람 화면</string>
<string name="signage_setting">사이니지 설정</string>
<string name="contractor">사업자</string>
<string name="showPassword">패스워드를 표시</string>
<string name="data_mgt">데이터관리</string>
......@@ -589,8 +588,6 @@
<string name="parent_device">마스터・디바이스</string>
<string name="start">시작</string>
<string name="terminate">중지</string>
<string name="ext_monitor">외부모니터</string>
<string name="ext_monitor_summary">외부모니터를 사용합니다. 슬레이브 모드로 사용할 경우 ON으로 설정해 주세요.</string>
<string name="parent_device_list">마스터・디바이스리스트</string>
<string name="child_device_list">슬레이브・디바이스리스트</string>
<string name="child_server_start_failed">슬레이브 서버 기동에 실패 하였습니다.</string>
......@@ -600,9 +597,6 @@
<string name="receive_msg_failed">메세지 송신에 실패 하였습니다. 포트번호를 변경해서 다시 실행 해주세요.</string>
<string name="msg_master_select">밑의 일람으로부터 마스터를 선택해 주세요. 리스트에 대상 마스터가 표시 되지 않았을 경우, 마스트의 기동을 확인후 다시 실행해 주세요.</string>
<string name="waiting_master_info">마스터의 통지 기다림</string>
<string name="cannot_show_ext_monitor">사용 Android단말은、버전4.2.2미만이기 때문에 외부출력 할수 없습니다. 대기화면만 표시합니다.</string>
<string name="auto_restart">자동 재기동</string>
<string name="auto_restart_summary">단말기가 기동할때 또는 어플리케이션이 이상종료 할때에는 자동으로 재기동 합니다.</string>
<string name="init_admin_mode">기동 시 관리자화면 표시 설정</string>
<string name="init_admin_mode_summary">단말기가 기동할 때, 관리자 화면을 표시합니다.</string>
<string name="pdf_image_size">외부 모니터 해상도 설정</string>
......
......@@ -223,7 +223,6 @@
<string name="no_search_history">No search history.</string>
<string name="name_change">Change Name</string>
<string name="viewer_setting">Viewer</string>
<string name="signage_setting">Signage Setting</string>
<string name="contractor">Company</string>
<string name="showPassword">show password</string>
<string name="data_mgt">Data Management</string>
......@@ -584,14 +583,11 @@
<string name="display_preparing">Waiting for display</string>
<string name="no_content">Content not found</string>
<string name="signage_sync">Signage Sync Setting</string>
<string name="signage_sync_summary">configure Signage Sync.</string>
<string name="is_parent">Master mode</string>
<string name="port_number">Port Number</string>
<string name="parent_device">Master device</string>
<string name="start">Start</string>
<string name="terminate">Terminate</string>
<string name="ext_monitor">External Monitor</string>
<string name="ext_monitor_summary">Use external monitor. If you run this device as slave mode, set ON.</string>
<string name="parent_device_list">Master device list</string>
<string name="child_device_list">Slave device list</string>
......@@ -602,9 +598,6 @@
<string name="receive_msg_failed">Receive message failed. Change port number and restart.</string>
<string name="msg_master_select">Select a master device from the following list. If your target is not listed, confirm master device already started, close this dialog, terminate and start again.</string>
<string name="waiting_master_info">Waiting for master info</string>
<string name="cannot_show_ext_monitor">The android version of this device is below 4.2.2, unable to output to external monitor. Only Interactive Ready screen is shown.</string>
<string name="auto_restart">Auto Restart</string>
<string name="auto_restart_summary">When device boots or app ends abnormaly, start or restart app automatically.</string>
<string name="init_admin_mode">Setting to display Admin Screen</string>
<string name="init_admin_mode_summary">When device boots, Admin screen is shown.</string>
<string name="pdf_image_size">External monitor resolution</string>
......
......@@ -220,28 +220,6 @@
android:src="@drawable/icon_home_logo"
android:visibility="gone" />
<ImageButton
android:id="@+id/icon_signage_mode"
style="@style/ToolBarIcon"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="1dp"
android:contentDescription="favorite"
android:onClick="onClickSignageMode"
android:src="@drawable/ic_signage_mode"
android:tag="off"
android:visibility="gone" />
<ImageButton
android:id="@+id/icon_schedule_list"
style="@style/ToolBarIcon"
android:layout_marginBottom="2dp"
android:layout_marginRight="10dp"
android:contentDescription="@string/content_description"
android:onClick="onClickScheduleList"
android:src="@drawable/ic_schedule_list"
android:visibility="gone" />
<RadioGroup
android:id="@+id/segment_group"
android:layout_width="wrap_content"
......@@ -285,28 +263,6 @@
android:layout_height="wrap_content"/>
</LinearLayout>
<!--
<ImageButton
android:id="@+id/icon_signage_mode"
style="@style/ToolBarIcon"
android:layout_marginLeft="10dp"
android:layout_marginTop="3dp"
android:contentDescription="favorite"
android:onClick="onClickSignageMode"
android:src="@drawable/ic_signage_mode"
android:tag="off"
android:visibility="gone" />
<ImageButton
android:id="@+id/icon_schedule_list"
style="@style/ToolBarIcon"
android:layout_marginBottom="2dp"
android:layout_marginLeft="10dp"
android:contentDescription="@string/content_description"
android:onClick="onClickScheduleList"
android:src="@drawable/ic_schedule_list"
android:visibility="gone" />
-->
<TextView
android:id="@+id/main_title"
......
......@@ -80,25 +80,6 @@
android:textColor="@color/text_select"
android:visibility="gone" />
<ImageView
android:id="@+id/icon_signage_mode"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:contentDescription="@string/content_description"
android:onClick="onClickSignageMode"
android:padding="10dp"
android:src="@drawable/ic_signage_mode"
android:visibility="gone" />
<ImageView
android:id="@+id/icon_schedule_list"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:contentDescription="@string/content_description"
android:onClick="onClickScheduleList"
android:padding="10dp"
android:src="@drawable/ic_schedule_list"
android:visibility="gone" />
<TextView
android:id="@+id/flashingTxt"
android:layout_marginLeft="10dp"
......
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/root_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/app_color"
>
<!--
<android.support.v7.app.MediaRouteButton
android:id="@+id/media_route_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:mediaRouteTypes="user" android:visibility="visible" />
-->
<LinearLayout
android:id="@+id/no_background"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_centerInParent="true"
android:orientation="vertical" >
<TextView
android:id="@+id/touchMsg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textColor="@android:color/white"
android:textSize="30sp" />
<RelativeLayout
android:id="@+id/imgWrapLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:gravity="center"
android:orientation="vertical" >
</RelativeLayout>
<ScrollView
android:id="@+id/scrollView"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical" >
<TextView
android:id="@+id/contentName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:layout_marginTop="20dp"
android:gravity="center"
android:text="@string/interactive_default_content"
android:textColor="@android:color/white"
android:textSize="45sp" />
<TextView
android:id="@+id/contentDetail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:text=""
android:textColor="@android:color/white"
android:textSize="20sp" />
</LinearLayout>
</ScrollView>
</LinearLayout>
</RelativeLayout>
\ No newline at end of file
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/root_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/black"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/no_background"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/ready_slide_show"
android:textColor="@android:color/white"
android:textSize="45sp" />
<ViewFlipper
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="75dp"
android:autoStart="true"
android:flipInterval="500" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/content_description"
android:src="@drawable/flower01" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/content_description"
android:src="@drawable/flower02" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/content_description"
android:src="@drawable/flower03" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/content_description"
android:src="@drawable/flower04" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/content_description"
android:src="@drawable/flower05" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/content_description"
android:src="@drawable/flower06" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/content_description"
android:src="@drawable/flower07" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/content_description"
android:src="@drawable/flower08" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/content_description"
android:src="@drawable/flower09" />
</ViewFlipper>
</LinearLayout>
<ImageView
android:id="@+id/background"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="@string/content_description"
android:scaleType="fitXY"
android:visibility="gone" />
<ImageView
android:id="@+id/info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:contentDescription="@string/content_description"
android:src="@drawable/ic_info_on" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/slideShowBaseLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/black"
android:gravity="center">
<include
layout="@layout/ac_slide_show_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
<View
android:id="@+id/bottomView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_alignParentBottom="true"
/>
<LinearLayout
android:id="@+id/telopLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/black_translucent"
android:layout_above="@id/bottomView"
>
<jp.agentec.abook.abv.ui.signage.view.TelopView
android:id="@+id/telopImage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="visible"
/>
</LinearLayout>
<include
android:id="@+id/weatherLayout"
layout="@layout/weather_forecast_layout"
android:visibility="visible"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@id/telopLayout"
/>
<Button
android:id="@+id/alertView"
android:layout_width="5dp"
android:layout_height="5dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:background="#ffff00"
android:visibility="invisible" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/slideShowBaseLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center" >
<ImageView
android:id="@+id/backgroundView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY" />
<ImageView
android:id="@+id/viewPageImage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitCenter" />
<VideoView
android:id="@+id/contentVideoView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true" />
<jp.agentec.abook.abv.ui.viewer.view.SignageLinkContentView
android:id="@+id/contentWebView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<jp.agentec.abook.abv.ui.viewer.view.SignageXWalkWebView
android:id="@+id/contentXWalkWebView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/content_list_selector"
android:orientation="vertical" >
<TextView
android:id="@+id/text_src_page"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/light_blue"
android:padding="10dp"
android:text="@string/dummy_str"
android:textColor="@android:color/black" />
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:background="@android:color/black" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="10dp" >
<RelativeLayout
android:id="@+id/content_thumbnail_layout"
android:layout_width="@dimen/content_thumbnail_image_size"
android:layout_height="@dimen/content_thumbnail_image_size"
android:layout_gravity="bottom|center_horizontal" >
<FrameLayout
android:id="@+id/imageframe"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/thumbnail_border"
android:padding="1dp" >
<ImageView
android:id="@+id/img_thumbnail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/content_description"
android:scaleType="center"
android:src="@drawable/no_image" />
</FrameLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:orientation="vertical"
android:padding="10dp" >
<TextView
android:id="@+id/text_content_name"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:ellipsize="end"
android:text="@string/dummy_str"
android:textColor="@color/text_select"
android:textSize="25dp"
android:maxLines="1" />
<TextView
android:id="@+id/text_contract_content_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="12dp"
android:gravity="center_vertical"
android:text="@string/dummy_str"
android:textColor="@color/text_select" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="12dp"
android:gravity="center_vertical"
android:orientation="horizontal" >
<TextView
android:id="@+id/text_dst_page"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/dummy_str"
android:textColor="@color/text_select" />
<TextView
android:id="@+id/text_download_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/dummy_str"
android:textColor="@color/text_select" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/content_list_selector"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/layout_playlist_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="@+id/text_playlist_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/light_blue"
android:drawableLeft="@drawable/ic_schedule_date"
android:ellipsize="end"
android:gravity="center_vertical"
android:padding="5dp"
android:text="@string/dummy_str"
android:textColor="@android:color/black"
android:maxLines="1" />
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:background="@android:color/black" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="10dp" >
<RelativeLayout
android:id="@+id/content_thumbnail_layout"
android:layout_width="@dimen/content_thumbnail_image_size"
android:layout_height="@dimen/content_thumbnail_image_size"
android:layout_gravity="bottom|center_horizontal" >
<FrameLayout
android:id="@+id/imageframe"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/thumbnail_border"
android:padding="1dp" >
<ImageView
android:id="@+id/img_thumbnail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/content_description"
android:scaleType="center"
android:src="@drawable/no_image" />
</FrameLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:orientation="vertical"
android:padding="10dp" >
<TextView
android:id="@+id/text_content_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:text="@string/dummy_str"
android:textColor="@color/text_select"
android:textSize="25dp"
android:maxLines="1" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginLeft="12dp"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="horizontal" >
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/schedule_stay_time"
android:textColor="@color/text_select" />
<TextView
android:id="@+id/text_stay_time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="@string/schedule_second"
android:textColor="@color/text_select" />
<TextView
android:id="@+id/text_animation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="5dp"
android:text="@string/slide_show_animation_no"
android:textColor="@color/text_select" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="12dp"
android:orientation="horizontal" >
<TextView
android:id="@+id/text_contract_content_id"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/dummy_num"
android:textColor="@color/text_select" />
<TextView
android:id="@+id/text_download_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="5dp"
android:text="@string/downloading"
android:textColor="@color/text_select" />
</LinearLayout>
</LinearLayout>
<ImageView
android:id="@+id/iv_navigation_interactive_info"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:contentDescription="@string/content_description"
android:scaleType="centerInside"
android:src="@drawable/ic_navigation_next_item" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/app_color"
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/toolbar_layout"
style="@style/ToolBarHolo"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<Button
android:id="@+id/close_dialog"
style="@style/ButtonABookGray"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="@string/close" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:paddingLeft="20dp"
android:text="@string/signage_sync"
android:textColor="@color/text_select"
android:textSize="@dimen/app_normal_text_size" />
</RelativeLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="10dp"
android:paddingLeft="30dp"
android:paddingRight="30dp"
android:paddingTop="10dp" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp">
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/text_dialog"
android:textStyle="bold"
android:layout_marginRight="10dp"
android:text="@string/is_parent" />
<Switch
android:id="@+id/swIsParent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
/>
<ToggleButton
android:id="@+id/tbIsParent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
/>
</LinearLayout>
<LinearLayout
android:id="@+id/etxPortLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp">
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="@color/text_dialog"
android:layout_marginRight="10dp"
android:text="@string/port_number" />
<EditText
android:id="@+id/etxPort"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="5"
android:paddingTop="0dp"
android:paddingBottom="0dp"
android:inputType="number" >
<requestFocus />
</EditText>
</LinearLayout>
<LinearLayout
android:id="@+id/parentInfoLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp">
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="@color/text_dialog"
android:layout_marginRight="10dp"
android:text="@string/parent_device" />
<TextView
android:id="@+id/parentInfo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/text_disable"
>
<requestFocus />
</TextView>
</LinearLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true" >
<Button
android:id="@+id/btnStartEnd"
style="@style/ButtonABookLight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="30dp"
android:paddingRight="30dp"
android:text="@string/start" />
<Button
android:id="@+id/btnChildList"
style="@style/ButtonABookLight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/child_device_list" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
......@@ -62,52 +62,6 @@
android:summary="@string/marking_share_auto_save_summary"
android:title="@string/marking_share_auto_save" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/signage_setting" android:key="signage_setting" >
<CheckBoxPreference
android:key="extMonitor"
android:summary="@string/ext_monitor_summary"
android:title="@string/ext_monitor"
android:defaultValue="@bool/ext_monitor" />
<PreferenceScreen
android:key="signageSync"
android:summary="@string/signage_sync_summary"
android:title="@string/signage_sync" >
</PreferenceScreen>
<PreferenceScreen
android:key="pdfImageSize"
android:summary="@string/pdf_image_size_summary"
android:title="@string/pdf_image_size" >
</PreferenceScreen>
<CheckBoxPreference
android:key="autoRestart"
android:summary="@string/auto_restart_summary"
android:title="@string/auto_restart"
android:defaultValue="@bool/auto_restart" />
<CheckBoxPreference
android:key="initAdminMode"
android:summary="@string/init_admin_mode_summary"
android:title="@string/init_admin_mode"
android:defaultValue="false"/>
<ListPreference
android:defaultValue="2"
android:key="fixOrientation"
android:summary="@string/fix_orientation_summary"
android:title="@string/fix_orientation"
android:dialogTitle="@string/fix_orientation"
android:entries="@array/fix_orientation"
android:entryValues="@array/fix_orientation_values" />
<PreferenceScreen
android:key="monitorInstall"
android:summary="@string/monitor_install_summary"
android:title="@string/monitor_install" />
<ListPreference
android:key="monitorTouchMode"
android:summary="@string/touch_desc"
android:title="@string/touch_mode"
android:dialogTitle="@string/touch_mode"
android:entries="@array/monitorTouchMode"
android:entryValues="@array/monitorTouchMode_values" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/account" android:key="account_set">
<PreferenceScreen
android:key="accountPath"
......
......@@ -142,11 +142,6 @@ public class ABVUncaughtExceptionHandler implements UncaughtExceptionHandler {
} catch (Exception e2) {}
}
}
// アプリを再起動する
if (PreferenceHelper.getInstance().isAutoRestart() && restartOk) {
Logger.w(TAG, "[uncaughtException]:restartApplication");
((ABVApplication)mContext).getABVApplicationHelper().restartApplication();
}
mDefaultHandler.uncaughtException(thread, t);
}
......
......@@ -37,21 +37,6 @@ public class PreferenceHelper {
return mContext != null;
}
public boolean isExtMonitor() {
boolean def = mContext.getResources().getBoolean(R.bool.ext_monitor);
return PreferenceUtil.get(mContext, DefPrefKey.EXT_MONITOR, def);
}
public boolean isAutoRestart() {
boolean def = mContext.getResources().getBoolean(R.bool.auto_restart);
return PreferenceUtil.get(mContext, DefPrefKey.AUTO_RESTART, def);
}
public int getFixOrientation() {
int def = mContext.getResources().getInteger(R.integer.fix_orientation_default);
return PreferenceUtil.getInt(mContext, DefPrefKey.FIX_ORIENTATION, "" + def);
}
public Size getPdfImageSize(Size defSize) {
if (PreferenceUtil.userPrefContains(mContext, UserPrefKey.PDF_IMAGE_SIZE)) {
String val = PreferenceUtil.getUserPref(mContext, UserPrefKey.PDF_IMAGE_SIZE, "");
......
......@@ -78,7 +78,6 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
// ignore
Logger.e(TAG, e.toString());
}
}
private void sendNotification(Map<String, String> message) {
......
......@@ -49,9 +49,9 @@ public class ContentLogUtil {
* @param contentId
* @return
*/
public int startContentReadLog(Context context, final long contentId, final int mode, boolean permissionAccessLocation) {
public int startContentReadLog(Context context, final long contentId, boolean permissionAccessLocation) {
// 閲覧ログ開始
int readingLogId = contentReadingLogLogic.startContentReadLog(contentId, mode);
int readingLogId = contentReadingLogLogic.startContentReadLog(contentId);
// 位置情報取得許可、サービスオプション、ビルドオプションチェック
if (permissionAccessLocation && checkUsableReadinglogGps(contentId) && context.getResources().getInteger(R.integer.usable_location_service) == 1) {
......@@ -64,7 +64,7 @@ public class ContentLogUtil {
@Override
public void onGetLocation(Location location) {
contentReadingLogLogic.updateLocationContentReadLog(contentId, location.getLatitude(), location.getLongitude(), mode);
contentReadingLogLogic.updateLocationContentReadLog(contentId, location.getLatitude(), location.getLongitude());
}
});
locationManagerUtil.startLocationService();
......
......@@ -4,37 +4,18 @@ import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.os.Handler;
import android.support.multidex.MultiDex;
import android.support.multidex.MultiDexApplication;
import android.view.View;
import java.util.Date;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.cl.beacon.BeaconPeriodicService;
import jp.agentec.abook.abv.cl.helper.ABVUncaughtExceptionHandler;
import jp.agentec.abook.abv.cl.helper.PreferenceHelper;
import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.PrefName;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.SignagePrefKey;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.UserPrefKey;
import jp.agentec.abook.abv.ui.common.timertask.ABookTimer;
import jp.agentec.abook.abv.ui.common.timertask.ScheduleCheckTask;
import jp.agentec.abook.abv.ui.common.timertask.ScheduleCheckTask.ScheduleCheckListener;
import jp.agentec.abook.abv.ui.common.timertask.UpdateNewContentTask;
import jp.agentec.abook.abv.ui.common.timertask.UpdateNewContentTask.UpdateNewContentCheckListener;
import jp.agentec.abook.abv.ui.common.util.Initializer;
import jp.agentec.abook.abv.ui.home.activity.HomeUIActivity;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.signage.service.AutoRestartService;
import jp.agentec.abook.abv.ui.signage.view.SlideShowView;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.FileUtil;
public class ABVApplication extends MultiDexApplication {
......@@ -46,13 +27,6 @@ public class ABVApplication extends MultiDexApplication {
//プッシュ―メッセージでコンテンツをダウンロード場合ダウンロードした後に自動的に開く
private boolean isAutoOpenAfterDownloadContent;
// Timer
private ABookTimer updateNewContentTimer = null;
private ABookTimer scheduleCheckTimer = null;
// slideshow
private SlideShowView slideShowView;
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
......@@ -82,51 +56,12 @@ public class ABVApplication extends MultiDexApplication {
startService(new Intent(this, BeaconPeriodicService.class));
}
if (PreferenceHelper.getInstance().isAutoRestart()) {
if (PreferenceHelper.getInstance().isAppVersionUpProcessing()) {
// バージョンアップ中であるため、再起動処理を行わない
// バージョンアップフラグはOFFにして、次回の起動処理で再起動オプション通りに動作するようにする
PreferenceUtil.put(getApplicationContext(), AppDefType.DefPrefKey.APP_VERSIONUP_PROCESSING, false);
android.os.Process.killProcess(android.os.Process.myPid());
return;
}
startService(new Intent(this, AutoRestartService.class));
// 通常起動時にはすぐ監視は終了する
// ただ、アプリがKillされたとき、この処理が呼ばれるため、チェックタスクを実施することにしている
abvApplicationHelper = new ABVApplicationHelper(this);
if (!PreferenceUtil.getUserPref(this, UserPrefKey.ADMIN_MODE, true)) { // サイネージモードで終了した時のみ監視スレッドを開始する
abvApplicationHelper.startWatcher();
}
}
if (ABVEnvironment.getInstance().isSignage()) {
taskManageThread();
}
if (ABVEnvironment.getInstance().isABookCheck()) {
//添付ファイル臨時保存場所削除
FileUtil.delete(ABVEnvironment.getInstance().getCacheTempAttachedImageDirPath());
}
}
public void taskManageThread() {
final Handler handler = new Handler();
handler.post(new Runnable() {
@Override
public void run() {
Logger.d("*** currentDate : " + DateTimeUtil.toString(DateTimeUtil.getCurrentDate(), DateTimeFormat.yyyyMMddHHmmss_hyphen));
if (DateTimeUtil.isAbnormalYear() && ABVEnvironment.getInstance().networkAdapter.isNetworkConnected()
&& scheduleCheckTimer != null && updateNewContentTimer != null) {
Logger.d("*** RestartDate current Date : " + DateTimeUtil.toString(DateTimeUtil.getCurrentDate(), DateTimeFormat.yyyyMMddHHmmss_hyphen));
stopScheduleCheckTimer();
stopUpdateNewContentTimer();
startScheduleCheckTimer();
startUpdateNewContentTimer();
}
handler.postDelayed(this, 10000); //10秒毎に再度実行
}
});
}
@Override
public void onTerminate() { // 呼ばれることはないので意味がないが
super.onTerminate();
......@@ -134,8 +69,6 @@ public class ABVApplication extends MultiDexApplication {
Logger.v(TAG,"--- onTerminate() in ---");
super.onTerminate();
try {
stopScheduleCheckTimer();
stopUpdateNewContentTimer();
ActivityHandlingHelper.getInstance().destroy();
} catch (Exception e) {
Logger.e(TAG,"--- onTerminate() stopContentDownlodKickService ---", e);
......@@ -187,120 +120,10 @@ public class ABVApplication extends MultiDexApplication {
}
}
public void startUpdateNewContentTimer() {
if (updateNewContentTimer == null) {
updateNewContentTimer = new ABookTimer();
// 5分ごとにチェックする
Logger.i(TAG, "startUpdateNewContentTimer");
// スケジュール開始と同時にすぐ新着更新を開始する
int interval = getResources().getInteger(R.integer.signage_content_refresh_interval) * 1000;
updateNewContentTimer.schedule(new UpdateNewContentTask(interval), 0, interval);
}
}
public void stopUpdateNewContentTimer() {
if (updateNewContentTimer != null) {
updateNewContentTimer.cancel();
updateNewContentTimer.purge();
Logger.i(TAG, "[stopUpdateNewContentTimer]:Success");
updateNewContentTimer = null;
}
}
public void checkAndRestartUpdateNewContentTimer() {
SharedPreferences pref = getSharedPreferences(PrefName.SIGNAGE_INFO, Context.MODE_PRIVATE);
String checkDateStr = pref.getString(SignagePrefKey.LAST_UPDATE_NEW_CONTENT_DATE, null);
if (checkDateStr == null) {
return;
}
Date checkDate = DateTimeUtil.toDate(checkDateStr, DateTimeFormat.yyyyMMddHHmmss_hyphen);
Date nowDate = new Date();
// インターバルの3倍以上停止している場合再起動する。
if ((nowDate.getTime() - checkDate.getTime()) > (getResources().getInteger(R.integer.signage_content_refresh_interval) * 1000 * 3)) {
Logger.w("[checkAndRestartUpdateNewContentTimer]:restart UpdateNewContentTimer");
stopUpdateNewContentTimer();
startUpdateNewContentTimer();
}
}
public void setUpdateNewContentCheckListener(UpdateNewContentCheckListener listener) {
if (updateNewContentTimer != null) {
UpdateNewContentTask newContentTask = (UpdateNewContentTask) updateNewContentTimer.getTimerTask();
if (newContentTask != null) {
newContentTask.setUpdateNewContentCheckListener(listener);
}
}
}
public void startScheduleCheckTimer() {
if (scheduleCheckTimer == null) {
scheduleCheckTimer = new ABookTimer();
// 10秒ごとにチェックする
Logger.i(TAG, "startScheduleCheckTimer");
int interval = getResources().getInteger(R.integer.signage_ready_slideshow_interval) * 1000;
scheduleCheckTimer.schedule(new ScheduleCheckTask(), interval, interval);
}
}
public void stopScheduleCheckTimer() {
if (scheduleCheckTimer != null) {
scheduleCheckTimer.cancel();
scheduleCheckTimer.purge();
Logger.i(TAG, "[stopScheduleCheckTimer]:Success");
scheduleCheckTimer = null;
}
}
public void checkAndRestartScheduleCheckTimer() {
SharedPreferences pref = getSharedPreferences(PrefName.SIGNAGE_INFO, Context.MODE_PRIVATE);
String checkDateStr = pref.getString(SignagePrefKey.LAST_CHECK_SCHEDULE_DATE, null);
if (checkDateStr == null) {
return;
}
Date checkDate = DateTimeUtil.toDate(checkDateStr, DateTimeFormat.yyyyMMddHHmmss_hyphen);
Date nowDate = new Date();
// インターバルの3倍以上停止している場合再起動する。
if ((nowDate.getTime() - checkDate.getTime()) > (getResources().getInteger(R.integer.signage_ready_slideshow_interval) * 1000 * 3)) {
Logger.w(TAG, "[checkAndRestartScheduleCheckTimer]:restart ScheduleCheckTimer");
// LAST_CHECK_SCHEDULE_DATEを初期化
// 一度Timerをリスタートするとチェック時間がずれているままでチェックを続けている問題の対応
pref.edit().remove(SignagePrefKey.LAST_CHECK_SCHEDULE_DATE).commit();
stopScheduleCheckTimer();
startScheduleCheckTimer();
}
}
public void setScheduleCheckListener(ScheduleCheckListener listener) {
if (scheduleCheckTimer != null) {
ScheduleCheckTask scheduleCheckTask = (ScheduleCheckTask) scheduleCheckTimer.getTimerTask();
if (scheduleCheckTask != null) {
scheduleCheckTask.setScheduleCheckListener(listener);
}
}
}
public ABVApplicationHelper getABVApplicationHelper() {
return abvApplicationHelper;
}
public SlideShowView getSlideShowView() {
return slideShowView;
}
public void setSlideShowView(SlideShowView slideShowView) {
this.slideShowView = slideShowView;
}
public boolean isMainActivityCalled() {
return isMainActivityCalled;
}
......
......@@ -8,9 +8,6 @@ import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.UserPrefKey;
import jp.agentec.abook.abv.ui.home.activity.HomeUIActivity;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.signage.activity.InteractiveReadyActivity;
import jp.agentec.abook.abv.ui.signage.activity.ReadySlideShowActivity;
import jp.agentec.abook.abv.ui.signage.activity.SlideShowActivity;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
......@@ -21,7 +18,6 @@ public class ABVApplicationHelper {
private static final int MAX_COUNT = 10;
private static final int CHECK_INTERVAL = 3;
private Thread thread;
private Context mContext;
private volatile boolean keep;
private int checkCount;
......@@ -30,66 +26,6 @@ public class ABVApplicationHelper {
this.mContext = context;
}
public void startWatcher() {
keep = true;
thread = new Thread() {
@Override
public void run() {
Logger.i(TAG, "start watcher thread.");
String cause = "";
while (true) {
if (!keep) {
cause = " set keep=false";
break;
}
try {
MemberInfoDto memberInfo = AbstractLogic.getLogic(UserAuthenticateLogic.class).getMemberInfo();
if (memberInfo == null) { // ログインしていない場合はスレッド終了
cause = "not login";
break;
}
if (!PreferenceUtil.userPrefContains(mContext, UserPrefKey.PDF_IMAGE_SIZE)) { // pdf image未設定の場合もスレッド終了
cause = "not set pdfImageSize";
break;
}
if (ActivityHandlingHelper.getInstance().contains(ReadySlideShowActivity.class, SlideShowActivity.class, InteractiveReadyActivity.class, HomeUIActivity.class)) {
cause = "valid start up";
break;
}
checkCount++;
Logger.d(TAG, "Watcher thread.Count=" + MAX_COUNT + ", checkCount=" + checkCount);
if (checkCount > MAX_COUNT) {
Logger.w(TAG, "The application does not seem to start up correctly after " + (MAX_COUNT * CHECK_INTERVAL) + " sec. Try restart!");
restartApplication();
break;
}
} catch (Exception e) {
Logger.e(TAG, "watcher encountered a error.", e);
}
try {
Thread.sleep(CHECK_INTERVAL * 1000);
} catch (InterruptedException e) {
if (keep) {
cause = "interrupt";
break;
}
}
}
Logger.i(TAG, "end watcher thread due to " + cause);
}
};
thread.start();
}
public void stopWatcher() {
keep = false;
if (thread != null) {
thread.interrupt();
}
}
/**
* 2秒後に再起動する
*/
......
package jp.agentec.abook.abv.launcher.android;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.cl.helper.PreferenceHelper;
import jp.agentec.abook.abv.ui.home.activity.SplashScreenActivity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
public class BootUpReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
PreferenceHelper helper = PreferenceHelper.getInstance();
if (!helper.hasContext()) {
helper.init(context);
}
if (helper.isAutoRestart()) {
Logger.i("BootUpReceiver", "isAutoRestart true");
Intent i = new Intent(context, SplashScreenActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);
}
}
}
package jp.agentec.abook.abv.ui.common.activity;
import android.app.LauncherActivity;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.DialogInterface;
......@@ -54,7 +53,6 @@ import jp.agentec.abook.abv.bl.acms.type.LoginMode;
import jp.agentec.abook.abv.bl.acms.type.ServiceOption.ContentShareType;
import jp.agentec.abook.abv.bl.acms.type.UpdateSelect;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.ABVProductCode;
import jp.agentec.abook.abv.bl.common.Callback;
import jp.agentec.abook.abv.bl.common.CommonExecutor;
import jp.agentec.abook.abv.bl.common.Constant;
......@@ -91,7 +89,6 @@ import jp.agentec.abook.abv.bl.net.PanoServer;
import jp.agentec.abook.abv.bl.repo.RepoClient;
import jp.agentec.abook.abv.cl.billing.Purchase;
import jp.agentec.abook.abv.cl.helper.ABVUncaughtExceptionHandler;
import jp.agentec.abook.abv.cl.helper.PreferenceHelper;
import jp.agentec.abook.abv.cl.util.AndroidStringUtil;
import jp.agentec.abook.abv.cl.util.BitmapUtil;
import jp.agentec.abook.abv.cl.util.PreferenceUtil;
......@@ -107,7 +104,6 @@ import jp.agentec.abook.abv.ui.common.constant.ErrorCode;
import jp.agentec.abook.abv.ui.common.constant.ErrorMessage;
import jp.agentec.abook.abv.ui.common.constant.NaviConsts;
import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog;
import jp.agentec.abook.abv.ui.common.dialog.OverlayDialog;
import jp.agentec.abook.abv.ui.common.helper.BillingHelper;
import jp.agentec.abook.abv.ui.common.helper.ProgressDialogHelper;
import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
......@@ -132,7 +128,6 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
private final static String TAG = "ABVAuthenticatedActivity";
public static final String FILEPATH = "FILEPATH";
public static final String INTERACTIVE_MODE = "InteractiveMode";
protected ContentDao contentDao = AbstractDao.getDao(ContentDao.class);
......@@ -209,11 +204,9 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
@Override
protected void onStart() {
super.onStart();
if (!ABVDataCache.getInstance().serviceOption.isSignage()) { // サイネージ以外の場合
// 前回起動時にアプリが強制終了した場合、オプションで送信オンになっている場合は例外トレース情報を送信する(設定によりメールかCMSへ送信)
ABVUncaughtExceptionHandler.getInstancer().sendBugReport(this);
}
}
@Override
protected void onResume() {
......@@ -288,17 +281,6 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
}
if (!isLoggedIn) {
// 2012/11/21 posco専用
ABVEnvironment environment = ABVEnvironment.getInstance();
if (ABVProductCode.PoscoEBrochure == environment.productCode) {
ErrorMessage.showErrorMessageToast(this, ErrorCode.C_E_SECURITY_1004);
Intent intent = new Intent();
intent.putExtra("logout", true);
intent.setClassName(getApplicationContext().getPackageName(), LauncherActivity.class.getName()).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
finish();
} else {
ErrorMessage.showErrorMessageToast(this, ErrorCode.C_E_SECURITY_1004);
Intent intent = new Intent();
......@@ -306,8 +288,6 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
startActivity(intent);
finish();
}
}
}
public void contentDetailActivityMove(long contentId, String className) {
......@@ -575,24 +555,6 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
}
});
}
if(notification.getDownloadStatus() == DownloadStatusType.Succeeded) {
if (ABVDataCache.getInstance().serviceOption.isSignage()) { // サイネージの場合、PDFイメージ、動画サムネイルを生成
if (mDisplaySize == null) {
setDisplaySize();
}
Runnable r = new Runnable() {
@Override
public void run() {
try {
initializeContent(notification.getContentId());
} catch (Exception e) {
Logger.e(TAG, "onDownloadingContentZip do with pdf/moview failed. contentId=" + notification.getContentId(), e);
}
}
};
initilizeExecutor.execute(r); // 一度に2スレッドのみ回す
}
}
}
@Override
......@@ -713,9 +675,6 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
}
protected void deleteContent(ContentDto dto, boolean deletePhysical) {
if (ABVDataCache.getInstance().serviceOption.isSignage() && dto.isPdf()) {
PdfImageProvider.cancel(dto.contentId);
}
contentLogic.deleteContent(dto, deletePhysical);
}
......@@ -1164,11 +1123,10 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
* @param contentId
* @param contentURL
* @param objectId
* @param isInteractiveMode
* @param xWalkView
* @return
*/
public ABookAlertDialog showBeacon(long contentId, String contentURL, final long objectId, boolean isInteractiveMode, final XWalkView xWalkView) {
public ABookAlertDialog showBeacon(long contentId, String contentURL, final long objectId, final XWalkView xWalkView) {
Logger.d(TAG, "[ShowBeaconDialog]");
String qrCodePath = ABVEnvironment.getInstance().getContentCacheDirectoryPath(contentId) + "qrcode.jpg";
boolean success = false;
......@@ -1216,29 +1174,12 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
final ABVContentViewActivity contentViewActivity = activityHandlingHelper.getContentViewActivity();
// Webビューを表示するアラート
ABookAlertDialog dialog;
if (isInteractiveMode && ABVEnvironment.getInstance().kiosk) {
dialog = new OverlayDialog(this, true) {
ABookAlertDialog dialog = new ABookAlertDialog(this) {
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
if (contentViewActivity != null) {
contentViewActivity.resetInteractiveTimer();
}
return super.dispatchTouchEvent(ev);
}
};
} else {
dialog = new ABookAlertDialog(this) {
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
if (contentViewActivity != null) {
contentViewActivity.resetInteractiveTimer();
}
return super.dispatchTouchEvent(ev);
}
};
}
dialog.setCanceledOnTouchOutside(false);
dialog.setView(layout);
......@@ -1258,9 +1199,6 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
}
});
beaconWebView.loadDataWithBaseURL("file:///android_res/raw/beacon.html", data, "text/html", "UTF-8", null);
if(contentViewActivity != null) {
contentViewActivity.resetInteractiveTimer(ABVDataCache.getInstance().serviceOption.getModeInterval() + getResources().getInteger(R.integer.interactive_timer_beacon), false);
}
return dialog;
}
......@@ -1419,31 +1357,11 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
ContentDto contentDto = AbstractDao.getDao(ContentDao.class).getContent(contentId);
if (contentDto.isPdf()) {
// PDFイメージ取得
Size displaySize = mDisplaySize;
if (contentDto.signage == 1) {
displaySize = PreferenceHelper.getInstance().getPdfImageSize(mDisplaySize);
}
PdfImageProvider.createPdfImage(this, displaySize, contentId);
}
else {
PdfImageProvider.createPdfImage(this, mDisplaySize, contentId);
} else {
String cacheDir = ContentFileExtractor.getInstance().getContentCacheDirWithExtract(contentId);
Logger.i(TAG, "extract content files to cache dir. contentId=%s, cacheDir=%s", contentId, cacheDir);
}
if (contentDto.isMovie() && getRBoolean(R.bool.use_movie_thumbnail)) {
// 動画コンテンツの場合、サムネイル取得
List<String> moviePathList = ContentFileExtractor.getInstance().getMoviePathList(contentId);
if (moviePathList != null && !moviePathList.isEmpty()) {
for (String moviePath : moviePathList) {
String imagePath = ContentFileUtil.getMovieImageStartPath(moviePath); // 拡張子を除いて_THUM.jpgにする
Logger.v(TAG, "moviePath=%s, imagePath=%s", moviePath, imagePath);
BitmapUtil.createMovieThumbnail(moviePath, 0, null, imagePath);
imagePath = ContentFileUtil.getMovieImageEndPath(moviePath); // 拡張子を除いて_THUM.jpgにする
Logger.v(TAG, "moviePath=%s, imagePath=%s", moviePath, imagePath);
BitmapUtil.createMovieThumbnail(moviePath, -1, null, imagePath);
}
}
}
}
private void handleError(final Exception e) {
......
......@@ -36,7 +36,6 @@ import jp.agentec.abook.abv.bl.acms.type.LoginMode;
import jp.agentec.abook.abv.bl.acms.type.LoginStatus;
import jp.agentec.abook.abv.bl.acms.type.ServiceOption.ServiceOptionId;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.ABVProductCode;
import jp.agentec.abook.abv.bl.common.Callback;
import jp.agentec.abook.abv.bl.common.CommonExecutor;
import jp.agentec.abook.abv.bl.common.Constant;
......@@ -49,10 +48,8 @@ import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
import jp.agentec.abook.abv.bl.data.dao.MemberInfoDao;
import jp.agentec.abook.abv.bl.dto.MemberInfoDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.ScheduleLogic;
import jp.agentec.abook.abv.bl.logic.UserAuthenticateLogic;
import jp.agentec.abook.abv.cl.environment.NetworkAdapter;
import jp.agentec.abook.abv.cl.helper.PreferenceHelper;
import jp.agentec.abook.abv.cl.push.FcmManager;
import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.launcher.android.AutoDownloadService;
......@@ -71,7 +68,6 @@ import jp.agentec.abook.abv.ui.home.activity.LoginActivity;
import jp.agentec.abook.abv.ui.home.activity.ProjectListActivity;
import jp.agentec.abook.abv.ui.home.activity.custom.MainViewActivity;
import jp.agentec.abook.abv.ui.home.helper.ABookPermissionHelper;
import jp.agentec.abook.abv.ui.signage.service.AutoRestartService;
import jp.agentec.abook.abv.ui.widget.ABVAppWidgetProvider;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
......@@ -107,16 +103,9 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity {
protected void showMainActivity(String loginId) {
//init_admin_modeがtrueの場合、管理者画面に遷移
if (ABVDataCache.getInstance().serviceOption.isSignage() && !PreferenceUtil.get(this, AppDefType.DefPrefKey.INIT_ADMIN_MODE, false)) {
//待ち受け画面を取得
AbstractLogic.getLogic(ScheduleLogic.class).downloadStandByPic();
// サイネージの場合待機画面に遷移
readyToSignageMode();
} else {
alarmServiceStart();
startActivity(new Intent().setClassName(getApplicationContext().getPackageName(), getMainActivityClassName()).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP), NaviConsts.Right);
finish();
}
Intent intent = new Intent();
intent.setAction(ABVAppWidgetProvider.SETTING_ACTION);
getApplicationContext().sendBroadcast(intent);
......@@ -200,7 +189,6 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity {
String password = "password";
Logger.d("UUID 테스트", "UUID 테스트 : " + loginId);
userAuthenticateService.noAuthenticatedLogin(urlPath, loginId, password, deviceToken, isGuestLogin);
initPrefValue(); // 設定の初期値設定
startLogoAnimation();
} else {
ABookAlertDialog messageDialog = AlertDialogUtil.createAlertDialog(mContext, R.string.app_name);
......@@ -333,7 +321,7 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity {
//App強制終了
android.os.Process.killProcess(android.os.Process.myPid());
} else {
moveNext();
moveToHome();
}
return null;
}
......@@ -350,10 +338,6 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity {
public void onClick(DialogInterface dialog, int which) {
// バージョンアップフラグをON
PreferenceUtil.put(getApplicationContext(), AppDefType.DefPrefKey.APP_VERSIONUP_PROCESSING, true);
if (PreferenceHelper.getInstance().isAutoRestart()) {
stopService(new Intent(mContext, AutoRestartService.class));
getABVApplication().getABVApplicationHelper().stopWatcher();
}
// Download 開始
DownloadManager downloadManager = (DownloadManager) getSystemService(DOWNLOAD_SERVICE);
......@@ -383,7 +367,7 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity {
dialog.setNegativeButton(R.string.cancel, new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
moveNext();
moveToHome();
}
});
showAlertDialog(dialog);
......@@ -392,11 +376,11 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity {
}
} else {
moveNext();
moveToHome();
}
} catch (Exception e) {
// ignore
moveNext();
moveToHome();
}
} catch (Exception e) {
Logger.e("ABVException Login", e);
......@@ -407,30 +391,6 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity {
}
}
private void moveNext() {
//init_admin_modeがtrueの場合、管理者画面に遷移
if (ABVDataCache.getInstance().serviceOption.isSignage() &&!PreferenceUtil.get(this, AppDefType.DefPrefKey.INIT_ADMIN_MODE, false)) {
if (ABVDataCache.getInstance().serviceOption.isUseWeatherForecast()) {
// 疑似GPS用のカスタムURIを保存する
final Uri data = getIntent().getData();
if (data != null && data.getScheme() != null && data.getScheme().equals(getString(R.string.scheme_url))) { // カスタムURI
String lat = getValFromURI(data, AppDefType.DefPrefKey.GPS_LATITUDE);
String lon = getValFromURI(data, AppDefType.DefPrefKey.GPS_LONGITUDE);
Logger.i(TAG, "疑似GPS:" + data);
if (lat != null && lon != null) {
PreferenceUtil.put(getApplicationContext(), AppDefType.DefPrefKey.GPS_LATITUDE, lat);
PreferenceUtil.put(getApplicationContext(), AppDefType.DefPrefKey.GPS_LONGITUDE, lon);
}
}
}
//サイネージの場合待機画面に遷移
readyToSignageMode();
} else {
moveToHome();
}
}
/**
......@@ -484,22 +444,11 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity {
}
}
// OllehMCMの場合、MCMでコントロールするため、チェックを行わない
if (ABVEnvironment.getInstance().productCode == ABVProductCode.OllehMCM) {
return false;
}
// ストアバージョンの場合、チェックのみを行う
if (getRBoolean(R.bool.store_version)) {
return false;
}
// サイネージの場合、チェックを行わない
if (ABVDataCache.getInstance().serviceOption.isSignage()) {
return false;
}
return isNeedCheck;
}
......@@ -706,15 +655,7 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity {
}
protected String getMainActivityClassName() {
String className;
if (ABVEnvironment.getInstance().productCode == ABVProductCode.KOMAS) {
className = MainViewActivity.class.getName();
} else if(ABVDataCache.getInstance().serviceOption.isABookCheck() && ABVEnvironment.getInstance().isABookCheck()) {
className = ProjectListActivity.class.getName();
} else {
className = HomeUIActivity.class.getName();
}
return className;
return ProjectListActivity.class.getName();
}
protected abstract void goNext();
......
......@@ -4,9 +4,7 @@ import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.support.v4.app.ActivityCompat;
import android.view.View;
import android.widget.TextView;
......@@ -20,7 +18,6 @@ import java.util.ArrayList;
import jp.agentec.abook.abv.bl.acms.type.LoginMode;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.ABVProductCode;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
import jp.agentec.abook.abv.bl.data.dao.ContentDao;
......@@ -31,8 +28,6 @@ import jp.agentec.abook.abv.bl.logic.UserAuthenticateLogic;
import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog;
import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
import jp.agentec.abook.abv.ui.home.activity.LoginActivity;
import jp.agentec.abook.abv.ui.home.helper.ABookPermissionHelper;
......@@ -52,9 +47,6 @@ public abstract class ABVSplashActivity extends ABVNoAuthenticatedActivity {
private ArrayList<String>mPermissionArray = new ArrayList();
protected static final int REQUEST_PERMISSIONS = 1001;
// private boolean isFirst;
// boolean initProcessResult = true; // 未使用のため、削除
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
......@@ -153,24 +145,6 @@ public abstract class ABVSplashActivity extends ABVNoAuthenticatedActivity {
}
private void abookMode() {
// サイネージの場合、kiosk用の権限チェック
if (ABVEnvironment.getInstance().isSignage() && ABVEnvironment.getInstance().kiosk) {
ABookPermissionHelper helper = new ABookPermissionHelper(this);
if (helper.checkOverlaysPermission()) {
ABookAlertDialog alertDialog = AlertDialogUtil.createAlertDialog(this, getString(R.string.app_name), getString(R.string.msg_kiosk_permission));
alertDialog.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION,
Uri.parse("package:" + getPackageName()));
startActivity(intent);
}
});
alertDialog.show();
return;
}
}
// Activityを終了するかしないか
boolean finishActivityFlag = true;
......@@ -178,7 +152,7 @@ public abstract class ABVSplashActivity extends ABVNoAuthenticatedActivity {
UserAuthenticateLogic logic = AbstractLogic.getLogic(UserAuthenticateLogic.class);
MemberInfoDto memberInfo = logic.getMemberInfo();
if (getRInteger(R.integer.login_mode) == LoginMode.NO_AUTH && ABVEnvironment.getInstance().productCode != ABVProductCode.OllehMCM) { // Adモードの時はログイン画面を表示する
if (getRInteger(R.integer.login_mode) == LoginMode.NO_AUTH) { // Adモードの時はログイン画面を表示する
// 認証なしログインの場合
finishActivityFlag = false;
//noinspection VariableNotUsedInsideIf
......
......@@ -9,7 +9,6 @@ import jp.agentec.abook.abv.bl.acms.client.json.reader.ReaderContentJSON;
import jp.agentec.abook.abv.bl.acms.client.json.reader.ReaderContentVersionJSON;
import jp.agentec.abook.abv.bl.acms.type.DownloadStatusType;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.ABVProductCode;
import jp.agentec.abook.abv.bl.common.Callback;
import jp.agentec.abook.abv.bl.common.CommonExecutor;
import jp.agentec.abook.abv.bl.common.Constant.ReaderConstant;
......@@ -22,7 +21,6 @@ import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.common.util.SecurityUtil;
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.AcmsDao;
import jp.agentec.abook.abv.bl.data.dao.ContentIdConvDao;
import jp.agentec.abook.abv.bl.data.dao.ContractDao;
import jp.agentec.abook.abv.bl.data.dao.LockDao;
......@@ -37,10 +35,8 @@ import jp.agentec.abook.abv.bl.dto.SiteDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.ContentLogic;
import jp.agentec.abook.abv.bl.logic.ContractLogic;
import jp.agentec.abook.abv.bl.logic.ScheduleLogic;
import jp.agentec.abook.abv.bl.repo.RepoClient;
import jp.agentec.abook.abv.cl.helper.ContentMarkingFileHelper;
import jp.agentec.abook.abv.cl.helper.PreferenceHelper;
import jp.agentec.abook.abv.cl.push.FcmManager;
import jp.agentec.abook.abv.cl.util.AndroidStringUtil;
import jp.agentec.abook.abv.cl.util.PreferenceUtil;
......@@ -225,11 +221,6 @@ public abstract class ABVUIActivity extends ABVAuthenticatedActivity {
// contentDownloadObserverがnullだと更新マークのアニメーションが完了しない TODO 2014/11/12 Jang
// onCreateでrefresh処理をcallしたときに起きる
// サイネージ&手動更新の場合、FetchDateをクリアする⇒304処理を
if (!isAutoRefresh && ABVDataCache.getInstance().serviceOption.isSignage()) {
AcmsDao dao = AbstractDao.getDao(AcmsDao.class);
dao.clearFetchDate();
}
contentRefresher.refreshContentList(this);
// ログ送信可否を確認
LogUtil.checkSendLogFlag();
......@@ -433,14 +424,8 @@ public abstract class ABVUIActivity extends ABVAuthenticatedActivity {
public boolean contentDelete(ContentDto contentDto) {
boolean result = true;
try {
// 外部ディスプレイ中の場合で現在プレイリストのコンテンツは削除させない
if(ABVDataCache.getInstance().serviceOption.isSignage() && AbstractLogic.getLogic(ScheduleLogic.class).isOnScheduleConetent(contentDto.contentId) && PreferenceHelper.getInstance().isExtMonitor()){
ABVToastUtil.showMakeText(this, R.string.content_delete_prohibited, Toast.LENGTH_SHORT);
result = false;
} else {
boolean deletePhysical = ABVEnvironment.getInstance().isReader;
deleteContent(contentDto, deletePhysical);
}
} catch (Exception e) {
result = false;
Logger.e("Exception ", e);
......@@ -602,7 +587,6 @@ public abstract class ABVUIActivity extends ABVAuthenticatedActivity {
public List<ContentCheckListTypeItem> createSubMenuItems(ContentDto contentDto, boolean isMain) {
String[] names = getRStringArray(R.array.content_submenu_names);
List<ContentCheckListTypeItem> items = new ArrayList<>();
boolean isSignage = ABVDataCache.getInstance().serviceOption.isSignage();
if (isMain) {
// コンテンツ詳細 ※詳細画面ではなし
......@@ -625,11 +609,9 @@ public abstract class ABVUIActivity extends ABVAuthenticatedActivity {
if (contentDto.downloadedFlg) { // ダウンロード済みコンテンツ
if (isMain) {
// コンテンツ閲覧 ※詳細画面ではなし
if (!isSignage) {
items.add(new ContentCheckListTypeItem(SubMenuType.CONTENT_OPEN, names[SubMenuType.CONTENT_OPEN]));
}
if (!isSignage && ActivityHandlingHelper.getInstance().isUpdateEnable(contentDto) && !ABVDataCache.getInstance().serviceOption.isPayment()) {
if (ActivityHandlingHelper.getInstance().isUpdateEnable(contentDto) && !ABVDataCache.getInstance().serviceOption.isPayment()) {
// アップデート ※詳細画面ではなし
items.add(new ContentCheckListTypeItem(SubMenuType.CONTENT_UPDATE, names[SubMenuType.CONTENT_UPDATE]));
}
......@@ -645,11 +627,9 @@ public abstract class ABVUIActivity extends ABVAuthenticatedActivity {
if (contentDto.contentType == null || ContentJSON.KEY_PDF_TYPE.equals(contentDto.contentType.toLowerCase(Locale.US)) || ContentJSON.KEY_NONE_TYPE.equals(contentDto.contentType)) {
// メモ、マーキング、しおりがすべてオフの場合非表示
if (Options.getInstance(this).getViewerMenuMemo() == 1 || Options.getInstance(this).getViewerMenuMarking() == 1 || Options.getInstance(this).getViewerMenuBookmark() == 1) {
if (ABVEnvironment.getInstance().productCode != ABVProductCode.KOMAS) {
// ユーザ情報コピー
items.add(new ContentCheckListTypeItem(SubMenuType.USER_INFO_COPY, names[SubMenuType.USER_INFO_COPY]));
}
}
if (getABVUIDataCache().srcContentId != -1) {
// ユーザ情報貼り付け
items.add(new ContentCheckListTypeItem(SubMenuType.USER_INFO_PASTE, names[SubMenuType.USER_INFO_PASTE]));
......@@ -661,7 +641,7 @@ public abstract class ABVUIActivity extends ABVAuthenticatedActivity {
items.add(new ContentCheckListTypeItem(SubMenuType.MYFOLDER_ADD, names[SubMenuType.MYFOLDER_ADD]));
}
} else { // 未ダウンロードコンテンツ
if (!isSignage && ActivityHandlingHelper.getInstance().isDownloadEnable(contentDto) && !ABVDataCache.getInstance().serviceOption.isPayment()) {
if (ActivityHandlingHelper.getInstance().isDownloadEnable(contentDto) && !ABVDataCache.getInstance().serviceOption.isPayment()) {
// ダウンロード
items.add(new ContentCheckListTypeItem(SubMenuType.CONTENT_DOWNLOAD, names[SubMenuType.CONTENT_DOWNLOAD]));
if (isMain && ABVEnvironment.getInstance().isReader) {
......
......@@ -22,7 +22,6 @@ public interface AppDefType {
String SPAREBOARD= "spareboard";
String AUTODOWNLOAD_INFO = "autodownload_info";
String GPS_SEND_TIME = "gps_send_time";
String SIGNAGE_INFO = "signage_info";
}
interface DefPrefKey {
......@@ -39,8 +38,6 @@ public interface AppDefType {
String TAP_ACTION_ON_UPDATE ="tapActionOnUpdate";
String TAP_ACTION_ON_DELIVERY_SELECT = "tapActionOnDeliverySelect";
String DISPLAY_MARKING = "displayMarking";
String EXT_MONITOR = "extMonitor";
String AUTO_RESTART = "autoRestart";
String INIT_ADMIN_MODE = "initAdminMode";
String SAVE_GPS_SENDED_TIME = "saveTime";
String APP_VERSIONUP_PROCESSING = "appVersionProcessingFlag";
......
......@@ -121,7 +121,7 @@ public class ABVFunctionOptions extends AbstractOptions {
@Override
public int getHomeMenuGroup() {
if (context.getResources().getBoolean(R.bool.follow_service_option) && !ABVDataCache.getInstance().serviceOption.isSignage()) {
if (context.getResources().getBoolean(R.bool.follow_service_option)) {
return ABVDataCache.getInstance().serviceOption.isUseGroup() ? 1 : 0;
} else {
return context.getResources().getInteger(R.integer.home_menu_group);
......@@ -274,9 +274,4 @@ public class ABVFunctionOptions extends AbstractOptions {
public int getViewerMenuBookmark() {
return context.getResources().getInteger(R.integer.viewer_menu_bookmark);
}
@Override
public int getSettingSignageSync() {
return context.getResources().getInteger(R.integer.setting_menu_signage_sync);
}
}
......@@ -220,9 +220,4 @@ public class DefaultOptions extends AbstractOptions {
public int getViewerMenuBookmark() {
return 0;
}
@Override
public int getSettingSignageSync() {
return 0;
}
}
......@@ -146,12 +146,6 @@ public interface IOptions {
int getSettingMenuAccount();
/**
* 設定:サイネージ連動
* @return 0:非表示 1:表示
*/
int getSettingSignageSync();
/**
* 設定:アプリ情報
* @return 0:非表示 1:表示
*/
......
......@@ -227,9 +227,4 @@ public class LargeOptions extends AbstractOptions {
public int getViewerMenuBookmark() {
return 1;
}
@Override
public int getSettingSignageSync() {
return 0;
}
}
......@@ -223,9 +223,4 @@ public class MidOptions extends AbstractOptions {
public int getViewerMenuBookmark() {
return 0;
}
@Override
public int getSettingSignageSync() {
return 0;
}
}
......@@ -43,9 +43,6 @@ public abstract class MultiTapDetector {
@Override
public void onLongPress(MotionEvent e) {
if (getTouchMode() ==1) {
onMultiTap();
}
}
@Override
......@@ -98,9 +95,4 @@ public abstract class MultiTapDetector {
public abstract void onMultiTap();
public abstract void onSingleTapUp();
public int getTouchMode() {
int defaultValue = mContext.getResources().getInteger(R.integer.default_touch_mode);
return PreferenceUtil.getUserPref(mContext, AppDefType.UserPrefKey.MONITOR_TOUCH_MODE, defaultValue);
}
}
package jp.agentec.abook.abv.ui.common.timertask;
import java.util.Timer;
import java.util.TimerTask;
/**
* スケジュール実行時にセットしたタイマーを返す処理を追加したカスタマイズTimer
* @author jang
*
*/
public class ABookTimer extends Timer {
private TimerTask task = null;
@Override
public void schedule(TimerTask task, long delay, long period) {
this.task = null; // セットする前に明示的に開放しておく
this.task = task;
super.schedule(task, delay, period);
}
public TimerTask getTimerTask() {
return task;
}
}
package jp.agentec.abook.abv.ui.common.timertask;
import java.util.Date;
import java.util.TimerTask;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.dto.ScheduleDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.ScheduleLogic;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.PrefName;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.SignagePrefKey;
import jp.agentec.abook.abv.ui.common.util.NtpUtil;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.signage.activity.ReadySlideShowActivity;
import jp.agentec.abook.abv.ui.signage.activity.SlideShowActivity;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
public class ScheduleCheckTask extends TimerTask {
private static final String TAG = "ScheduleCheckTask";
private ScheduleLogic scheduleLogic = AbstractLogic.getLogic(ScheduleLogic.class);
private ScheduleCheckListener listener = null;
public ScheduleCheckTask() {
}
@Override
public void run() {
Activity currentActivity = ActivityHandlingHelper.getInstance().getCurrentActivity();
if (currentActivity == null) {
Logger.w(TAG, "getCurrentActivity is null!!");
return;
}
NtpUtil.synchronizingNtpServerDate();
SharedPreferences pref = currentActivity.getSharedPreferences(PrefName.SIGNAGE_INFO, Context.MODE_PRIVATE);
Editor editor = pref.edit();
editor.putString(SignagePrefKey.LAST_CHECK_SCHEDULE_DATE, DateTimeUtil.toString(new Date(), DateTimeFormat.yyyyMMddHHmmss_hyphen));
editor.commit();
try {
ScheduleDto schedule = scheduleLogic.getNowSchedule();
// 現在の画面が待機画面またはスライドショーでもlistenerがnullになっていることがあるので登録しなおす。
if (listener == null) {
if (currentActivity instanceof ReadySlideShowActivity) {
listener = (ReadySlideShowActivity) currentActivity;
} else if (currentActivity instanceof SlideShowActivity) {
listener = ((SlideShowActivity) currentActivity).slideShowView;
}
}
if (schedule != null) {
if (listener != null) {
listener.startPlayListWithSchedule(schedule);
}
} else {
if (listener != null) {
Logger.i(TAG, "ScheduleCheckTask stopPlayList!");
listener.stopPlayList();
}
}
} catch (Exception e) {
Logger.e(TAG, "ScheduleCheckTask run failed.", e);
}
}
public void setScheduleCheckListener(ScheduleCheckListener listener) {
this.listener = listener;
Logger.i(TAG, "[setScheduleCheckListener] " + listener.getClass().getSimpleName());
}
public interface ScheduleCheckListener {
/**
* 現時点で実行対象のスケジュールがある場合にCallされる
* @param schedule 実行対象のスケジュール情報
*/
void startPlayListWithSchedule(ScheduleDto schedule);
void stopPlayList();
}
}
package jp.agentec.abook.abv.ui.common.timertask;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import java.util.Date;
import java.util.TimerTask;
import jp.agentec.abook.abv.bl.common.exception.ABVException;
import jp.agentec.abook.abv.bl.common.exception.ABVExceptionCode;
import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.download.ContentDownloadListener;
import jp.agentec.abook.abv.bl.download.ContentDownloader;
import jp.agentec.abook.abv.bl.download.ContentRefresher;
import jp.agentec.abook.abv.bl.download.ContentZipDownloadNotification;
import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.ScheduleLogic;
import jp.agentec.abook.abv.ui.common.activity.ABVAuthenticatedActivity;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.PrefName;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.SignagePrefKey;
import jp.agentec.abook.abv.ui.common.util.LogUtil;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.adf.net.http.HttpDownloadSimpleNotification;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
public class UpdateNewContentTask extends TimerTask {
private static final String TAG = "UpdateNewContentTask";
public int checkInterval; // default 5minute
private UpdateNewContentCheckListener listener = null;
public UpdateNewContentTask(int checkInterval) {
this.checkInterval = checkInterval;
}
// ANR(Application Not Responding)の場合にカウントされる
private int isANRCount = 0;
@Override
public void run() {
Logger.i(TAG, "[run]:start");
final ABVAuthenticatedActivity currentActivity = ActivityHandlingHelper.getInstance().getCurrentActivity();
// スレッドが固まっているかの確認
if (isANR(currentActivity)) {
return;
}
SharedPreferences pref = currentActivity.getSharedPreferences(PrefName.SIGNAGE_INFO, Context.MODE_PRIVATE);
Editor editor = pref.edit();
editor.putString(SignagePrefKey.LAST_UPDATE_NEW_CONTENT_DATE, DateTimeUtil.toString(new Date(), DateTimeFormat.yyyyMMddHHmmss_hyphen));
editor.commit();
try {
ContentRefresher contentRefresher = ContentRefresher.getInstance();
if (!contentRefresher.isRefreshing()) {
CheckUpdateListener checkUpdateListener = new CheckUpdateListener();
contentRefresher.refreshContentList(checkUpdateListener); //FIXME: SignageViewへのフィードバック必要?
}
currentActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
currentActivity.getWeatherInfo();
}
});
// ログ送信可否を確認
LogUtil.checkSendLogFlag();
} catch (NetworkDisconnectedException e) {
Logger.w(TAG, "[run] Unable to refresh because network disconnected."); // 何もしない
} catch (ABVException e) {
if (e.getCode().equals(ABVExceptionCode.C_I_CONTENT_0002)) {
// content downloading
Logger.w(TAG, "[run] Unable to refresh while content downloading.");
}
else {
Logger.e(TAG, "[run] ABVException:" + e.getCode(), e);
if (listener != null) {
listener.failUpdateNewCheck(e.getCode());
}
}
} catch (Exception e) {
Logger.e(TAG, "[run] Exception:", e);
} catch (OutOfMemoryError e) {
Logger.e(TAG, "[run] Throwable:", e);
System.gc();
}
}
// check Application Not Responding
private boolean isANR(ABVAuthenticatedActivity currentActivity) {
isANRCount++;
currentActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
Logger.d(TAG, "[isANR]:MainThread is Alive! ");
isANRCount = 0;
}
});
if (isANRCount > 1) {
// 1回目の新着更新処理後、2回目でもメインスレッドが止まっている場合
Logger.w(TAG, "[isANR]:Maybe stop Main Thread.restartApplication !!!!!!!");
currentActivity.getABVApplication().getABVApplicationHelper().restartApplication(); // 再起動
return true;
}
return false;
}
public void setUpdateNewContentCheckListener(UpdateNewContentCheckListener listener) {
this.listener = listener;
}
private class CheckUpdateListener implements ContentDownloadListener {
/**
*
* 新着コンテンツ情報が更新されたことを通知します。
* @param result 更新結果です。
* @param contentId 更新されたコンテンツID。全体の終了・エラーの場合は-1。現状使われていないが、ログ等の利用のため残す。
* @param e
* @since 1.0.0
*/
@Override
public void onRefreshedContent(boolean result, long contentId, Exception e) {
Logger.d("CheckUpdateListener", "[onRefreshedContent]:contentId=" + contentId);
ContentRefresher contentRefresher = ContentRefresher.getInstance();
if (!contentRefresher.isRefreshing()) {
Logger.d("CheckUpdateListener", "[onRefreshedContent]:isDownloadSucceeded:check");
if (ContentDownloader.getInstance().isDownloadSucceeded()) {
// lastFetchDateを更新する
AbstractLogic.getLogic(ScheduleLogic.class).updateContentVersionLastFetchDate();
}
// lastFetchDate更新判定のDownloadSucceededFlagを初期化
ContentDownloader.getInstance().setDownloadSucceededFlag(true);
}
}
/**
* コンテンツ詳細情報がダウンロードされたことを通知します。
* @param notification ダウンロードした情報を格納するオブジェクトです。
* @since 1.0.0
*/
@Override
public void onDownloadedContentDetail(HttpDownloadSimpleNotification notification) {
}
/**
* コンテンツダウンロードの際、ダウンロードの状態変化を通知します。
* @param notification ダウンロードに関する情報を格納するオブジェクトです。
* @since 1.0.0
*/
@Override
public void onDownloadingContentZip(ContentZipDownloadNotification notification) {
}
/**
* ACMSへの認証が失敗したので、更新・ダウンロードができないことを通知します。
* @since 1.1.0
*/
@Override
public void onAuthenticationFailed() {
}
}
public interface UpdateNewContentCheckListener {
/**
* 新着更新処理が失敗したときにCallされる
* 引数のABVExceptionCodeから失敗原因を判定する
* @param code ABVExceptionCode
*/
void failUpdateNewCheck(ABVExceptionCode code);
}
}
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