Commit 65919394 by Lee Jaebin

サービスオプションの整理、要らない処理削除

parent 1e0ec13b
...@@ -20,7 +20,6 @@ import jp.agentec.abook.abv.bl.acms.client.json.CategoriesJSON; ...@@ -20,7 +20,6 @@ import jp.agentec.abook.abv.bl.acms.client.json.CategoriesJSON;
import jp.agentec.abook.abv.bl.acms.client.json.ContentCheckDeliverableJSON; import jp.agentec.abook.abv.bl.acms.client.json.ContentCheckDeliverableJSON;
import jp.agentec.abook.abv.bl.acms.client.json.ContentSetJSON; import jp.agentec.abook.abv.bl.acms.client.json.ContentSetJSON;
import jp.agentec.abook.abv.bl.acms.client.json.ContentVersionsJSON; import jp.agentec.abook.abv.bl.acms.client.json.ContentVersionsJSON;
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.GroupsJSON;
import jp.agentec.abook.abv.bl.acms.client.json.LogSendFlagJSON; 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.NewAppStoreLoginJSON;
...@@ -29,12 +28,12 @@ import jp.agentec.abook.abv.bl.acms.client.json.ResultJSON; ...@@ -29,12 +28,12 @@ import jp.agentec.abook.abv.bl.acms.client.json.ResultJSON;
import jp.agentec.abook.abv.bl.acms.client.json.ServerTimeZoneJSON; import jp.agentec.abook.abv.bl.acms.client.json.ServerTimeZoneJSON;
import jp.agentec.abook.abv.bl.acms.client.json.ServiceOptionsJSON; import jp.agentec.abook.abv.bl.acms.client.json.ServiceOptionsJSON;
import jp.agentec.abook.abv.bl.acms.client.json.SubscriptionHistoryJSON; import jp.agentec.abook.abv.bl.acms.client.json.SubscriptionHistoryJSON;
import jp.agentec.abook.abv.bl.acms.client.json.check.FixPushMessageJSON; import jp.agentec.abook.abv.bl.acms.client.json.FixPushMessageJSON;
import jp.agentec.abook.abv.bl.acms.client.json.check.ProjectDataJSON; import jp.agentec.abook.abv.bl.acms.client.json.ProjectDataJSON;
import jp.agentec.abook.abv.bl.acms.client.json.check.ProjectInspectDataJSON; import jp.agentec.abook.abv.bl.acms.client.json.ProjectInspectDataJSON;
import jp.agentec.abook.abv.bl.acms.client.json.check.ProjectListJSON; import jp.agentec.abook.abv.bl.acms.client.json.ProjectListJSON;
import jp.agentec.abook.abv.bl.acms.client.json.check.SceneEntryJSON; import jp.agentec.abook.abv.bl.acms.client.json.SceneEntryJSON;
import jp.agentec.abook.abv.bl.acms.client.json.check.WorkerGroupJSON; import jp.agentec.abook.abv.bl.acms.client.json.WorkerGroupJSON;
import jp.agentec.abook.abv.bl.acms.client.parameters.AbstractAcmsLoginParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.AbstractAcmsLoginParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.AcmsContentParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.AcmsContentParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.AcmsParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.AcmsParameters;
...@@ -55,14 +54,12 @@ import jp.agentec.abook.abv.bl.acms.client.parameters.GetTaskFileParameters; ...@@ -55,14 +54,12 @@ import jp.agentec.abook.abv.bl.acms.client.parameters.GetTaskFileParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.NewAppStoreLoginParameters; 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.PasswordChangeParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.PostEnqueteReplyParameters; 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; import jp.agentec.abook.abv.bl.acms.client.parameters.SendPushMessageParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.ServerTimeParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.ServerTimeParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.StandByPicParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.StandByPicParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.SubscriptionHistoryParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.SubscriptionHistoryParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.SubscriptionHistorySendParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.SubscriptionHistorySendParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.UpdateDeviceTokenParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.UpdateDeviceTokenParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.UploadBackupFileParameters;
import jp.agentec.abook.abv.bl.acms.type.AcmsApis; import jp.agentec.abook.abv.bl.acms.type.AcmsApis;
import jp.agentec.abook.abv.bl.acms.type.LoginStatus; 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.RequirePasswordChangeCode;
...@@ -527,16 +524,6 @@ public class AcmsClient implements AcmsClientResponseListener { ...@@ -527,16 +524,6 @@ public class AcmsClient implements AcmsClientResponseListener {
return json.requirePasswordChange; return json.requirePasswordChange;
} }
public GetBackupFileListJSON getBackupFileList(AcmsParameters param) throws AcmsException, NetworkDisconnectedException {
HttpResponse response = send(AcmsApis.ApiUrlGetBackupFileList, param);
GetBackupFileListJSON json = new GetBackupFileListJSON(response.httpResponseBody);
Logger.d(TAG, "json : %s", json);
return json;
}
public AuthLevelJSON getAuthLevel(AcmsParameters param) throws AcmsException, NetworkDisconnectedException { public AuthLevelJSON getAuthLevel(AcmsParameters param) throws AcmsException, NetworkDisconnectedException {
HttpResponse response = send(AcmsApis.ApiUrlGetAuthLevel, param); HttpResponse response = send(AcmsApis.ApiUrlGetAuthLevel, param);
AuthLevelJSON json = new AuthLevelJSON(response.httpResponseBody); AuthLevelJSON json = new AuthLevelJSON(response.httpResponseBody);
...@@ -570,24 +557,6 @@ public class AcmsClient implements AcmsClientResponseListener { ...@@ -570,24 +557,6 @@ public class AcmsClient implements AcmsClientResponseListener {
return result; return result;
} }
public String uploadBackupFile(UploadBackupFileParameters param) throws AcmsException, NetworkDisconnectedException, IOException {
//HttpResponse response = send(AcmsApis.ApiUrlUploadBackupFile, param);
//UploadBackupFileJSON json = new UploadBackupFileJSON(response.httpResponseBody);
String apiUrl = AcmsApis.getApiUrl(env.acmsAddress, urlPath, AcmsApis.ApiUrlUploadBackupFile);
HttpMultipart part1 = new HttpMultipart("sid", param.getSid());
// HttpMultipart part2 = new HttpMultipart("deviceType", param.getDeviceType());
HttpMultipart part3 = new HttpMultipart("formFile", param.getFile());
// HttpResponse result = HttpRequestSender.post(apiUrl, new HttpMultipart[] {part1, part2, part3});
HttpResponse result = HttpRequestSender.post(apiUrl, new HttpMultipart[] {part1, part3});
ResultJSON json = new ResultJSON(result.httpResponseBody);
Logger.d(TAG, "백업 파일 업로드 %s", json);
return json.result;
}
public AcmsMessageJSON uploadLogFile(String sid, File uploadFile, String appVersion, String deviceTypeId, String uid, String ma) throws AcmsException, NetworkDisconnectedException, IOException { public AcmsMessageJSON uploadLogFile(String sid, File uploadFile, String appVersion, String deviceTypeId, String uid, String ma) throws AcmsException, NetworkDisconnectedException, IOException {
String apiUrl = AcmsApis.getApiUrl(env.acmsAddress, urlPath, AcmsApis.ApiUrlUploadLogFile); String apiUrl = AcmsApis.getApiUrl(env.acmsAddress, urlPath, AcmsApis.ApiUrlUploadLogFile);
HttpMultipart part1 = new HttpMultipart("sid", sid); HttpMultipart part1 = new HttpMultipart("sid", sid);
...@@ -621,24 +590,6 @@ public class AcmsClient implements AcmsClientResponseListener { ...@@ -621,24 +590,6 @@ public class AcmsClient implements AcmsClientResponseListener {
return json; return json;
} }
public String notifyBackupStart(GetBackupFileParameters param) throws AcmsException, NetworkDisconnectedException {
HttpResponse response = send(AcmsApis.ApiUrlNotifyBackupStart, param);
ResultJSON json = new ResultJSON(response.httpResponseBody);
Logger.d(TAG, "백업 개시 %s", json);
return json.result;
}
public String notifyBackupFinish(GetBackupFileParameters param) throws AcmsException, NetworkDisconnectedException {
HttpResponse response = send(AcmsApis.ApiUrlNotifyBackupFinish, param);
ResultJSON json = new ResultJSON(response.httpResponseBody);
Logger.d(TAG, "백업 완료 %s", json);
return json.result;
}
// TODO: リファクタリングの結果をABook+ブランチにも反映 // TODO: リファクタリングの結果をABook+ブランチにも反映
public String enqueteReply(EnqueteReplyParameters postParam, GetEnqueteReplyParameters getParam) throws AcmsException, NetworkDisconnectedException { public String enqueteReply(EnqueteReplyParameters postParam, GetEnqueteReplyParameters getParam) throws AcmsException, NetworkDisconnectedException {
......
package jp.agentec.abook.abv.bl.acms.client.json.reader; package jp.agentec.abook.abv.bl.acms.client.json;
import jp.agentec.abook.abv.bl.acms.client.json.AcmsCommonJSON; import jp.agentec.abook.abv.bl.acms.client.json.AcmsCommonJSON;
import jp.agentec.abook.abv.bl.common.exception.AcmsException; import jp.agentec.abook.abv.bl.common.exception.AcmsException;
......
...@@ -42,7 +42,6 @@ public class DownloadedContentInfoJSON extends AcmsJSONParser { ...@@ -42,7 +42,6 @@ public class DownloadedContentInfoJSON extends AcmsJSONParser {
public static final String ContractContentId = "contractContentId"; public static final String ContractContentId = "contractContentId";
public static final String AlertMessageLevel = "alertMessageLevel"; public static final String AlertMessageLevel = "alertMessageLevel";
public static final String AlertMessage = "alertMessage"; public static final String AlertMessage = "alertMessage";
public static final String PdfSendMail = "pdfSendMail";
public static final String PrintFlg = "printFlg"; public static final String PrintFlg = "printFlg";
public static final String HideFlg = "hideFlg"; public static final String HideFlg = "hideFlg";
public static final String ShareUrl = "shareUrl"; public static final String ShareUrl = "shareUrl";
...@@ -84,7 +83,6 @@ public class DownloadedContentInfoJSON extends AcmsJSONParser { ...@@ -84,7 +83,6 @@ public class DownloadedContentInfoJSON extends AcmsJSONParser {
public Date lastDeliveryDate; public Date lastDeliveryDate;
public int alertMessageLevel; public int alertMessageLevel;
public String alertMessage; public String alertMessage;
public boolean pdfSendMailFlg;
public boolean printFlg; public boolean printFlg;
public boolean hideFlg; public boolean hideFlg;
public String shareUrl; public String shareUrl;
...@@ -174,7 +172,6 @@ public class DownloadedContentInfoJSON extends AcmsJSONParser { ...@@ -174,7 +172,6 @@ public class DownloadedContentInfoJSON extends AcmsJSONParser {
alertMessageLevel= getInt(json, AlertMessageLevel, 0); alertMessageLevel= getInt(json, AlertMessageLevel, 0);
alertMessage= getString(json, AlertMessage, ""); alertMessage= getString(json, AlertMessage, "");
pdfSendMailFlg = (getInt(json, PdfSendMail) != 0);
printFlg = (getInt(json, PrintFlg) != 0); printFlg = (getInt(json, PrintFlg) != 0);
hideFlg = (JsonUtil.getInt(json, HideFlg, 0) != 0); // 日比谷花壇のみのため、なければ0 hideFlg = (JsonUtil.getInt(json, HideFlg, 0) != 0); // 日比谷花壇のみのため、なければ0
shareUrl = JsonUtil.getString(json, ShareUrl); shareUrl = JsonUtil.getString(json, ShareUrl);
...@@ -257,7 +254,6 @@ public class DownloadedContentInfoJSON extends AcmsJSONParser { ...@@ -257,7 +254,6 @@ public class DownloadedContentInfoJSON extends AcmsJSONParser {
dto.lastDeliveryDate = lastDeliveryDate; dto.lastDeliveryDate = lastDeliveryDate;
dto.alertMessageLevel = alertMessageLevel; dto.alertMessageLevel = alertMessageLevel;
dto.alertMessage = alertMessage; dto.alertMessage = alertMessage;
dto.pdfSendMailFlg = pdfSendMailFlg;
dto.printFlg = printFlg; dto.printFlg = printFlg;
dto.hideFlg = hideFlg; dto.hideFlg = hideFlg;
dto.shareUrl = shareUrl; dto.shareUrl = shareUrl;
......
package jp.agentec.abook.abv.bl.acms.client.json.check; package jp.agentec.abook.abv.bl.acms.client.json;
import org.json.adf.JSONArray; import org.json.adf.JSONArray;
import org.json.adf.JSONObject; import org.json.adf.JSONObject;
......
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.JSONArray;
import org.json.adf.JSONObject;
/**
* ACMSからのJSONがbooleanのresultという項目を予め持っているクラスです。booleanのresultを持つJSONに対応するクラスを作成するときはこのクラスを継承してください。
* @author Taejin Hong
* @version 1.0.0
*
*/
public class GetBackupFileListJSON extends AcmsCommonJSON {
public static final String FileList = "fileList";
public JSONArray fileList;
public GetBackupFileListJSON(String jsonString) throws AcmsException {
super(jsonString);
}
@Override
protected void parse(JSONObject json) throws JSONValidationException {
super.parse(json);
if (json.has(FileList)) {
fileList = json.getJSONArray(FileList);
}
}
}
package jp.agentec.abook.abv.bl.acms.client.json.check; package jp.agentec.abook.abv.bl.acms.client.json;
import org.json.adf.JSONArray; import org.json.adf.JSONArray;
import org.json.adf.JSONObject; import org.json.adf.JSONObject;
......
package jp.agentec.abook.abv.bl.acms.client.json.check; package jp.agentec.abook.abv.bl.acms.client.json;
import org.json.adf.JSONArray; import org.json.adf.JSONArray;
import org.json.adf.JSONObject; import org.json.adf.JSONObject;
......
package jp.agentec.abook.abv.bl.acms.client.json.check; package jp.agentec.abook.abv.bl.acms.client.json;
import org.json.adf.JSONArray; import org.json.adf.JSONArray;
import org.json.adf.JSONObject; import org.json.adf.JSONObject;
......
package jp.agentec.abook.abv.bl.acms.client.json.check; package jp.agentec.abook.abv.bl.acms.client.json;
import org.json.adf.JSONObject; import org.json.adf.JSONObject;
......
package jp.agentec.abook.abv.bl.acms.client.json.check; package jp.agentec.abook.abv.bl.acms.client.json;
import org.json.adf.JSONArray; import org.json.adf.JSONArray;
import org.json.adf.JSONObject; import org.json.adf.JSONObject;
......
...@@ -58,23 +58,11 @@ public abstract class AbstractAcmsLoginParameters extends HttpParameterObject { ...@@ -58,23 +58,11 @@ public abstract class AbstractAcmsLoginParameters extends HttpParameterObject {
*/ */
public AbstractAcmsLoginParameters(String loginId, String memberPassword, int appId, String appVersion public AbstractAcmsLoginParameters(String loginId, String memberPassword, int appId, String appVersion
, int deviceTypeId, String deviceToken, String ma) throws IllegalArgumentException { , int deviceTypeId, String deviceToken, String ma) throws IllegalArgumentException {
if (ABVDataCache.getInstance().serviceOption.isEncryptUserInfo()) {
SecurityUtil.validateLoginInformation(loginId, memberPassword);
}
if (StringUtil.isNullOrWhiteSpace(appVersion)) { if (StringUtil.isNullOrWhiteSpace(appVersion)) {
throw new IllegalArgumentException("argument appVersion not allowed null or white space."); throw new IllegalArgumentException("argument appVersion not allowed null or white space.");
} }
// ログイン時にデバイストークンが取得できないことがあるので必須チェックは外す
// if (StringUtil.isNullOrWhiteSpace(deviceToken)) {
// throw new IllegalArgumentException("argument deviceToken not allowed null or white space.");
// }
// if (StringUtil.isNullOrWhiteSpace(ma)) {
// throw new IllegalArgumentException("argument ma not allowed null or white space.");
// }
this.loginId = loginId; this.loginId = loginId;
this.password = memberPassword; this.password = memberPassword;
this.appId = appId; this.appId = appId;
......
...@@ -21,7 +21,6 @@ public class ContentReadingLogParameters extends AcmsContentParameters { ...@@ -21,7 +21,6 @@ public class ContentReadingLogParameters extends AcmsContentParameters {
private Double longitude; private Double longitude;
private JSONObject pageLog; private JSONObject pageLog;
private JSONObject objectLog; private JSONObject objectLog;
private JSONObject customLog;
private String loginId; // Reader private String loginId; // Reader
private String key; // Reader private String key; // Reader
private int mode; private int mode;
...@@ -39,11 +38,10 @@ public class ContentReadingLogParameters extends AcmsContentParameters { ...@@ -39,11 +38,10 @@ public class ContentReadingLogParameters extends AcmsContentParameters {
* @param longitude 経度です。 * @param longitude 経度です。
* @param pageLog ページ閲覧ログです。 * @param pageLog ページ閲覧ログです。
* @param pageLog オブジェクトログです。 * @param pageLog オブジェクトログです。
* @param customLog カスタマイズログ
* @since 1.0.0 * @since 1.0.0
*/ */
public ContentReadingLogParameters(String sid, long contentId, Timestamp readingStartDate, Timestamp readingEndDate public ContentReadingLogParameters(String sid, long contentId, Timestamp readingStartDate, Timestamp readingEndDate
, int readingTime, int deviceTypeId, Double latitude, Double longitude, int mode, JSONObject pageLog, JSONObject objectLog, JSONObject customLog) { , int readingTime, int deviceTypeId, Double latitude, Double longitude, int mode, JSONObject pageLog, JSONObject objectLog) {
super(sid, contentId); super(sid, contentId);
this.readingStartDate = readingStartDate; this.readingStartDate = readingStartDate;
...@@ -55,7 +53,6 @@ public class ContentReadingLogParameters extends AcmsContentParameters { ...@@ -55,7 +53,6 @@ public class ContentReadingLogParameters extends AcmsContentParameters {
this.mode = mode; this.mode = mode;
this.pageLog = pageLog; this.pageLog = pageLog;
this.objectLog = objectLog; this.objectLog = objectLog;
this.customLog = customLog;
} }
/** /**
...@@ -151,17 +148,6 @@ public class ContentReadingLogParameters extends AcmsContentParameters { ...@@ -151,17 +148,6 @@ public class ContentReadingLogParameters extends AcmsContentParameters {
return objectLog.toString(); return objectLog.toString();
} }
/**
* カスタマイズログ
* @return
*/
public String getCustomLog() {
if (customLog == null) {
return null;
}
return customLog.toString();
}
public String getLoginId() { public String getLoginId() {
return loginId; return loginId;
} }
......
...@@ -143,21 +143,6 @@ public class AcmsApis { ...@@ -143,21 +143,6 @@ public class AcmsApis {
*/ */
public static final String ApiUrlServerTimeZone = "serverTimeZone"; public static final String ApiUrlServerTimeZone = "serverTimeZone";
//백업된 파일 리스트 조회
public static final String ApiUrlGetBackupFileList = "getBackupFileList";
//백업된 파일 다운로드
public static final String ApiUrlGetBackupFile = "getBackupFile";
//백업할 파일을 업로드
public static final String ApiUrlUploadBackupFile = "uploadBackupFile";
//백업 개시 서버에 알림
public static final String ApiUrlNotifyBackupStart = "notifyBackupStart";
//백업이 완료되었음을 서버에 알림
public static final String ApiUrlNotifyBackupFinish = "notifyBackupFinish";
//앙케이트 응답 내용을 서버에 송신 //앙케이트 응답 내용을 서버에 송신
public static final String ApiUrlEnqueteReply = "enqueteReply"; public static final String ApiUrlEnqueteReply = "enqueteReply";
......
...@@ -4,11 +4,6 @@ import jp.agentec.abook.abv.bl.logic.ContractLogic; ...@@ -4,11 +4,6 @@ import jp.agentec.abook.abv.bl.logic.ContractLogic;
public interface ServiceOption { public interface ServiceOption {
interface ServiceOptionId { interface ServiceOptionId {
/**
* 通知機能使用
*/
int Apns = 12;
/** /**
* 公開終了時のDL済コンテンツ強制削除 * 公開終了時のDL済コンテンツ強制削除
*/ */
...@@ -18,10 +13,6 @@ public interface ServiceOption { ...@@ -18,10 +13,6 @@ public interface ServiceOption {
*/ */
int NoauthDelete = 14; int NoauthDelete = 14;
/** /**
* 外部接続時閲覧禁止
*/
int DetectExtConnect = 17;
/**
* Office使用可 * Office使用可
*/ */
int Office2pdf = 19; int Office2pdf = 19;
...@@ -42,14 +33,6 @@ public interface ServiceOption { ...@@ -42,14 +33,6 @@ public interface ServiceOption {
*/ */
int UseridUdidOverwrite = 26; int UseridUdidOverwrite = 26;
/** /**
* バックアップオプション
*/
int Backup = 28;
/**
* PDF メール送信
*/
int PdfSendMail = 31;
/**
* PDFLink背景色設定 * PDFLink背景色設定
*/ */
int PdfLinkDisp = 32; int PdfLinkDisp = 32;
...@@ -88,10 +71,6 @@ public interface ServiceOption { ...@@ -88,10 +71,6 @@ public interface ServiceOption {
*/ */
int ForceOfflineWait = 59; int ForceOfflineWait = 59;
/** /**
* ダッシュボードの使用有無
*/
int UsableDashboard = 62;
/**
* サイネージ * サイネージ
*/ */
int Signage = 67; int Signage = 67;
...@@ -116,30 +95,6 @@ public interface ServiceOption { ...@@ -116,30 +95,6 @@ public interface ServiceOption {
*/ */
int UsableReadinglogObject = 72; int UsableReadinglogObject = 72;
/** /**
* コンテンツ自動DL
*/
int AutoDownload = 73;
/**
* コンテンツアップロード
*/
int ContentUpload = 75;
/**
* コンテンツアップロード
*/
int QRCode = 76;
/**
* 日比谷花壇カタログ
*/
int HibiyakadanCatalog = 77;
/**
* コンテンツ共有URL
*/
int ContentShare = 78;
/**
* 事業者規模
*/
int ContractScale = 98;
/**
* グループ表示 * グループ表示
*/ */
int UseGroup = 99; int UseGroup = 99;
...@@ -147,43 +102,11 @@ public interface ServiceOption { ...@@ -147,43 +102,11 @@ public interface ServiceOption {
* ジャンル表示 * ジャンル表示
*/ */
int UseGenre = 100; int UseGenre = 100;
/**
* ロケーション切り替え
*/
int DeviceLocationMode = 103;
/**
* 初期表示メニュー
*/
int HomeMenuDefault = 104;
/**
* 決済
*/
int Payment = 106;
/**
* 定期購読あり
*/
int AutoSubscriptionAll = 107;
/**
* モード切替時間(秒)
*/
int ModeInterval = 108;
/**
* 自動ロック利用
*/
int UseAutoLock = 117;
/**
* 配布形式
*/
int DeliveryType = 110;
/** /**
* オフライン時試験送信 * オフライン時試験送信
*/ */
int TransmitExamAtOfflLine = 124; int TransmitExamAtOfflLine = 124;
/**
* ユーザ情報暗号化
*/
int EncryptUserInfo = 126;
/** /**
* 試験 * 試験
...@@ -194,15 +117,6 @@ public interface ServiceOption { ...@@ -194,15 +117,6 @@ public interface ServiceOption {
* クイズ * クイズ
*/ */
int Quiz = 129; int Quiz = 129;
/**
* 天気予報利用
*/
int UseWeather = 131;
/**
* HTMLカスタムログ
*/
int UseCustomLog = 137;
/** /**
* 360°動画 * 360°動画
...@@ -233,38 +147,5 @@ public interface ServiceOption { ...@@ -233,38 +147,5 @@ public interface ServiceOption {
* 報告タイプ:N(通常)、Y(定期点検) * 報告タイプ:N(通常)、Y(定期点検)
*/ */
int ProjectReportType = 171; int ProjectReportType = 171;
// ↓↓------------- No Used------------------- ↓↓
/**
* トランスコーダ使用
*/
int Transcoder = 11;
/**
* ユーザID自動登録
*/
int UseridAutoRegister = 16;
/**
* iPad
*/
int iPad = 302;
/**
* iPhone
*/
int iPhone = 303;
/**
* Android
*/
int Android = 404;
} }
/**
* ServiceOptionId.ContentShare
* {@link ContractLogic#getContentShareType}
*/
interface ContentShareType {
int NONE = 0;
int ABOOK_TYPE = 1;
}
} }
\ No newline at end of file
...@@ -12,11 +12,6 @@ public enum ServiceOptionId { ...@@ -12,11 +12,6 @@ public enum ServiceOptionId {
*/ */
Transcoder(11), Transcoder(11),
/** /**
* 通知機能使用
* @since 1.0.0
*/
Apns(12),
/**
* 公開終了時のDL済コンテンツ強制削除 * 公開終了時のDL済コンテンツ強制削除
* @since 1.0.0 * @since 1.0.0
*/ */
...@@ -27,16 +22,6 @@ public enum ServiceOptionId { ...@@ -27,16 +22,6 @@ public enum ServiceOptionId {
*/ */
NoauthDelete(14), NoauthDelete(14),
/** /**
* ユーザID自動登録
* @since 1.0.0
*/
UseridAutoRegister(16),
/**
* 外部接続時閲覧禁止
* @since 1.0.0
*/
DetectExtConnect(17),
/**
* Office使用可 * Office使用可
* @since 1.2.0 * @since 1.2.0
*/ */
...@@ -62,11 +47,6 @@ public enum ServiceOptionId { ...@@ -62,11 +47,6 @@ public enum ServiceOptionId {
*/ */
UseridUdidOverwrite(26), UseridUdidOverwrite(26),
/** /**
* 백업/복원 옵션
* @since 1.0.0
*/
Backup(28),
/**
* PDF 메일 보내기 * PDF 메일 보내기
* @since 1.0.0 * @since 1.0.0
*/ */
...@@ -117,11 +97,6 @@ public enum ServiceOptionId { ...@@ -117,11 +97,6 @@ public enum ServiceOptionId {
*/ */
ForceOfflineWait(59), ForceOfflineWait(59),
/** /**
* 대쉬보드 사용 유무
* @since 1.0.0
*/
UsableDashboard(62),
/**
* 閲覧ログGPS使用可 * 閲覧ログGPS使用可
* @since 1.1.0 * @since 1.1.0
*/ */
...@@ -132,26 +107,6 @@ public enum ServiceOptionId { ...@@ -132,26 +107,6 @@ public enum ServiceOptionId {
*/ */
UsableReadinglogObject(72), UsableReadinglogObject(72),
/** /**
* コンテンツ自動DL
* @since 1.0.0
*/
AutoDownload(73),
/**
* コンテンツアップロード
* @since 1.2.0
*/
ContentUpload(75),
/**
* 日比谷花壇カタログ
* @since 1.2.0
*/
HibiyakadanCatalog(77),
/**
* コンテンツ共有URL
* @since 1.2.0
*/
ContentShare(78),
/**
* iPad * iPad
* @since 1.0.0 * @since 1.0.0
*/ */
......
...@@ -4,7 +4,7 @@ import java.io.File; ...@@ -4,7 +4,7 @@ import java.io.File;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.util.Date; import java.util.Date;
import jp.agentec.abook.abv.bl.acms.client.json.reader.CmsUrlJSON; import jp.agentec.abook.abv.bl.acms.client.json.CmsUrlJSON;
import jp.agentec.abook.abv.bl.acms.type.ContentZipType; import jp.agentec.abook.abv.bl.acms.type.ContentZipType;
import jp.agentec.abook.abv.bl.common.log.LogLevel; import jp.agentec.abook.abv.bl.common.log.LogLevel;
import jp.agentec.abook.abv.bl.common.log.Logger; import jp.agentec.abook.abv.bl.common.log.Logger;
...@@ -27,7 +27,6 @@ public class ABVEnvironment { ...@@ -27,7 +27,6 @@ public class ABVEnvironment {
public String appVersion = null; public String appVersion = null;
public String acmsAddress = null; public String acmsAddress = null;
public String downloadServerAddress = null; public String downloadServerAddress = null;
public int editionType;
public String defaultLogName = null; public String defaultLogName = null;
private LogLevel logLevel = null; private LogLevel logLevel = null;
public String mainFolderName = null; public String mainFolderName = null;
......
...@@ -24,12 +24,6 @@ public class Constant { ...@@ -24,12 +24,6 @@ public class Constant {
int FLIP = 4; int FLIP = 4;
} }
public interface ContractScale {
int Default = 0;
int Mid = 1;
int Large = 2;
}
public interface BackupFileType { public interface BackupFileType {
String Memo = "1"; String Memo = "1";
String Marking = "2"; String Marking = "2";
......
...@@ -10,7 +10,6 @@ import jp.agentec.abook.abv.bl.acms.type.DeliveryType; ...@@ -10,7 +10,6 @@ import jp.agentec.abook.abv.bl.acms.type.DeliveryType;
import jp.agentec.abook.abv.bl.acms.type.LoginStatus; import jp.agentec.abook.abv.bl.acms.type.LoginStatus;
import jp.agentec.abook.abv.bl.acms.type.SecurityPolicyType; import jp.agentec.abook.abv.bl.acms.type.SecurityPolicyType;
import jp.agentec.abook.abv.bl.acms.type.ServiceOption.ServiceOptionId; import jp.agentec.abook.abv.bl.acms.type.ServiceOption.ServiceOptionId;
import jp.agentec.abook.abv.bl.common.Constant.ContractScale;
import jp.agentec.abook.abv.bl.common.log.Logger; import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.common.util.SecurityUtil; import jp.agentec.abook.abv.bl.common.util.SecurityUtil;
import jp.agentec.abook.abv.bl.data.dao.AbstractDao; import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
...@@ -300,10 +299,6 @@ public class ABVDataCache { ...@@ -300,10 +299,6 @@ public class ABVDataCache {
return isServiceOptionEnable(ServiceOptionId.NoauthDelete); return isServiceOptionEnable(ServiceOptionId.NoauthDelete);
} }
public boolean isDetectExtConnect() {
return isServiceOptionEnable(ServiceOptionId.DetectExtConnect);
}
public SecurityPolicyType getForcePwChangeOnLogin() { public SecurityPolicyType getForcePwChangeOnLogin() {
SecurityPolicyType code = SecurityPolicyType.None; SecurityPolicyType code = SecurityPolicyType.None;
...@@ -344,10 +339,6 @@ public class ABVDataCache { ...@@ -344,10 +339,6 @@ public class ABVDataCache {
return isServiceOptionEnable(ServiceOptionId.PdfLinkDisp); return isServiceOptionEnable(ServiceOptionId.PdfLinkDisp);
} }
public boolean isUsableDashboard() {
return isServiceOptionEnable(ServiceOptionId.UsableDashboard);
}
public boolean isCatalogEdition() { public boolean isCatalogEdition() {
return isServiceOptionEnable(ServiceOptionId.CatalogEdition); return isServiceOptionEnable(ServiceOptionId.CatalogEdition);
} }
...@@ -364,14 +355,6 @@ public class ABVDataCache { ...@@ -364,14 +355,6 @@ public class ABVDataCache {
return isServiceOptionEnable(ServiceOptionId.ProjectReportType); return isServiceOptionEnable(ServiceOptionId.ProjectReportType);
} }
public boolean isPayment() {
return isServiceOptionEnable(ServiceOptionId.Payment);
}
public boolean isUseAutoLock() {
return isServiceOptionEnable(ServiceOptionId.UseAutoLock);
}
public boolean isEnquete() { public boolean isEnquete() {
return isServiceOptionEnable(ServiceOptionId.Enquete); return isServiceOptionEnable(ServiceOptionId.Enquete);
} }
...@@ -384,45 +367,10 @@ public class ABVDataCache { ...@@ -384,45 +367,10 @@ public class ABVDataCache {
return isServiceOptionEnable(ServiceOptionId.Quiz); return isServiceOptionEnable(ServiceOptionId.Quiz);
} }
public boolean isUseWeatherForecast() {
return isServiceOptionEnable(ServiceOptionId.UseWeather);
}
public boolean doUseCustomLog() {
return isServiceOptionEnable(ServiceOptionId.UseCustomLog);
}
public boolean isTransmitExamAtOffline() { public boolean isTransmitExamAtOffline() {
return isServiceOptionEnable(ServiceOptionId.TransmitExamAtOfflLine); return isServiceOptionEnable(ServiceOptionId.TransmitExamAtOfflLine);
} }
public boolean isEncryptUserInfo() {
return isServiceOptionEnable(ServiceOptionId.EncryptUserInfo);
}
public boolean isAutoSubscriptionAll() {
ServiceOptionDto dto = getServiceOption(ServiceOptionId.AutoSubscriptionAll);
return dto != null && (NumericUtil.parseInt(dto.val) & 2) == 2;
}
public int getContractScale() {
ServiceOptionDto dto = getServiceOption(ServiceOptionId.ContractScale);
int contractScale = ContractScale.Default;
if (dto != null) {
contractScale = NumericUtil.parseInt(dto.val);
}
return contractScale;
}
public int getDeviceLocationMode() {
ServiceOptionDto dto = getServiceOption(ServiceOptionId.DeviceLocationMode);
int deviceLocationMode = 0;
if (dto != null) {
deviceLocationMode = NumericUtil.parseInt(dto.val);
}
return deviceLocationMode;
}
public boolean isUseGroup() { public boolean isUseGroup() {
return isServiceOptionEnable(ServiceOptionId.UseGroup); return isServiceOptionEnable(ServiceOptionId.UseGroup);
} }
...@@ -442,73 +390,6 @@ public class ABVDataCache { ...@@ -442,73 +390,6 @@ public class ABVDataCache {
} }
return false; return false;
} }
/**
* 自動DLオプションが有効かどうか(値が1(初期値off)あるいは1(初期値on)の場合true)
*
* @return
*/
public boolean isAutoDownloadOptionEnable() {
ServiceOptionDto dto = getServiceOption(ServiceOptionId.AutoDownload);
return dto != null && dto.val != null && (dto.val.equals("1") || dto.val.equals("2"));
}
/**
* 配信タイプを選択可能かどうか
*
* @return
*/
public boolean isDeliveryTypeSelectable() {
ServiceOptionDto dto = getServiceOption(ServiceOptionId.DeliveryType);
return dto != null && dto.val != null && dto.val.equals("2");
}
/**
* 配信タイプを返す
*
* @return
*/
public int getDeliveryType() {
ServiceOptionDto dto = getServiceOption(ServiceOptionId.DeliveryType);
int ret = DeliveryType.DOWNLOAD;
try {
ret = Integer.parseInt(dto.val);
} catch (Exception e) {
}
return ret;
}
public int getModeInterval() {
ServiceOptionDto dto = getServiceOption(ServiceOptionId.ModeInterval);
int defVal = 60;
if (dto != null) {
defVal = NumericUtil.parseInt(dto.val, defVal);
}
return defVal;
}
}
public synchronized void addDashboardList(ArrayList<DashboardDto> list) {
try {
if (dashboardList == null) {
dashboardList = new ArrayList<DashboardDto>();
}else{
if (dashboardList.equals(list)) {
return;
}
}
dashboardList = list;
} catch (Exception e) {
Logger.e(TAG, e.toString());
}
}
public ArrayList<DashboardDto> getDashboardList() {
return dashboardList;
} }
public void setDiffMinFromUTC(String timeZone) { public void setDiffMinFromUTC(String timeZone) {
......
...@@ -3,10 +3,8 @@ package jp.agentec.abook.abv.bl.data; ...@@ -3,10 +3,8 @@ package jp.agentec.abook.abv.bl.data;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase; import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase;
import jp.agentec.abook.abv.bl.common.log.Logger; import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.data.tables.LContentCustomLog;
import jp.agentec.abook.abv.bl.data.tables.LContentObjectLog; import jp.agentec.abook.abv.bl.data.tables.LContentObjectLog;
import jp.agentec.abook.abv.bl.data.tables.LContentPageReadingLog; import jp.agentec.abook.abv.bl.data.tables.LContentPageReadingLog;
import jp.agentec.abook.abv.bl.data.tables.LContentReadingLog; import jp.agentec.abook.abv.bl.data.tables.LContentReadingLog;
...@@ -39,8 +37,6 @@ import jp.agentec.abook.abv.bl.data.tables.TInspectTaskReport; ...@@ -39,8 +37,6 @@ import jp.agentec.abook.abv.bl.data.tables.TInspectTaskReport;
import jp.agentec.abook.abv.bl.data.tables.TMarkingSetting; import jp.agentec.abook.abv.bl.data.tables.TMarkingSetting;
import jp.agentec.abook.abv.bl.data.tables.TProject; import jp.agentec.abook.abv.bl.data.tables.TProject;
import jp.agentec.abook.abv.bl.data.tables.TPushMessage; import jp.agentec.abook.abv.bl.data.tables.TPushMessage;
import jp.agentec.abook.abv.bl.data.tables.TSearchHistory;
import jp.agentec.abook.abv.bl.data.tables.TSubscriptionHistory;
import jp.agentec.abook.abv.bl.data.tables.TTask; import jp.agentec.abook.abv.bl.data.tables.TTask;
import jp.agentec.abook.abv.bl.data.tables.TTaskDirections; import jp.agentec.abook.abv.bl.data.tables.TTaskDirections;
import jp.agentec.abook.abv.bl.data.tables.TTaskDirectionsItems; import jp.agentec.abook.abv.bl.data.tables.TTaskDirectionsItems;
...@@ -80,11 +76,9 @@ public class ABVDataOpenHelper { ...@@ -80,11 +76,9 @@ public class ABVDataOpenHelper {
iTableScripts.add(new LContentReadingLog()); iTableScripts.add(new LContentReadingLog());
iTableScripts.add(new LContentPageReadingLog()); iTableScripts.add(new LContentPageReadingLog());
iTableScripts.add(new LContentObjectLog()); iTableScripts.add(new LContentObjectLog());
iTableScripts.add(new LContentCustomLog());
iTableScripts.add(new MPasswordLockInfo()); iTableScripts.add(new MPasswordLockInfo());
iTableScripts.add(new TContentOldPdf()); iTableScripts.add(new TContentOldPdf());
iTableScripts.add(new TContentServerSearched()); iTableScripts.add(new TContentServerSearched());
iTableScripts.add(new TSearchHistory());
iTableScripts.add(new MAcms()); iTableScripts.add(new MAcms());
iTableScripts.add(new MAppConfig()); iTableScripts.add(new MAppConfig());
...@@ -96,7 +90,6 @@ public class ABVDataOpenHelper { ...@@ -96,7 +90,6 @@ public class ABVDataOpenHelper {
iTableScripts.add(new MServiceOption()); iTableScripts.add(new MServiceOption());
iTableScripts.add(new TMarkingSetting()); iTableScripts.add(new TMarkingSetting());
iTableScripts.add(new TEnquete()); iTableScripts.add(new TEnquete());
iTableScripts.add(new TSubscriptionHistory());
iTableScripts.add(new MWorkerGroup()); iTableScripts.add(new MWorkerGroup());
iTableScripts.add(new TProject()); iTableScripts.add(new TProject());
......
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.common.log.Logger;
import jp.agentec.abook.abv.bl.dto.ContentCustomLogDto;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
public class ContentCustomLogDao extends AbstractDao {
/**
* {@link MemberInfoDao} のインスタンスを初期化します。
* context アンドロイドの android.content.Contextのインスタンス
* @throws ClassCastException 引数のcontextが android.content.Context 又は、その継承クラスではありません。
* @since 1.0.0
*/
ContentCustomLogDao() {
}
@Override
protected ContentCustomLogDto convert(Cursor cursor) {
ContentCustomLogDto dto = new ContentCustomLogDto();
int column = cursor.getColumnIndex("content_custom_log_id");
if (column != -1) {
dto.content_custom_log_id = cursor.getInt(column);
}
column = cursor.getColumnIndex("reading_log_id");
if (column != -1) {
dto.readingLogId = cursor.getInt(column);
}
column = cursor.getColumnIndex("action_date");
if (column != -1) {
dto.actionDate = DateTimeUtil.toDate(cursor.getString(column), "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen);
}
column = cursor.getColumnIndex("content_id");
if (column != -1) {
dto.contentId = cursor.getLong(column);
}
column = cursor.getColumnIndex("param1");
if (column != -1) {
dto.param1 = cursor.getString(column);
}
column = cursor.getColumnIndex("param2");
if (column != -1) {
dto.param2 = cursor.getString(column);
}
column = cursor.getColumnIndex("param3");
if (column != -1) {
dto.param3 = cursor.getString(column);
}
column = cursor.getColumnIndex("param4");
if (column != -1) {
dto.param4 = cursor.getString(column);
}
column = cursor.getColumnIndex("param5");
if (column != -1) {
dto.param5 = cursor.getString(column);
}
return dto;
}
public ContentCustomLogDto getContentCustomLog(int customLogId) {
String[] args = new String[] { "" + customLogId};
return rawQueryGetDto("select * from l_content_custom_log where content_custom_log_id=?", args, ContentCustomLogDto.class);
}
public List<ContentCustomLogDto> getContentCustomLogs(long contentId, int readingLogId) {
String[] args = new String[] { "" + contentId, "" + readingLogId };
return rawQueryGetDtoList("select * from l_content_custom_log where content_id=? and reading_log_id=?", args, ContentCustomLogDto.class);
}
public void insertContentCustomLog(ContentCustomLogDto dto) {
try {
insert("insert into l_content_custom_log (content_custom_log_id, reading_log_id, action_date, content_id, param1, param2, param3, param4, param5) values (?,?,?,?,?,?,?,?,?)",
new Object[] {getCustomLogMax(), dto.readingLogId, dto.actionDate, dto.contentId, dto.param1, dto.param2, dto.param3, dto.param4, dto.param5});
} catch (Exception e) {
Logger.w("ContentObjectLogDao", e.toString());
}
}
public boolean updateContentCustomLog(ContentCustomLogDto dto) {
long count = update("update l_content_custom_log set reading_log_id=?, action_date=?, content_id=?, param1 = ?, param2 = ?, param3 = ?, param4 = ?, param5 = ?, where content_custom_log_id=?", dto.getUpdateValues());
return count > 0;
}
public boolean deleteContentCustomLog(long contentId, int readingLogId) {
String[] args = new String[] { "" + contentId, "" + readingLogId};
long ret = delete("l_content_custom_log", "content_id=? and reading_log_id=?", args);
return ret > 0;
}
public boolean deleteContentCustomLog(int content_custom_log_id) {
String[] args = new String[] { "" +content_custom_log_id};
return (delete("l_content_custom_log", "content_custom_log_id = ? ", args) > 0);
}
public int getCustomLogMax() {
return rawQueryGetInt("select MAX(seq) AS seq from sqlite_sequence where name= ? ", new String[] {"l_content_custom_log"}) + 1;
}
}
\ No newline at end of file
...@@ -163,10 +163,6 @@ public class ContentDao extends AbstractDao { ...@@ -163,10 +163,6 @@ public class ContentDao extends AbstractDao {
if (column != -1) { if (column != -1) {
dto.alertMessage = cursor.getString(column); dto.alertMessage = cursor.getString(column);
} }
column = cursor.getColumnIndex("pdf_send_mail_flg");
if (column != -1) {
dto.pdfSendMailFlg = toBool(cursor.getInt(column));
}
column = cursor.getColumnIndex("print_flg"); column = cursor.getColumnIndex("print_flg");
if (column != -1) { if (column != -1) {
dto.printFlg = toBool(cursor.getInt(column)); dto.printFlg = toBool(cursor.getInt(column));
...@@ -908,10 +904,6 @@ public class ContentDao extends AbstractDao { ...@@ -908,10 +904,6 @@ public class ContentDao extends AbstractDao {
return rawQueryGetInt("select last_viewed_page from t_content where content_id = " + contentId, null); return rawQueryGetInt("select last_viewed_page from t_content where content_id = " + contentId, null);
} }
public List<ContentDto> getUndeliverableDeleteContent(String curDate) {
return rawQueryGetDtoList("select * from t_content where delivery_end_date<? and content_id in (select content_id from t_content_id_conv a inner join m_contract b on a.site_id=b.site_id and a.contract_id=b.contract_id where b.undeliverable_delete='Y')", new String[]{(curDate)}, ContentDto.class);
}
public ContentDto getContentByProductId(String productId) { public ContentDto getContentByProductId(String productId) {
return rawQueryGetDto("select * from t_content where product_id=?", new String[]{"" + productId}, ContentDto.class); return rawQueryGetDto("select * from t_content where product_id=?", new String[]{"" + productId}, ContentDto.class);
} }
......
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.ContractDto;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
public class ContractDao extends AbstractDao {
/*package*/ ContractDao() {
}
@Override
public ContractDto convert(Cursor cursor) {
ContractDto dto = new ContractDto();
int colnum = cursor.getColumnIndex("site_id");
if (colnum != -1) {
dto.siteId = cursor.getInt(colnum);
}
colnum = cursor.getColumnIndex("contract_id");
if (colnum != -1) {
dto.contractId = cursor.getInt(colnum);
}
colnum = cursor.getColumnIndex("company_name");
if (colnum != -1) {
dto.companyName = cursor.getString(colnum);
}
colnum = cursor.getColumnIndex("url_path");
if (colnum != -1) {
dto.urlPath = cursor.getString(colnum);
}
colnum = cursor.getColumnIndex("undeliverable_delete");
if (colnum != -1) {
dto.undeliverableDelete = cursor.getString(colnum);
}
colnum = cursor.getColumnIndex("usable_push_message");
if (colnum != -1) {
dto.usablePushMessage = cursor.getString(colnum);
}
colnum = cursor.getColumnIndex("usable_readinglog_gps");
if (colnum != -1) {
dto.usableReadinglogGps = cursor.getString(colnum);
}
colnum = cursor.getColumnIndex("usable_readinglog_object");
if (colnum != -1) {
dto.usableReadinglogObject = cursor.getString(colnum);
}
colnum = cursor.getColumnIndex("del_flg");
if (colnum != -1) {
dto.delFlg = cursor.getInt(colnum);
}
colnum = cursor.getColumnIndex("insert_date");
if (colnum != -1) {
dto.insertDate = DateTimeUtil.toDate(cursor.getString(colnum), "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen);
}
colnum = cursor.getColumnIndex("update_date");
if (colnum != -1) {
dto.updateDate = DateTimeUtil.toDate(cursor.getString(colnum), "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen);
}
colnum = cursor.getColumnIndex("receive_push_message");
if (colnum != -1) {
dto.receivePushMessage = cursor.getInt(colnum);
}
colnum = cursor.getColumnIndex("user_update_date");
if (colnum != -1) {
dto.userUpdateDate = DateTimeUtil.toDate(cursor.getString(colnum), "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen);
}
return dto;
}
public ContractDto getDto(int siteId, int contractId) {
return rawQueryGetDto("select * from m_contract where site_id=? and contract_id=?", new String[]{""+siteId, ""+contractId}, ContractDto.class);
}
public boolean exists(int siteId, int contractId) {
return rawQueryGetString("select site_id from m_contract where site_id=? and contract_id=?", new String[]{""+siteId, ""+contractId}) != null;
}
public Date getLastUpdate() {
String updateDate = rawQueryGetString("select update_date from m_contract order by update_date desc limit 1", null);
if (updateDate == null) {
return null;
}
return DateTimeUtil.toDate(updateDate, "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen);
}
public void insert(ContractDto contractDto) {
insert("insert into m_contract (site_id, contract_id, company_name, url_path, undeliverable_delete, usable_push_message, usable_readinglog_gps, usable_readinglog_object, del_flg, insert_date, update_date, receive_push_message, user_update_date) values (?,?,?,?,?,?,?,?,?,?,?,?,?)", contractDto.getInsertValues());
}
public void update(ContractDto contractDto) {
update("update m_contract set company_name=?, url_path=?, undeliverable_delete=?, usable_push_message=?, usable_readinglog_gps=?, usable_readinglog_object=?, del_flg=?, insert_date=?, update_date=?, receive_push_message=?, user_update_date=? where site_id=? and contract_id=?", contractDto.getUpdateValues());
}
public void insertOrUpdate(ContractDto contractDto) {
if (exists(contractDto.siteId, contractDto.contractId)) { // 更新
update(contractDto);
}
else { // 登録
insert(contractDto);
}
}
public List<ContractDto> getListByUndeliverableDelete() {
return rawQueryGetDtoList("select * from m_contract where undeliverable_delete='Y'", null, ContractDto.class);
}
public List<ContractDto> findByContentExist(){
StringBuilder sb = new StringBuilder();
sb.append(" select mc.* ");
sb.append(" from m_contract mc ");
sb.append(" inner join ");
sb.append(" ( ");
sb.append(" select site_id, contract_id ");
sb.append(" from t_content tc ");
sb.append(" inner join t_content_id_conv tcic ");
sb.append(" on tcic.content_id = tc.content_id ");
sb.append(" group by site_id, contract_id ");
sb.append(" ) c ");
sb.append(" on c.site_id = mc.site_id ");
sb.append(" and c.contract_id = mc.contract_id ");
sb.append(" order by mc.company_name ");
return rawQueryGetDtoList(sb.toString(), null, ContractDto.class);
}
public List<ContractDto> findByReceivePushMessage(int receivePushMessage) {
return rawQueryGetDtoList("select * from m_contract where receive_push_message=?",new String[]{""+receivePushMessage}, ContractDto.class);
}
public List<ContractDto> getListByUsablePushMessage() {
return rawQueryGetDtoList("select mc.* from m_contract mc inner join (select site_id, contract_id from t_content_id_conv group by site_id, contract_id ) tcic on mc.site_id = tcic.site_id and mc.contract_id = tcic.contract_id where mc.usable_push_message = 'Y' order by mc.company_name ",null, ContractDto.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.common.log.Logger;
import jp.agentec.abook.abv.bl.dto.SearchHistoryDto;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
public class SearchHistoryDao extends AbstractDao {
private static final String TAG = "SearchHistoryDao";
/**
* {@link SearchHistoryDao} のインスタンスを初期化します。
* @since 1.0.0
*/
/*package*/ SearchHistoryDao() {
}
@Override
protected SearchHistoryDto convert(Cursor cursor) {
SearchHistoryDto dto = new SearchHistoryDto();
int column = cursor.getColumnIndex("search_text");
if (column != -1) {
dto.searchText = cursor.getString(column);
}
column = cursor.getColumnIndex("insert_date");
if (column != -1) {
dto.insertDate = DateTimeUtil.toDate(cursor.getString(column), "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen);
}
return dto;
}
public List<SearchHistoryDto> getSearchHistoryDtoList() {
return rawQueryGetDtoList("select * from t_search_history order by insert_date DESC limit 10", null, SearchHistoryDto.class);
}
public void insertUpdateSearchHistory(SearchHistoryDto dto) {
long count = update("update t_search_history set insert_date = ? where search_text = ? ", dto.getUpdateValues());
if (count == 0) {
insert("insert into t_search_history (search_text, insert_date) values (?, ?)", dto.getInsertValues());
Logger.d(TAG, "insert t_search_history");
} else {
Logger.d(TAG, "update t_search_history");
}
}
public void deleteSearchHistory(String searchText) {
delete("t_search_history", "search_text=?", new String[]{searchText});
}
public void deleteAllSearchHistory() {
delete("t_search_history", null, null);
}
}
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.SubscriptionDto;
import jp.agentec.abook.abv.bl.dto.SubscriptionDto.Period;
import jp.agentec.abook.abv.bl.dto.SubscriptionHistoryDto;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
public class SubscriptionHistoryDao extends AbstractDao {
private static final String TAG = "SubscriptionHistoryDao";
/*package*/ SubscriptionHistoryDao() {
}
@Override
public SubscriptionHistoryDto convert(Cursor cursor) {
SubscriptionHistoryDto dto = new SubscriptionHistoryDto();
int column = cursor.getColumnIndex("subscription_history_id");
if (column != -1) {
dto.subscriptionHistoryId = cursor.getInt(column);
}
column = cursor.getColumnIndex("purchase_history_id");
if (column != -1) {
dto.purchaseHistoryId = cursor.getLong(column);
}
column = cursor.getColumnIndex("content_set_id");
if (column != -1) {
dto.contentSetId = cursor.getInt(column);
}
column = cursor.getColumnIndex("content_set_name");
if (column != -1) {
dto.contentSetName = cursor.getString(column);
}
column = cursor.getColumnIndex("all_flg");
if (column != -1) {
dto.allFlg = cursor.getInt(column);
}
column = cursor.getColumnIndex("product_id");
if (column != -1) {
dto.productId = cursor.getString(column);
}
column = cursor.getColumnIndex("order_id");
if (column != -1) {
dto.orderId = cursor.getString(column);
}
column = cursor.getColumnIndex("package_name");
if (column != -1) {
dto.packageName = cursor.getString(column);
}
column = cursor.getColumnIndex("purchase_time");
if (column != -1) {
dto.purchaseTime = cursor.getLong(column);
}
column = cursor.getColumnIndex("purchase_state");
if (column != -1) {
dto.purchaseState = cursor.getInt(column);
}
column = cursor.getColumnIndex("developer_payload");
if (column != -1) {
dto.developerPayload = cursor.getString(column);
}
column = cursor.getColumnIndex("purchase_token");
if (column != -1) {
dto.purchaseToken = cursor.getString(column);
}
column = cursor.getColumnIndex("auto_renewing");
if (column != -1) {
dto.autoRenewing = toBool(cursor.getInt(column));
}
column = cursor.getColumnIndex("start_time_millis");
if (column != -1) {
dto.startTimeMillis = cursor.getLong(column);
}
column = cursor.getColumnIndex("expiry_time_millis");
if (column != -1) {
dto.expiryTimeMillis = cursor.getLong(column);
}
column = cursor.getColumnIndex("sent_flg");
if (column != -1) {
dto.sentFlg = cursor.getInt(column);
}
column = cursor.getColumnIndex("del_flg");
if (column != -1) {
dto.delFlg = cursor.getInt(column);
}
column = cursor.getColumnIndex("insert_date");
if (column != -1) {
dto.insertDate = DateTimeUtil.toDate(cursor.getString(column), "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen);
}
column = cursor.getColumnIndex("update_date");
if (column != -1) {
dto.updateDate = DateTimeUtil.toDate(cursor.getString(column), "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen);
}
return dto;
}
public int getSubscriptionHistorMax() {
return rawQueryGetInt("select MAX(seq) + 1 AS seq from sqlite_sequence where name=?", new String[]{"t_subscription_history"});
}
public List<SubscriptionHistoryDto> getAllValidList() {
return rawQueryGetDtoList("select * from t_subscription_history where all_flg=1 and del_flg<>1", null, SubscriptionHistoryDto.class);
}
public List<SubscriptionHistoryDto> getUnsentList() {
return rawQueryGetDtoList("select * from t_subscription_history where sent_flg=0", null, SubscriptionHistoryDto.class);
}
public void updateAsSent(int subscriptionHistoryId) {
update("update t_subscription_history set sent_flg=1, update_date=CURRENT_TIMESTAMP where subscription_history_id=?", new Object[]{subscriptionHistoryId});
}
public SubscriptionHistoryDto getDto(int subscriptionHistoryId) {
return rawQueryGetDto("select * from t_subscription_history where subscription_history_id=?", new String[]{""+subscriptionHistoryId}, SubscriptionHistoryDto.class);
}
public boolean exists(String purchaseToken) {
return rawQueryGetString("select purchase_history_id from t_subscription_history where purchase_token=?", new String[]{""+purchaseToken}) != null;
}
public SubscriptionHistoryDto findByPurchaseToken(String purchaseToken) {
return rawQueryGetDto("select * from t_subscription_history where purchase_token=?", new String[]{""+purchaseToken}, SubscriptionHistoryDto.class);
}
public void insert(SubscriptionHistoryDto subscriptionHistoryDto) {
insert("insert into t_subscription_history (subscription_history_id, purchase_history_id, content_set_id, content_set_name, all_flg, product_id, order_id, package_name, purchase_time, purchase_state, developer_payload, purchase_token, auto_renewing, start_time_millis, expiry_time_millis, sent_flg, del_flg, insert_date, update_date) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,CURRENT_TIMESTAMP,CURRENT_TIMESTAMP)", subscriptionHistoryDto.getInsertValues());
}
public void update(SubscriptionHistoryDto subscriptionHistoryDto) {
update("update t_subscription_history set purchase_history_id=?, content_set_id=?, content_set_name=?, all_flg=?, product_id=?, order_id=?, package_name=?, purchase_time=?, purchase_state=?, developer_payload=?, purchase_token=?, auto_renewing=?, start_time_millis=?, expiry_time_millis=?, sent_flg=?, del_flg=?, insert_date=?, update_date=CURRENT_TIMESTAMP where subscription_history_id=?", subscriptionHistoryDto.getUpdateValues());
}
public void insertOrUpdate(SubscriptionHistoryDto subscriptionHistoryDto) {
if (subscriptionHistoryDto.purchaseToken != null && exists(subscriptionHistoryDto.purchaseToken)) { // 更新
update(subscriptionHistoryDto);
}
else { // 登録
insert(subscriptionHistoryDto);
}
}
/**
* 履歴(定期購読の有効期間)を更新する。
*
* @param subscriptionDto
*/
public void update(SubscriptionDto subscriptionDto) {
if (subscriptionDto.historyList == null) {
return;
}
for (Period period : subscriptionDto.historyList) {
if (subscriptionDto.delFlg == 0 && period.start <= 0) { // startが不正な場合更新しない
continue;
}
update("update t_subscription_history set start_time_millis=?, expiry_time_millis=?, del_flg=?, update_date=CURRENT_TIMESTAMP where product_id=? and purchase_token=?",
new String[]{""+period.start, ""+period.end, ""+subscriptionDto.delFlg, subscriptionDto.productId, period.purchaseToken});
}
}
}
package jp.agentec.abook.abv.bl.data.tables;
import java.util.ArrayList;
import java.util.List;
import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase;
import jp.agentec.abook.abv.bl.data.DatabaseVersions;
public class LContentCustomLog extends SQLiteTableScript {
public LContentCustomLog() {
super();
}
@Override
public List<String> getCreateScript(int version) {
List<String> ddl = new ArrayList<String>();
ddl.add(createCustomLogTable());
return ddl;
}
@Override
public List<String> getUpgradeScript(int oldVersion, int newVersion) {
return null;
}
@Override
public List<String> getMigrationScript(SQLiteDatabase databaseConnection, int oldVersion, int newVersion, Object... params) {
return null;
}
private String createCustomLogTable() {
StringBuffer sql = new StringBuffer();
sql.append(" CREATE TABLE l_content_custom_log ( ");
sql.append(" content_custom_log_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT ");
sql.append(" , reading_log_id INTEGER NOT NULL ");
sql.append(" , action_date DATETIME NOT NULL ");
sql.append(" , content_id BIGINT NOT NULL ");
sql.append(" , param1 TEXT");
sql.append(" , param2 TEXT");
sql.append(" , param3 TEXT");
sql.append(" , param4 TEXT");
sql.append(" , param5 TEXT");
sql.append(" , FOREIGN KEY (reading_log_id) REFERENCES l_content_reading_log (reading_log_id) ");
sql.append(" ) ");
return sql.toString();
}
}
package jp.agentec.abook.abv.bl.data.tables;
import java.util.ArrayList;
import java.util.List;
import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase;
import jp.agentec.adf.util.StringUtil;
/**
* 検索を行った検索語を保存するテーブル
* @author jang
*
*/
public class TSearchHistory extends SQLiteTableScript {
public TSearchHistory() {
}
@Override
public List<String> getCreateScript(int version) {
List<String> ddl = new ArrayList<String>();
StringBuffer sql = new StringBuffer();
sql.append(" CREATE TABLE t_search_history ( ");
sql.append(" search_text VARCHAR(256) NOT NULL ");
sql.append(" , insert_date DATETIME NOT NULL ");
sql.append(" , PRIMARY KEY (search_text) ");
sql.append(" ) ");
ddl.add(sql.toString());
StringUtil.clear(sql);
return ddl;
}
@Override
public List<String> getUpgradeScript(int oldVersion, int newVersion) {
return null;
}
@Override
public List<String> getMigrationScript(SQLiteDatabase databaseConnection, int oldVersion, int newVersion, Object[] params) {
return null;
}
}
package jp.agentec.abook.abv.bl.data.tables;
import java.util.ArrayList;
import java.util.List;
import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.data.DatabaseVersions;
public class TSubscriptionHistory extends SQLiteTableScript {
public TSubscriptionHistory() {
}
@Override
public List<String> getCreateScript(int version) {
List<String> ddl = new ArrayList<String>();
StringBuffer sql = new StringBuffer();
Logger.d("DATA", "create version : %s", version);
sql.append(" create table t_subscription_history ( ");
sql.append(" subscription_history_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT ");
sql.append(" , purchase_history_id bigint ");
sql.append(" , content_set_id INTEGER ");
sql.append(" , content_set_name VARCHAR(100) ");
sql.append(" , all_flg INTEGER not null ");
sql.append(" , product_id TEXT not null ");
sql.append(" , order_id TEXT not null ");
sql.append(" , package_name TEXT not null ");
sql.append(" , purchase_time bigint not null ");
sql.append(" , purchase_state bigint not null ");
sql.append(" , developer_payload TEXT not null ");
sql.append(" , purchase_token TEXT not null ");
sql.append(" , auto_renewing BOOLEAN ");
sql.append(" , start_time_millis bigint ");
sql.append(" , expiry_time_millis bigint ");
sql.append(" , sent_flg BOOLEAN default 0 not null ");
sql.append(" , del_flg INTEGER default 0 not null ");
sql.append(" , insert_date DATE not null ");
sql.append(" , update_date DATE not null ");
sql.append(" ) ");
ddl.add(sql.toString());
return ddl;
}
@Override
public List<String> getMigrationScript(SQLiteDatabase databaseConnection, int oldVersion, int newVersion, Object... arg2) {
return null;
}
@Override
public List<String> getUpgradeScript(int oldVersion, int newVersion) {
return null;
}
}
...@@ -139,14 +139,6 @@ public class ContentDownloader { ...@@ -139,14 +139,6 @@ public class ContentDownloader {
this.downloadingPercentageNotifyInterval = downloadingPercentageNotifyInterval; this.downloadingPercentageNotifyInterval = downloadingPercentageNotifyInterval;
} }
public void setAutoDownload(boolean isAutoDownload) {
this.isAutoDownload = isAutoDownload;
}
public boolean isAutoDownload() {
return isAutoDownload;
}
public void addAutoDownload(long contentId) { public void addAutoDownload(long contentId) {
autoDownloadList.add(contentId); autoDownloadList.add(contentId);
} }
...@@ -303,7 +295,7 @@ public class ContentDownloader { ...@@ -303,7 +295,7 @@ public class ContentDownloader {
synchronized (targetContentMap) { synchronized (targetContentMap) {
targetContentMap.remove(contentId); targetContentMap.remove(contentId);
} }
if (isAutoDownload && targetContentMap.isEmpty()) { if (targetContentMap.isEmpty()) {
Logger.i(TAG, "AutoDownloadEnd"); Logger.i(TAG, "AutoDownloadEnd");
} }
} }
...@@ -514,7 +506,7 @@ public class ContentDownloader { ...@@ -514,7 +506,7 @@ public class ContentDownloader {
int targetCount = 0; int targetCount = 0;
for (Long contentId : autoDownloadList) { for (Long contentId : autoDownloadList) {
ContentDto contentDto = contentDao.getContent(contentId); ContentDto contentDto = contentDao.getContent(contentId);
if ((isAutoDownload || contentDto.isLinkType()) && contentDto.isDownloadable(true)) { if (contentDto.isLinkType() && contentDto.isDownloadable(true)) {
reserveDownload(contentId, false); reserveDownload(contentId, false);
targetCount++; targetCount++;
} }
...@@ -699,14 +691,9 @@ public class ContentDownloader { ...@@ -699,14 +691,9 @@ public class ContentDownloader {
private GetContentParameters getContentParameter(ContentDto contentDto) { private GetContentParameters getContentParameter(ContentDto contentDto) {
GetContentParameters param; GetContentParameters param;
if (contentDto.payFlg) { if (contentDto.payFlg) {
if (AbstractLogic.getLogic(ContentLogic.class).isAllSubscribed(contentDto)) { // 定期購読対象の場合 // 単品の場合// purchaseTokenがない場合にdummy文字を入れて
param = new GetContentParameters(contentDto.contentId, cache.getMemberInfo().sid, ContentZipType.ContentDownload, ContentDownloader.getInstance().account);
}
else { // 単品の場合// purchaseTokenがない場合にdummy文字を入れて
param = new GetContentParameters(contentDto.contentId, cache.getMemberInfo().sid, ContentZipType.ContentDownload, contentDto.productId, StringUtil.isNullOrEmpty(contentDto.purchaseToken)? "dummy": contentDto.purchaseToken); param = new GetContentParameters(contentDto.contentId, cache.getMemberInfo().sid, ContentZipType.ContentDownload, contentDto.productId, StringUtil.isNullOrEmpty(contentDto.purchaseToken)? "dummy": contentDto.purchaseToken);
} } else {
}
else {
param = new GetContentParameters(contentDto.contentId, cache.getMemberInfo().sid, ContentZipType.ContentDownload); param = new GetContentParameters(contentDto.contentId, cache.getMemberInfo().sid, ContentZipType.ContentDownload);
} }
if (contentDto.payFlg) { if (contentDto.payFlg) {
......
...@@ -10,11 +10,9 @@ import jp.agentec.abook.abv.bl.acms.client.AcmsClient; ...@@ -10,11 +10,9 @@ import jp.agentec.abook.abv.bl.acms.client.AcmsClient;
import jp.agentec.abook.abv.bl.acms.client.json.ContentVersionsJSON; import jp.agentec.abook.abv.bl.acms.client.json.ContentVersionsJSON;
import jp.agentec.abook.abv.bl.acms.client.parameters.ContentDownloadLogParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.ContentDownloadLogParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.FetchDateParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.FetchDateParameters;
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.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.exception.ABVException; 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.ABVExceptionCode;
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.exception.NetworkDisconnectedException;
import jp.agentec.abook.abv.bl.common.log.Logger; import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.common.nw.NetworkAdapter; import jp.agentec.abook.abv.bl.common.nw.NetworkAdapter;
...@@ -24,7 +22,6 @@ import jp.agentec.abook.abv.bl.data.dao.AcmsDao; ...@@ -24,7 +22,6 @@ import jp.agentec.abook.abv.bl.data.dao.AcmsDao;
import jp.agentec.abook.abv.bl.data.dao.ContentDao; import jp.agentec.abook.abv.bl.data.dao.ContentDao;
import jp.agentec.abook.abv.bl.dto.ContentDto; import jp.agentec.abook.abv.bl.dto.ContentDto;
import jp.agentec.abook.abv.bl.dto.EnqueteDto; import jp.agentec.abook.abv.bl.dto.EnqueteDto;
import jp.agentec.abook.abv.bl.dto.ServiceOptionDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic; import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.CategoryLogic; import jp.agentec.abook.abv.bl.logic.CategoryLogic;
import jp.agentec.abook.abv.bl.logic.ContentLogic; import jp.agentec.abook.abv.bl.logic.ContentLogic;
...@@ -33,10 +30,8 @@ import jp.agentec.abook.abv.bl.logic.ContractLogic; ...@@ -33,10 +30,8 @@ import jp.agentec.abook.abv.bl.logic.ContractLogic;
import jp.agentec.abook.abv.bl.logic.EnqueteLogic; import jp.agentec.abook.abv.bl.logic.EnqueteLogic;
import jp.agentec.abook.abv.bl.logic.GroupLogic; import jp.agentec.abook.abv.bl.logic.GroupLogic;
import jp.agentec.abook.abv.bl.logic.ProjectLogic; import jp.agentec.abook.abv.bl.logic.ProjectLogic;
import jp.agentec.abook.abv.bl.logic.SubscriptionHistoryLogic;
import jp.agentec.adf.util.CollectionUtil; import jp.agentec.adf.util.CollectionUtil;
import jp.agentec.adf.util.DateTimeUtil; import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.DateTimeUtil.DateUnit;
/** /**
* 新着更新を扱うクラス * 新着更新を扱うクラス
...@@ -67,7 +62,6 @@ public class ContentRefresher { ...@@ -67,7 +62,6 @@ public class ContentRefresher {
private boolean initializingRefreshing = false; private boolean initializingRefreshing = false;
private static final int refreshSleepInterval = 500; private static final int refreshSleepInterval = 500;
private static final int maxRefreshWorker = 2; private static final int maxRefreshWorker = 2;
private Date lastRefresh; // 前回更新日時(終了日時)
public static ContentRefresher getInstance() { public static ContentRefresher getInstance() {
if (instance == null) { if (instance == null) {
...@@ -159,8 +153,7 @@ public class ContentRefresher { ...@@ -159,8 +153,7 @@ public class ContentRefresher {
List<ContentDto> localContents = contentDao.getAllContents(); List<ContentDto> localContents = contentDao.getAllContents();
if (networkAdapter.isNetworkConnected()) { // オンライン時の処理 if (networkAdapter.isNetworkConnected()) { // オンライン時の処理
resendLog(); // ログ送信 resendLog(); // ログ送信
doWithServiceOption(); // サービスオプション関連処理 contractLogic.initializeContractServiceOption(); // サービスオプション関連処理
configureAutoDownload(); // 自動DLの設定を反映する(有効⇒無効、無効⇒有効(かつデフォルトオン))
groupLogic.initializeGroups(); // グループ設定(グループ変更の場合、FetchDateをクリアする) groupLogic.initializeGroups(); // グループ設定(グループ変更の場合、FetchDateをクリアする)
categoryLogic.initializeCategories(); // カテゴリ設定 categoryLogic.initializeCategories(); // カテゴリ設定
...@@ -184,8 +177,6 @@ public class ContentRefresher { ...@@ -184,8 +177,6 @@ public class ContentRefresher {
Logger.e("refreshContent failed.", e); Logger.e("refreshContent failed.", e);
updateRefreshContentListState(-1L, e); updateRefreshContentListState(-1L, e);
} }
lastRefresh = new Date(); // 前回更新日時
contentDownloader.kickTask(); contentDownloader.kickTask();
Logger.i(TAG, "refresh main thread end.-----------------------------------------------"); Logger.i(TAG, "refresh main thread end.-----------------------------------------------");
} }
...@@ -321,11 +312,11 @@ public class ContentRefresher { ...@@ -321,11 +312,11 @@ public class ContentRefresher {
ContentDto localDto = localContents.get(localContentIndex); ContentDto localDto = localContents.get(localContentIndex);
if (!serverContentDto.equalsVersion(localDto)) { // 更新 ContentInfo.zipをダウンロードする。 if (!serverContentDto.equalsVersion(localDto)) { // 更新 ContentInfo.zipをダウンロードする。
contentDownloader.downloadContentInfo(serverContentDto.contentId); contentDownloader.downloadContentInfo(serverContentDto.contentId);
if ((contentDownloader.isAutoDownload() || serverContentDto.isLinkType()) && localDto.isDownloadable(true)) { if (serverContentDto.isLinkType() && localDto.isDownloadable(true)) {
contentDownloader.addAutoDownload(serverContentDto.contentId); contentDownloader.addAutoDownload(serverContentDto.contentId);
} }
} }
else if (!localDto.downloadedFlg && (contentDownloader.isAutoDownload() || serverContentDto.isLinkType()) && localDto.isDownloadable(true)) { // ダウンロード未完了も追加 else if (!localDto.downloadedFlg && serverContentDto.isLinkType() && localDto.isDownloadable(true)) { // ダウンロード未完了も追加
contentDownloader.addAutoDownload(serverContentDto.contentId); contentDownloader.addAutoDownload(serverContentDto.contentId);
} }
...@@ -333,37 +324,14 @@ public class ContentRefresher { ...@@ -333,37 +324,14 @@ public class ContentRefresher {
} else { } else {
// 新規 ContentInfo.zipをダウンロードする。 // 新規 ContentInfo.zipをダウンロードする。
contentDownloader.downloadContentInfo(serverContentDto.contentId); contentDownloader.downloadContentInfo(serverContentDto.contentId);
if ((contentDownloader.isAutoDownload() || serverContentDto.isLinkType()) && serverContentDto.isDownloadable(true)) { if (serverContentDto.isLinkType() && serverContentDto.isDownloadable(true)) {
contentDownloader.addAutoDownload(serverContentDto.contentId); contentDownloader.addAutoDownload(serverContentDto.contentId);
} }
} }
} }
} }
return true; return true;
} }
private void configureAutoDownload() {
if (contentDownloader.isAutoDownload() && !cache.serviceOption.isAutoDownloadOptionEnable()) {
contentDownloader.setAutoDownload(false);
}
else if (!contentDownloader.isAutoDownload()) {
ServiceOptionDto autoDlOptionDto = ABVDataCache.getInstance().getServiceOption(ServiceOptionId.AutoDownload);
if (autoDlOptionDto != null && autoDlOptionDto.val.equals("2")) {
contentDownloader.setAutoDownload(true);
}
}
}
private void doWithServiceOption() throws NetworkDisconnectedException, AcmsException {
// サービスオプションの初期化
contractLogic.initializeContractServiceOption();
// 定期購読期間更新(決済ありの場合)
if (ABVDataCache.getInstance().serviceOption.isPayment() && ABVDataCache.getInstance().serviceOption.isAutoSubscriptionAll()) {
AbstractLogic.getLogic(SubscriptionHistoryLogic.class).refreshSubscription(contentDownloader.account);
}
}
} }
public void updateRefreshContentListState(long contentId, Exception e) { public void updateRefreshContentListState(long contentId, Exception e) {
...@@ -378,7 +346,7 @@ public class ContentRefresher { ...@@ -378,7 +346,7 @@ public class ContentRefresher {
// 新着処理が終わったら以下の処理が実行 // 新着処理が終わったら以下の処理が実行
try { try {
// サーバー通信でプロジェクト取得 // サーバー通信でプロジェクト取得
AbstractLogic.getLogic(ProjectLogic.class).initializeProjects(); projectLogic.initializeProjects();
} catch (Exception e1) { } catch (Exception e1) {
Logger.e(TAG, e1); Logger.e(TAG, e1);
e = e1; e = e1;
...@@ -388,29 +356,6 @@ public class ContentRefresher { ...@@ -388,29 +356,6 @@ public class ContentRefresher {
} }
} }
/**
* 前回更新日時を返す
*
* @return
*/
public Date getLastRefresh() {
return lastRefresh;
}
/**
* 前回更新日時からinterval日時経過したか
*
* @param interval
* @return
*/
public boolean isRefreshDateAfter(int interval) {
Logger.v(TAG, "isRefreshDateAfter=%s %s", interval, lastRefresh);
if (lastRefresh == null) { // 記録がないときは経過したとみなす
return true;
}
return new Date().after(DateTimeUtil.add(lastRefresh, DateUnit.Minute, interval));
}
public void stopRefresh() { public void stopRefresh() {
if (isRefreshing() && refreshWorker != null) { if (isRefreshing() && refreshWorker != null) {
refreshWorker.stopWorker(); refreshWorker.stopWorker();
......
package jp.agentec.abook.abv.bl.dto;
import java.util.Date;
public class ContentCustomLogDto extends AbstractDto {
public int content_custom_log_id;
public int readingLogId;
public Date actionDate;
public long contentId;
public String param1;
public String param2;
public String param3;
public String param4;
public String param5;
@Override
public Object[] getInsertValues() {
return new Object[]{content_custom_log_id, readingLogId, actionDate, contentId, param1,param2, param3, param4, param5};
}
@Override
public Object[] getUpdateValues() {
return new Object[]{readingLogId, actionDate, contentId,param1,param2, param3, param4, param5, content_custom_log_id};
}
@Override
public String[] getKeyValues() {
return new String[]{""+ content_custom_log_id};
}
}
...@@ -45,7 +45,6 @@ public class ContentDto extends AbstractDto implements Serializable { ...@@ -45,7 +45,6 @@ public class ContentDto extends AbstractDto implements Serializable {
public Date lastDeliveryDate; public Date lastDeliveryDate;
public int alertMessageLevel; public int alertMessageLevel;
public String alertMessage; public String alertMessage;
public boolean pdfSendMailFlg;
public boolean printFlg; public boolean printFlg;
public boolean hideFlg; public boolean hideFlg;
public String shareUrl; public String shareUrl;
...@@ -100,12 +99,12 @@ public class ContentDto extends AbstractDto implements Serializable { ...@@ -100,12 +99,12 @@ public class ContentDto extends AbstractDto implements Serializable {
@Override @Override
public Object[] getInsertValues() { public Object[] getInsertValues() {
return new Object[]{contentId, contentName, contentNameKana, contentDetail, allPageNum, orientation, updatedFlg, downloadedFlg, downloadingFlg, metaVersion, resourceVersion, deliveryStartDate, deliveryEndDate, favoriteFlg, contentProtectedFlg, thumbnailNormalPath, thumbnailBigPath, pagePath, resourcePath, contentGroups, newFlg, contractContentId, readingDate, lastViewedPage, contentSize, readingCount, contentType, lastDeliveryDate, alertMessageLevel, alertMessage, pdfSendMailFlg, printFlg, hideFlg, shareUrl, readerShareFlg, disableAutoDl, payFlg, productId, deliveryType, signage, disableSwipe, signageDisableDl, isUnAuthorizedContent, commonContentFlg}; return new Object[]{contentId, contentName, contentNameKana, contentDetail, allPageNum, orientation, updatedFlg, downloadedFlg, downloadingFlg, metaVersion, resourceVersion, deliveryStartDate, deliveryEndDate, favoriteFlg, contentProtectedFlg, thumbnailNormalPath, thumbnailBigPath, pagePath, resourcePath, contentGroups, newFlg, contractContentId, readingDate, lastViewedPage, contentSize, readingCount, contentType, lastDeliveryDate, alertMessageLevel, alertMessage, printFlg, hideFlg, shareUrl, readerShareFlg, disableAutoDl, payFlg, productId, deliveryType, signage, disableSwipe, signageDisableDl, isUnAuthorizedContent, commonContentFlg};
} }
@Override @Override
public Object[] getUpdateValues() { public Object[] getUpdateValues() {
return new Object[]{contentName, contentNameKana, contentDetail, allPageNum, orientation, updatedFlg, downloadedFlg, downloadingFlg, metaVersion, resourceVersion, deliveryStartDate, deliveryEndDate, favoriteFlg, contentProtectedFlg, thumbnailNormalPath, thumbnailBigPath, pagePath, resourcePath, contentGroups, newFlg, contractContentId, readingDate, lastViewedPage, contentSize, readingCount, contentType, lastDeliveryDate, alertMessageLevel, alertMessage, pdfSendMailFlg, printFlg, hideFlg, shareUrl, readerShareFlg, disableAutoDl, payFlg, productId, deliveryType, signage, disableSwipe, downloadStartDate, status, signageDisableDl, commonContentFlg, contentId}; return new Object[]{contentName, contentNameKana, contentDetail, allPageNum, orientation, updatedFlg, downloadedFlg, downloadingFlg, metaVersion, resourceVersion, deliveryStartDate, deliveryEndDate, favoriteFlg, contentProtectedFlg, thumbnailNormalPath, thumbnailBigPath, pagePath, resourcePath, contentGroups, newFlg, contractContentId, readingDate, lastViewedPage, contentSize, readingCount, contentType, lastDeliveryDate, alertMessageLevel, alertMessage, printFlg, hideFlg, shareUrl, readerShareFlg, disableAutoDl, payFlg, productId, deliveryType, signage, disableSwipe, downloadStartDate, status, signageDisableDl, commonContentFlg, contentId};
} }
public ContentDto() { public ContentDto() {
......
package jp.agentec.abook.abv.bl.logic;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
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.ContentCustomLogDao;
import jp.agentec.abook.abv.bl.dto.ContentCustomLogDto;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
import org.json.adf.JSONArray;
import org.json.adf.JSONObject;
public class ContentCustomLogLogic extends AbstractLogic {
//private static final String TAG = "ContentCustomLogLogic";
private ContentCustomLogDao contentCustomLogDao = AbstractDao.getDao(ContentCustomLogDao.class);
/**
*
* @param contentId
* @param readingLogId
*/
public void insertContentCustomLog(long contentId, int readingLogId, Date actionDate, String param1, String param2, String param3, String param4, String param5) {
//カスタマイズログ利用の許可を得た場合のみカスタマイズログ情報を保存
if (ABVDataCache.getInstance().serviceOption.doUseCustomLog()) {
ContentCustomLogDto dto = new ContentCustomLogDto();
dto.contentId = contentId;
dto.readingLogId = readingLogId;
dto.actionDate = actionDate;
dto.param1 = param1;
dto.param2 = param2;
dto.param3 = param3;
dto.param4 = param4;
dto.param5 = param5;
contentCustomLogDao.insertContentCustomLog(dto);
}
}
public void deleteContentCustomLog(long contentId, int readingLogId) {
contentCustomLogDao.deleteContentCustomLog(contentId, readingLogId);
}
public JSONObject getContentCustomLogJson(long contentId, int readingLogId) {
JSONObject json = null;
List<ContentCustomLogDto> listDto = contentCustomLogDao.getContentCustomLogs(contentId, readingLogId);
if (listDto != null && !listDto.isEmpty()) {
json = new JSONObject();
//csvのheader部
JSONArray headerArr = new JSONArray();
headerArr.put("actionDate");
headerArr.put("param1");
headerArr.put("param2");
headerArr.put("param3");
headerArr.put("param4");
headerArr.put("param5");
json.put("header", headerArr);
JSONArray linesRootArr = new JSONArray();
//csvのbody部
for (ContentCustomLogDto contentCustomLogDto : listDto) {
JSONArray lineArr = new JSONArray();
Timestamp actionDate = new Timestamp(contentCustomLogDto.actionDate.getTime());
lineArr.put(DateTimeUtil.toStringInTimeZone(actionDate, DateTimeFormat.yyyyMMddHHmmss_hyphen,"GMT") + ",GMT");
lineArr.put(contentCustomLogDto.param1);
lineArr.put(contentCustomLogDto.param2);
lineArr.put(contentCustomLogDto.param3);
lineArr.put(contentCustomLogDto.param4);
lineArr.put(contentCustomLogDto.param5);
linesRootArr.put(lineArr);
}
json.put("lines", linesRootArr);
}
return json;
}
}
...@@ -26,7 +26,6 @@ import jp.agentec.abook.abv.bl.data.dao.ContentMarkingDao; ...@@ -26,7 +26,6 @@ import jp.agentec.abook.abv.bl.data.dao.ContentMarkingDao;
import jp.agentec.abook.abv.bl.data.dao.ContentPageDao; import jp.agentec.abook.abv.bl.data.dao.ContentPageDao;
import jp.agentec.abook.abv.bl.data.dao.ContentResourceDao; import jp.agentec.abook.abv.bl.data.dao.ContentResourceDao;
import jp.agentec.abook.abv.bl.data.dao.ContentTagDao; import jp.agentec.abook.abv.bl.data.dao.ContentTagDao;
import jp.agentec.abook.abv.bl.data.dao.SubscriptionHistoryDao;
import jp.agentec.abook.abv.bl.dto.ContentDto; import jp.agentec.abook.abv.bl.dto.ContentDto;
import jp.agentec.abook.abv.bl.dto.ContentPageDto; import jp.agentec.abook.abv.bl.dto.ContentPageDto;
import jp.agentec.abook.abv.bl.dto.ContentTagDto; import jp.agentec.abook.abv.bl.dto.ContentTagDto;
...@@ -176,7 +175,6 @@ public class ContentLogic extends AbstractLogic { ...@@ -176,7 +175,6 @@ public class ContentLogic extends AbstractLogic {
dto.contentSize = json.contentSize; dto.contentSize = json.contentSize;
dto.alertMessageLevel = json.alertMessageLevel; dto.alertMessageLevel = json.alertMessageLevel;
dto.alertMessage = json.alertMessage; dto.alertMessage = json.alertMessage;
dto.pdfSendMailFlg = json.pdfSendMailFlg;
dto.printFlg = json.printFlg; dto.printFlg = json.printFlg;
dto.hideFlg = json.hideFlg; dto.hideFlg = json.hideFlg;
dto.shareUrl = json.shareUrl; dto.shareUrl = json.shareUrl;
...@@ -521,39 +519,4 @@ public class ContentLogic extends AbstractLogic { ...@@ -521,39 +519,4 @@ public class ContentLogic extends AbstractLogic {
} }
return new ContentJSON(text); return new ContentJSON(text);
} }
public boolean isAllSubscribed(ContentDto contentDto) {
return isAllSubscribed(AbstractDao.getDao(SubscriptionHistoryDao.class).getAllValidList(), contentDto);
}
/**
* 定期購読購入済みでその期間に含まれるか
*
* @param subscribeAllValidList
* @param contentDto
* @return
*/
public boolean isAllSubscribed(List<SubscriptionHistoryDto> subscribeAllValidList, ContentDto contentDto) {
if (subscribeAllValidList == null) {
return false;
}
for (SubscriptionHistoryDto subscriptionHistoryDto : subscribeAllValidList) {
Logger.v(TAG, "isAllSubscribed productId=%s, delFlg=%s, startTimeMillis=%s expiryTimeMillis=%s deliveryStartDate=%s", subscriptionHistoryDto.productId, subscriptionHistoryDto.delFlg, subscriptionHistoryDto.startTimeMillis, subscriptionHistoryDto.expiryTimeMillis, contentDto.deliveryStartDate.getTime());
// delFlg=2は新規購入不可扱いで過去の購入履歴としてはOKとする(テスト用途)
if (subscriptionHistoryDto.startTimeMillis != null && subscriptionHistoryDto.expiryTimeMillis != null) {
if (subscriptionHistoryDto.startTimeMillis < contentDto.deliveryStartDate.getTime() && contentDto.deliveryStartDate.getTime() < subscriptionHistoryDto.expiryTimeMillis) {
return true;
}
else {
// kpcのルールだと購入日の直近の公開日のコンテンツから購入可能というルール。
ContentDto nearestContent = contentDao.findNearest(subscriptionHistoryDto.startTimeMillis);
if (nearestContent != null && nearestContent.contentId == contentDto.contentId) {
Logger.d("You can dowlnload nearest content. contentId=" + nearestContent.contentId);
return true;
}
}
}
}
return false;
}
} }
...@@ -26,7 +26,6 @@ public class ContentReadingLogLogic extends AbstractLogic { ...@@ -26,7 +26,6 @@ public class ContentReadingLogLogic extends AbstractLogic {
private ContentPageReadingLogLogic contentPageReadingLogLogic = AbstractLogic.getLogic(ContentPageReadingLogLogic.class); private ContentPageReadingLogLogic contentPageReadingLogLogic = AbstractLogic.getLogic(ContentPageReadingLogLogic.class);
private ContentObjectLogDao contentObjectLogDao = AbstractDao.getDao(ContentObjectLogDao.class); private ContentObjectLogDao contentObjectLogDao = AbstractDao.getDao(ContentObjectLogDao.class);
private ContentObjectLogLogic contentObjectLogLogic = AbstractLogic.getLogic(ContentObjectLogLogic.class); private ContentObjectLogLogic contentObjectLogLogic = AbstractLogic.getLogic(ContentObjectLogLogic.class);
private ContentCustomLogLogic contentCustomLogLogic = AbstractLogic.getLogic(ContentCustomLogLogic.class);
/*package*/ ContentReadingLogLogic() { /*package*/ ContentReadingLogLogic() {
} }
...@@ -155,8 +154,7 @@ public class ContentReadingLogLogic extends AbstractLogic { ...@@ -155,8 +154,7 @@ public class ContentReadingLogLogic extends AbstractLogic {
logDto.longitude, logDto.longitude,
logDto.mode, logDto.mode,
contentPageReadingLogLogic.getContentPageReadLogJson(logDto.contentId, logDto.readingLogId), contentPageReadingLogLogic.getContentPageReadLogJson(logDto.contentId, logDto.readingLogId),
contentObjectLogLogic.getContentObjectLogJson(logDto.contentId, logDto.readingLogId), contentObjectLogLogic.getContentObjectLogJson(logDto.contentId, logDto.readingLogId));
contentCustomLogLogic.getContentCustomLogJson(logDto.contentId, logDto.readingLogId));
boolean sendResult; boolean sendResult;
try { try {
sendResult = acms.contentReadingLog(logParam); sendResult = acms.contentReadingLog(logParam);
...@@ -169,7 +167,6 @@ public class ContentReadingLogLogic extends AbstractLogic { ...@@ -169,7 +167,6 @@ public class ContentReadingLogLogic extends AbstractLogic {
// 送信完了したログは全て削除 // 送信完了したログは全て削除
contentPageReadingLogDao.deleteContentPageReadingLog(logDto.contentId, logDto.readingLogId); contentPageReadingLogDao.deleteContentPageReadingLog(logDto.contentId, logDto.readingLogId);
contentObjectLogDao.deleteContentObjectLog(logDto.contentId, logDto.readingLogId); contentObjectLogDao.deleteContentObjectLog(logDto.contentId, logDto.readingLogId);
contentCustomLogLogic.deleteContentCustomLog(logDto.contentId, logDto.readingLogId);
boolean result = contentReadingLogDao.deleteContentReadingLog(logDto); boolean result = contentReadingLogDao.deleteContentReadingLog(logDto);
if (result) { if (result) {
Logger.i(TAG, "sent ContentReadingLog:%s", logDto.contentId); Logger.i(TAG, "sent ContentReadingLog:%s", logDto.contentId);
......
...@@ -222,23 +222,6 @@ public class ContractLogic extends AbstractLogic { ...@@ -222,23 +222,6 @@ public class ContractLogic extends AbstractLogic {
} }
/** /**
* ダッシュボードを使用するかを示します。
* @return マーキング機能する場合、trueを返します。
* @throws Exception
* @since 1.0.0
*/
public boolean getUsableDashboard() {
boolean result = false;
ServiceOptionDto dto = getServiceOptionFromId(ServiceOptionId.UsableDashboard);
if (dto != null) {
result = ContractLogic.getBooleanValue(dto.val);
}
return result;
}
/**
* 閲覧ログGPS使用可を示します。 * 閲覧ログGPS使用可を示します。
* @return 閲覧ログGPS使用可の場合、trueを返します。 * @return 閲覧ログGPS使用可の場合、trueを返します。
* @since 1.0.0 * @since 1.0.0
...@@ -270,34 +253,6 @@ public class ContractLogic extends AbstractLogic { ...@@ -270,34 +253,6 @@ public class ContractLogic extends AbstractLogic {
return result; return result;
} }
/**
* 백업/복원 사업자옵션 여부 확인
* @return 사용가능하면 true 반환
* @throws Exception
* @since 1.0.0
*/
public boolean getBackup() {
boolean result = false;
ServiceOptionDto dto = getServiceOptionFromId(ServiceOptionId.Backup);
if (dto != null) {
result = getBooleanValue(dto.val);
}
return result;
}
public boolean getPdfSendMail() {
boolean result = false;
ServiceOptionDto dto = getServiceOptionFromId(ServiceOptionId.PdfSendMail);
if (dto != null) {
result = getBooleanValue(dto.val);
}
return result;
}
public boolean getPdfLinkDisp() { public boolean getPdfLinkDisp() {
boolean result = false; boolean result = false;
ServiceOptionDto dto = getServiceOptionFromId(ServiceOptionId.PdfLinkDisp); ServiceOptionDto dto = getServiceOptionFromId(ServiceOptionId.PdfLinkDisp);
...@@ -338,21 +293,6 @@ public class ContractLogic extends AbstractLogic { ...@@ -338,21 +293,6 @@ public class ContractLogic extends AbstractLogic {
} }
/** /**
* コンテンツ共有に関するオプション
* @return 0:共有しない、1:ABook+Type 2:ABook ReaderType(複数CMS環境)
*/
public int getContentShareType() {
int result = 0;
ServiceOptionDto dto = getServiceOptionFromId(ServiceOptionId.ContentShare);
if (dto != null) {
result = Integer.valueOf(dto.val);
}
return result;
}
/**
* 契約事業者のサービスオプションを返します。 * 契約事業者のサービスオプションを返します。
* @param serviceOptionId 取得するサービスオプションのサービスオプションIDです。 * @param serviceOptionId 取得するサービスオプションのサービスオプションIDです。
* @return 指定したサービスオプションIDにあたる情報があると {@link ServiceOptionDto} オブジェクトを返します。存在しないとnullを返します。 * @return 指定したサービスオプションIDにあたる情報があると {@link ServiceOptionDto} オブジェクトを返します。存在しないとnullを返します。
......
...@@ -17,10 +17,10 @@ import java.util.Map; ...@@ -17,10 +17,10 @@ import java.util.Map;
import java.util.UUID; import java.util.UUID;
import jp.agentec.abook.abv.bl.acms.client.AcmsClient; import jp.agentec.abook.abv.bl.acms.client.AcmsClient;
import jp.agentec.abook.abv.bl.acms.client.json.check.ProjectDataJSON; import jp.agentec.abook.abv.bl.acms.client.json.ProjectDataJSON;
import jp.agentec.abook.abv.bl.acms.client.json.check.ProjectListJSON; import jp.agentec.abook.abv.bl.acms.client.json.ProjectListJSON;
import jp.agentec.abook.abv.bl.acms.client.json.check.SceneEntryJSON; import jp.agentec.abook.abv.bl.acms.client.json.SceneEntryJSON;
import jp.agentec.abook.abv.bl.acms.client.json.check.WorkerGroupJSON; import jp.agentec.abook.abv.bl.acms.client.json.WorkerGroupJSON;
import jp.agentec.abook.abv.bl.acms.client.parameters.AcmsParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.AcmsParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.GetTaskFileParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.GetTaskFileParameters;
import jp.agentec.abook.abv.bl.acms.type.ProjectAuthLevel; import jp.agentec.abook.abv.bl.acms.type.ProjectAuthLevel;
......
...@@ -5,7 +5,7 @@ import java.util.List; ...@@ -5,7 +5,7 @@ import java.util.List;
import jp.agentec.abook.abv.bl.acms.client.AcmsClient; import jp.agentec.abook.abv.bl.acms.client.AcmsClient;
import jp.agentec.abook.abv.bl.acms.client.json.AcmsMessageJSON; import jp.agentec.abook.abv.bl.acms.client.json.AcmsMessageJSON;
import jp.agentec.abook.abv.bl.acms.client.json.check.FixPushMessageJSON; import jp.agentec.abook.abv.bl.acms.client.json.FixPushMessageJSON;
import jp.agentec.abook.abv.bl.acms.client.parameters.SendPushMessageParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.SendPushMessageParameters;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys; import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.exception.AcmsException; import jp.agentec.abook.abv.bl.common.exception.AcmsException;
......
package jp.agentec.abook.abv.bl.logic;
import java.util.List;
import jp.agentec.abook.abv.bl.acms.client.AcmsClient;
import jp.agentec.abook.abv.bl.acms.client.parameters.SubscriptionHistoryParameters;
import jp.agentec.abook.abv.bl.acms.client.parameters.SubscriptionHistorySendParameters;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
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;
import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
import jp.agentec.abook.abv.bl.data.dao.SubscriptionHistoryDao;
import jp.agentec.abook.abv.bl.download.ContentDownloader;
import jp.agentec.abook.abv.bl.dto.SubscriptionDto;
import jp.agentec.abook.abv.bl.dto.SubscriptionHistoryDto;
import jp.agentec.abook.abv.bl.dto.SubscriptionDto.Period;
import jp.agentec.adf.util.StringUtil;
public class SubscriptionHistoryLogic extends AbstractLogic {
private static final String TAG = "SubscriptionHistoryLogic";
private SubscriptionHistoryDao subscriptionHistoryDao = AbstractDao.getDao(SubscriptionHistoryDao.class);
public void restoreSubscriptionHistory(String account) throws AcmsException, NetworkDisconnectedException {
SubscriptionHistoryParameters subscriptionHistoryParameters = new SubscriptionHistoryParameters(cache.getMemberInfo().sid, account);
AcmsClient acmsClient = AcmsClient.getInstance(cache.getUrlPath(), networkAdapter);
List<SubscriptionHistoryDto> list = acmsClient.getSubscriptionHistory(subscriptionHistoryParameters).dtoList;
if (list != null) {
for (SubscriptionHistoryDto subscriptionHistoryDto : list) {
Logger.d(TAG, "restore parchaseToke=%s", subscriptionHistoryDto.purchaseToken);
subscriptionHistoryDao.insertOrUpdate(subscriptionHistoryDto);
}
}
}
/**
* @throws NetworkDisconnectedException
* @throws AcmsException
*
*/
public void sendHistory() throws AcmsException, NetworkDisconnectedException {
List<SubscriptionHistoryDto> list = subscriptionHistoryDao.getUnsentList();
for (SubscriptionHistoryDto subscriptionHistoryDto : list) {
AcmsClient acmsClient = AcmsClient.getInstance(cache.getUrlPath(), networkAdapter);
SubscriptionHistorySendParameters subParam = new SubscriptionHistorySendParameters(cache.getMemberInfo().sid, ContentDownloader.getInstance().account, subscriptionHistoryDto);
acmsClient.sendHistory(subParam);
subscriptionHistoryDao.updateAsSent(subscriptionHistoryDto.subscriptionHistoryId);
}
}
/**
* 定期購読の期間をサーバから取得して更新
* および現在購入可能な定期購読をセット
* @param account
*
* @throws NetworkDisconnectedException
* @throws AcmsException
*/
public void refreshSubscription(String account) throws NetworkDisconnectedException, AcmsException {
// 先にサーバに未送信の履歴を送信する。
sendHistory();
// 履歴の取得
AcmsClient acmsClient = AcmsClient.getInstance(cache.getUrlPath(), networkAdapter);
SubscriptionHistoryParameters subParam = new SubscriptionHistoryParameters(cache.getMemberInfo().sid, account);
List<SubscriptionDto> subscriptionList = acmsClient.contentSet(subParam);
ABVEnvironment.getInstance().allSubscriptionProductId = null; // 一度リセット
long now = System.currentTimeMillis();
for (SubscriptionDto subscriptionDto : subscriptionList) {
// 定期購読期間を更新
AbstractDao.getDao(SubscriptionHistoryDao.class).update(subscriptionDto);
// 購入可能な定期購読のproductIdをセット(最初に有効なもの)
if (ABVEnvironment.getInstance().allSubscriptionProductId == null && subscriptionDto.delFlg == 0 && !StringUtil.isNullOrEmpty(subscriptionDto.productId)) {
boolean currentValid = false;
if (subscriptionDto.historyList != null) {
for (Period period : subscriptionDto.historyList) {
if (period.end > now) { // 購入済みで現在も有効なものは、現在は購入不可
currentValid = true;
break;
}
}
}
if (!currentValid) {
ABVEnvironment.getInstance().allSubscriptionProductId = subscriptionDto.productId;
}
}
}
}
}
...@@ -5,7 +5,7 @@ import java.util.Locale; ...@@ -5,7 +5,7 @@ import java.util.Locale;
import org.json.adf.JSONObject; import org.json.adf.JSONObject;
import jp.agentec.abook.abv.bl.acms.client.AcmsClient; import jp.agentec.abook.abv.bl.acms.client.AcmsClient;
import jp.agentec.abook.abv.bl.acms.client.json.reader.CmsUrlJSON; import jp.agentec.abook.abv.bl.acms.client.json.CmsUrlJSON;
import jp.agentec.abook.abv.bl.common.ABVEnvironment; import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.Constant.ReaderConstant; import jp.agentec.abook.abv.bl.common.Constant.ReaderConstant;
import jp.agentec.abook.abv.bl.common.exception.ABVExceptionCode; import jp.agentec.abook.abv.bl.common.exception.ABVExceptionCode;
......
...@@ -29,7 +29,6 @@ import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException; ...@@ -29,7 +29,6 @@ import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException;
import jp.agentec.abook.abv.bl.common.nw.PCNetworkAdapter; import jp.agentec.abook.abv.bl.common.nw.PCNetworkAdapter;
import jp.agentec.abook.abv.bl.data.DBConnector; import jp.agentec.abook.abv.bl.data.DBConnector;
import jp.agentec.abook.abv.bl.data.dao.AbstractDao; import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
import jp.agentec.abook.abv.bl.data.dao.SubscriptionHistoryDao;
import jp.agentec.abook.abv.bl.dto.MemberInfoDto; import jp.agentec.abook.abv.bl.dto.MemberInfoDto;
import jp.agentec.abook.abv.bl.dto.SubscriptionDto; import jp.agentec.abook.abv.bl.dto.SubscriptionDto;
import jp.agentec.abook.abv.bl.dto.SubscriptionHistoryDto; import jp.agentec.abook.abv.bl.dto.SubscriptionHistoryDto;
......
...@@ -114,7 +114,6 @@ public class ContentDaoTest extends TestCase { ...@@ -114,7 +114,6 @@ public class ContentDaoTest extends TestCase {
dto.pagePath = "/data/data/jp.agentec.abook.abv.launcher.android/files/ABook/contents/1062/detail"; dto.pagePath = "/data/data/jp.agentec.abook.abv.launcher.android/files/ABook/contents/1062/detail";
List<ContentPageDto>list = null; List<ContentPageDto>list = null;
dto.pages = list; dto.pages = list;
dto.pdfSendMailFlg = false;
dto.printFlg = false; dto.printFlg = false;
dto.readingCount =10; dto.readingCount =10;
dto.readingDate = DateTimeUtil.toDate(time, DateTimeFormat.yyyyMMddHHmmss_hyphen); dto.readingDate = DateTimeUtil.toDate(time, DateTimeFormat.yyyyMMddHHmmss_hyphen);
......
package jp.agentec.abook.abv.bl.data.dao;
import java.util.Date;
import java.util.List;
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.ContractDto;
import junit.framework.TestCase;
import junit.framework.TestSuite;
public class ContractDaoTest extends TestCase {
ContractDao contractDao = AbstractDao.getDao(ContractDao.class);
public ContractDaoTest(String string) {
super(string);
}
@Override
protected void setUp() throws Exception {
ABVEnvironment.getInstance().isReader = true;
super.setUp();
DBConnector conn = DBConnector.getInstance();
SQLiteOpenHelper sqlLiteOpenHelper = new JDBCSQLiteOpenHelper("test.db", 0);
conn.setSqlLiteOpenHelper(sqlLiteOpenHelper);
((JDBCSQLiteOpenHelper)sqlLiteOpenHelper).onCreate(conn.getDatabase());
}
@Override
protected void tearDown() throws Exception {
super.tearDown();
}
public static TestSuite suite() {
TestSuite suite = new TestSuite("ContractDaoTest");
// suite.addTest(new ContractDaoTest("testInsert"));
// suite.addTest(new ContractDaoTest("testUpdate"));
// suite.addTest(new ContractDaoTest("testLastUpdate"));
// suite.addTest(new ContractDaoTest("testExists"));
// suite.addTest(new ContractDaoTest("testInsertOrUpdate"));
// suite.addTest(new ContractDaoTest("testUndeliverableDelete"));
// suite.addTest(new ContractDaoTest("testGetListByUsablePushMessage"));
suite.addTest(new ContractDaoTest("testFindByContentExist"));
return suite;
}
public void testInsert() throws Exception {
ContractDto dto = new ContractDto(1, 1, "contractsss", "getnet", "Y", "N", "Y", "N", 0, new Date(), new Date(), 0 , null);
contractDao.insert(dto);
System.out.println(contractDao.getDto(1, 1).companyName);
}
public void testUpdate() throws Exception {
ContractDto dto = new ContractDto(1, 1, "contractsssU", "getnetU", "N", "Y", "N", "Y", 0, new Date(), new Date(), 1 , new Date());
contractDao.update(dto);
System.out.println(contractDao.getDto(1,1 ).companyName);
}
public void testLastUpdate() throws Exception {
System.out.println(contractDao.getLastUpdate());
}
public void testExists() throws Exception {
System.out.println(contractDao.exists(0, 1));
System.out.println(contractDao.exists(1, 1));
}
public void testInsertOrUpdate() throws Exception {
ContractDto dto = new ContractDto(1, 1, "fdsa", "get879sad7fd987frs9a87fds98fads798fds7fds798afdnet", "Y", "Y", "Y", "N", 0, new Date(), new Date(), 0 , null);
contractDao.insertOrUpdate(dto);
}
public void testUndeliverableDelete() throws Exception {
List<ContractDto> list = contractDao.getListByUndeliverableDelete();
for (ContractDto contractDto : list) {
System.out.println(contractDto.companyName);
}
}
public void testGetListByUsablePushMessage(){
List<ContractDto> list = contractDao.getListByUsablePushMessage();
for (ContractDto contractDto : list) {
System.out.println(contractDto.companyName);
}
}
public void testFindByContentExist() {
List<ContractDto> list = contractDao.findByContentExist();
for (ContractDto contractDto : list) {
System.out.println(contractDto.companyName);
}
}
}
package jp.agentec.abook.abv.bl.data.dao;
import java.util.List;
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.log.Logger;
import jp.agentec.abook.abv.bl.data.DBConnector;
import jp.agentec.abook.abv.bl.dto.FolderDto;
import junit.framework.TestCase;
import junit.framework.TestSuite;
public class FolderDaoTest extends TestCase {
private FolderDao dao = AbstractDao.getDao(FolderDao.class);
public FolderDaoTest(String string) {
super(string);
}
@Override
protected void setUp() throws Exception {
super.setUp();
DBConnector conn = DBConnector.getInstance();
SQLiteOpenHelper sqlLiteOpenHelper = new JDBCSQLiteOpenHelper("test.db", 0);
conn.setSqlLiteOpenHelper(sqlLiteOpenHelper);
((JDBCSQLiteOpenHelper) sqlLiteOpenHelper).onCreate(conn.getDatabase());
}
public static TestSuite suite() {
TestSuite suite = new TestSuite("FolderDaoTest");
suite.addTest(new FolderDaoTest("testGenerateGetFolderQuery"));
return suite;
}
@Override
protected void tearDown() throws Exception {
super.tearDown();
}
public void testGenerateGetFolderQuery() {
int[] folderId = { 0, 1 };
List<FolderDto> folderList = dao.getFolderList(folderId);
for (FolderDto folder : folderList) {
Logger.d(folder.folderName);
Logger.d(folder.contentCount + "");
Logger.d(folder.displayCount);
}
}
}
package jp.agentec.abook.abv.bl.data.dao;
import java.util.List;
import jp.agentec.abook.abv.bl.acms.type.DownloadStatusType;
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.ContentDto;
import jp.agentec.abook.abv.bl.dto.ContentPageDto;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
import junit.framework.TestCase;
import junit.framework.TestSuite;
public class InteractiveInfoDaoTest extends TestCase {
private InteractiveInfoDao dao = new InteractiveInfoDao();
private PlaylistDao playlistDao = new PlaylistDao();
private PlaylistDetailDao playlistDetailDao = new PlaylistDetailDao();
private ContentDao contentDao = new ContentDao();
public InteractiveInfoDaoTest(String string) {
super(string);
}
@Override
protected void setUp() throws Exception {
super.setUp();
ABVEnvironment.getInstance().isReader = true;
DBConnector conn = DBConnector.getInstance();
SQLiteOpenHelper sqlLiteOpenHelper = new JDBCSQLiteOpenHelper("test.db", 0);
conn.setSqlLiteOpenHelper(sqlLiteOpenHelper);
((JDBCSQLiteOpenHelper) sqlLiteOpenHelper).onCreate(conn.getDatabase());
}
public static TestSuite suite() {
TestSuite suite = new TestSuite("InteractiveInfoDaoTest");
suite.addTest(new InteractiveInfoDaoTest("testInsert"));
suite.addTest(new InteractiveInfoDaoTest("testUpdate"));
return suite;
}
@Override
protected void tearDown() throws Exception {
super.tearDown();
}
public void testInsert() {
dao.beginTransaction();
ContentDto contentDto1 = insertDummyContent(100);
ContentDto contentDto2 = insertDummyContent(1000);
PlaylistDto playListDto1 = new PlaylistDto();
int playlistId = 1;
playListDto1.playlistId = playlistId;
playListDto1.playlistName = "Playlist01";
playlistDao.insert(playListDto1);
PlaylistDetailDto playlistDetailDto1 = new PlaylistDetailDto();
playlistDetailDto1.playlistId = playlistId;
playlistDetailDto1.listOrder = 1;
playlistDetailDto1.contentId = contentDto1.contentId;
playlistDetailDto1.slide = 3;
playlistDetailDto1.stay = 5;
playlistDetailDao.insert(playlistDetailDto1);
InteractiveInfoDto dto1 = new InteractiveInfoDto();
dto1.interactiveId = dao.getNewId();
dto1.playlistId = playlistDetailDto1.playlistId;
dto1.listOrder = playlistDetailDto1.listOrder;
dto1.dstContentId = contentDto2.contentId;
dto1.pageFrom = 1;
dto1.pageTo = 3;
dto1.dstPageFrom = 4;
dao.insert(dto1);
InteractiveInfoDto dto2 = dao.getInteractiveInfo(dto1.interactiveId);
assertEquals(dto1.interactiveId, dto2.interactiveId);
assertEquals(dto1.playlistId, dto2.playlistId);
assertEquals(dto1.listOrder, dto2.listOrder);
assertEquals(dto1.dstContentId, dto2.dstContentId);
assertEquals(dto1.pageFrom, dto2.pageFrom);
assertEquals(dto1.pageTo, dto2.pageTo);
assertEquals(dto1.dstPageFrom, dto2.dstPageFrom);
dao.rollback();
}
public void testUpdate() {
dao.beginTransaction();
ContentDto contentDto1 = insertDummyContent(100);
ContentDto contentDto2 = insertDummyContent(1000);
ContentDto contentDto3 = insertDummyContent(10000);
PlaylistDto playListDto1 = new PlaylistDto();
int playlistId1 = 1;
playListDto1.playlistId = playlistId1;
playListDto1.playlistName = "Playlist01";
playlistDao.insert(playListDto1);
PlaylistDetailDto playlistDetailDto1 = new PlaylistDetailDto();
playlistDetailDto1.playlistId = playlistId1;
playlistDetailDto1.listOrder = 1;
playlistDetailDto1.contentId = contentDto1.contentId;
playlistDetailDto1.slide = 3;
playlistDetailDto1.stay = 5;
playlistDetailDao.insert(playlistDetailDto1);
PlaylistDto playListDto2 = new PlaylistDto();
int playlistId2 = 2;
playListDto2.playlistId = playlistId2;
playListDto2.playlistName = "Playlist01";
playlistDao.insert(playListDto2);
PlaylistDetailDto playlistDetailDto2 = new PlaylistDetailDto();
playlistDetailDto2.playlistId = playlistId2;
playlistDetailDto2.listOrder = 2;
playlistDetailDto2.contentId = contentDto1.contentId;
playlistDetailDto2.slide = 3;
playlistDetailDto2.stay = 5;
playlistDetailDao.insert(playlistDetailDto2);
InteractiveInfoDto dto1 = new InteractiveInfoDto();
dto1.interactiveId = dao.getNewId();
dto1.playlistId = playlistDetailDto1.playlistId;
dto1.listOrder = playlistDetailDto1.listOrder;
dto1.dstContentId = contentDto2.contentId;
dto1.pageFrom = 1;
dto1.pageTo = 3;
dto1.dstPageFrom = 4;
dao.insert(dto1);
InteractiveInfoDto dto2 = dao.getInteractiveInfo(dto1.interactiveId);
assertEquals(dto1.interactiveId, dto2.interactiveId);
assertEquals(dto1.playlistId, dto2.playlistId);
assertEquals(dto1.listOrder, dto2.listOrder);
assertEquals(dto1.dstContentId, dto2.dstContentId);
assertEquals(dto1.pageFrom, dto2.pageFrom);
assertEquals(dto1.pageTo, dto2.pageTo);
assertEquals(dto1.dstPageFrom, dto2.dstPageFrom);
dto1.playlistId = playlistDetailDto2.playlistId;
dto1.listOrder = playlistDetailDto2.listOrder;
dto1.dstContentId = contentDto3.contentId;
dto1.pageFrom = 5;
dto1.pageTo = 10;
dto1.dstPageFrom = 6;
dao.update(dto1);
InteractiveInfoDto dto3 = dao.getInteractiveInfo(dto1.interactiveId);
assertEquals(dto1.interactiveId, dto3.interactiveId);
assertEquals(dto1.playlistId, dto3.playlistId);
assertEquals(dto1.listOrder, dto3.listOrder);
assertEquals(dto1.dstContentId, dto3.dstContentId);
assertEquals(dto1.pageFrom, dto3.pageFrom);
assertEquals(dto1.pageTo, dto3.pageTo);
assertEquals(dto1.dstPageFrom, dto3.dstPageFrom);
dao.rollback();
}
protected ContentDto insertDummyContent(long contentId) {
// コンテンツ登録
String time = "2013-08-08 15:00:00.0";
ContentDto contentDto = new ContentDto();
contentDto.alertMessage = "あらーと";
contentDto.alertMessageLevel = 1;
contentDto.allPageNum = 10;
contentDto.categoryId = 1233;
contentDto.contentDetail = "しょうさい";
contentDto.contentGroups = "ぐるーぷ";
contentDto.contentId = contentId;
contentDto.contentName = "たいとうr";
contentDto.contentNameKana = "...";
contentDto.contentProtectedFlg = true;
contentDto.contentSize = 1024;
contentDto.contentType = "pdfFile";
contentDto.contractContentId = 10;
contentDto.deliveryEndDate = DateTimeUtil.toDate(time, DateTimeFormat.yyyyMMddHHmmss_hyphen);
contentDto.deliveryStartDate = DateTimeUtil.toDate(time, DateTimeFormat.yyyyMMddHHmmss_hyphen);
contentDto.detailPageNum = 2;
contentDto.downloadedFlg = false;
contentDto.downloadingFlg = true;
contentDto.status = DownloadStatusType.Canceled.type();
contentDto.isChecked = false;
contentDto.favoriteFlg = false;
contentDto.groupIds = new int[] { 100, 200 };
contentDto.lastDeliveryDate = DateTimeUtil.toDate(time, DateTimeFormat.yyyyMMddHHmmss_hyphen);
contentDto.metaVersion = 2;
contentDto.newFlg = false;
contentDto.orientation = 1;
contentDto.pagePath = "/data/data/jp.agentec.abook.abv.launcher.android/files/ABook/contents/1062/detail";
List<ContentPageDto> list = null;
contentDto.pages = list;
contentDto.pdfSendMailFlg = false;
contentDto.printFlg = false;
contentDto.readingCount = 10;
contentDto.readingDate = DateTimeUtil.toDate(time, DateTimeFormat.yyyyMMddHHmmss_hyphen);
contentDto.downloadProgress = new Integer(1);
contentDto.resourcePath = null;
contentDto.resourceVersion = 3;
contentDto.tags = new String[3];
contentDto.thumbnailBigPath = "";
contentDto.thumbnailNormalPath = "";
contentDto.updatedFlg = true;
contentDao.insertContent(contentDto);
return contentDto;
}
}
package jp.agentec.abook.abv.bl.data.dao;
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 junit.framework.TestCase;
import junit.framework.TestSuite;
public class LockDaoTest extends TestCase {
private LockDao dao = AbstractDao.getDao(LockDao.class);
public LockDaoTest(String string) {
super(string);
}
@Override
protected void setUp() throws Exception {
super.setUp();
DBConnector conn = DBConnector.getInstance();
SQLiteOpenHelper sqlLiteOpenHelper = new JDBCSQLiteOpenHelper("test.db", 0);
conn.setSqlLiteOpenHelper(sqlLiteOpenHelper);
((JDBCSQLiteOpenHelper) sqlLiteOpenHelper).onCreate(conn.getDatabase());
}
public static TestSuite suite() {
TestSuite suite = new TestSuite("LockDaoTest");
suite.addTest(new LockDaoTest(""));
return suite;
}
@Override
protected void tearDown() throws Exception {
super.tearDown();
}
}
package jp.agentec.abook.abv.bl.data.dao;
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.adf.util.DateTimeUtil;
import junit.framework.TestCase;
import junit.framework.TestSuite;
public class PlaylistDaoTest extends TestCase {
private PlaylistDao dao = new PlaylistDao();
public PlaylistDaoTest(String string) {
super(string);
}
@Override
protected void setUp() throws Exception {
super.setUp();
ABVEnvironment.getInstance().isReader = true;
DBConnector conn = DBConnector.getInstance();
SQLiteOpenHelper sqlLiteOpenHelper = new JDBCSQLiteOpenHelper("test.db", 0);
conn.setSqlLiteOpenHelper(sqlLiteOpenHelper);
((JDBCSQLiteOpenHelper) sqlLiteOpenHelper).onCreate(conn.getDatabase());
}
public static TestSuite suite() {
TestSuite suite = new TestSuite("PlaylistDaoTest");
suite.addTest(new PlaylistDaoTest("testInsert"));
suite.addTest(new PlaylistDaoTest("testUpdate"));
return suite;
}
@Override
protected void tearDown() throws Exception {
super.tearDown();
}
public void testInsert() {
dao.beginTransaction();
PlaylistDto dto1 = new PlaylistDto();
int playlistId = 1;
dto1.playlistId = playlistId;
dto1.playlistName = "Playlist01";
dto1.updateDate = DateTimeUtil.getCurrentDate();
dao.insert(dto1);
PlaylistDto dto2 = dao.getPlaylist(playlistId);
assertEquals(dto1.playlistId, dto2.playlistId);
assertEquals(dto1.playlistName, dto2.playlistName);
assertEquals(dto1.updateDate.toString(), dto2.updateDate.toString());
dao.rollback();
}
public void testUpdate() {
dao.beginTransaction();
PlaylistDto dto1 = new PlaylistDto();
int playlistId = 1;
dto1.playlistId = playlistId;
dto1.playlistName = "Playlist01";
dto1.updateDate = DateTimeUtil.getCurrentDate();
dao.insert(dto1);
PlaylistDto dto2 = dao.getPlaylist(playlistId);
assertEquals(dto1.playlistId, dto2.playlistId);
assertEquals(dto1.playlistName, dto2.playlistName);
assertEquals(dto1.updateDate.toString(), dto2.updateDate.toString());
dto2.playlistName = "NewPlaylist01";
dto1.updateDate = DateTimeUtil.getCurrentDate();
dao.update(dto2);
PlaylistDto dto3 = dao.getPlaylist(playlistId);
assertEquals(dto3.playlistId, dto2.playlistId);
assertEquals(dto3.playlistName, dto2.playlistName);
assertEquals(dto3.updateDate.toString(), dto2.updateDate.toString());
dao.rollback();
}
}
package jp.agentec.abook.abv.bl.data.dao;
import java.util.List;
import jp.agentec.abook.abv.bl.acms.type.DownloadStatusType;
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.ContentDto;
import jp.agentec.abook.abv.bl.dto.ContentPageDto;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
import junit.framework.TestCase;
import junit.framework.TestSuite;
public class PlaylistDetailDaoTest extends TestCase {
private PlaylistDetailDao dao = new PlaylistDetailDao();
private PlaylistDao playlistDao = new PlaylistDao();
private InteractiveInfoDao interactiveInfoDao = new InteractiveInfoDao();
private ContentDao contentDao = new ContentDao();
public PlaylistDetailDaoTest(String string) {
super(string);
}
@Override
protected void setUp() throws Exception {
super.setUp();
ABVEnvironment.getInstance().isReader = true;
DBConnector conn = DBConnector.getInstance();
SQLiteOpenHelper sqlLiteOpenHelper = new JDBCSQLiteOpenHelper("test.db", 0);
conn.setSqlLiteOpenHelper(sqlLiteOpenHelper);
((JDBCSQLiteOpenHelper) sqlLiteOpenHelper).onCreate(conn.getDatabase());
}
public static TestSuite suite() {
TestSuite suite = new TestSuite("PlaylistDetailDaoTest");
suite.addTest(new PlaylistDetailDaoTest("testInsert"));
suite.addTest(new PlaylistDetailDaoTest("testUpdate"));
suite.addTest(new PlaylistDetailDaoTest("testDeleteByContentId"));
return suite;
}
@Override
protected void tearDown() throws Exception {
super.tearDown();
}
public void testInsert() {
dao.beginTransaction();
// コンテンツ登録
ContentDto contentDto = insertDummyContent(1000);
// プレイリスト登録
PlaylistDto playlistDto = new PlaylistDto();
int playlistId = 1;
playlistDto.playlistId = playlistId;
playlistDto.playlistName = "Playlist01";
playlistDao.insert(playlistDto);
PlaylistDetailDto dto1 = new PlaylistDetailDto();
dto1.playlistId = playlistId;
dto1.listOrder = 1;
dto1.contentId = contentDto.contentId;
dto1.slide = 3;
dto1.stay = 5;
dao.insert(dto1);
PlaylistDetailDto dto2 = dao.getPlaylistDetail(playlistId, dto1.listOrder);
assertEquals(dto1.playlistId, dto2.playlistId);
assertEquals(dto1.listOrder, dto2.listOrder);
assertEquals(dto1.contentId, dto2.contentId);
assertEquals(dto1.slide, dto2.slide);
assertEquals(dto1.stay, dto2.stay);
dao.rollback();
}
public void testUpdate() {
dao.beginTransaction();
// コンテンツ登録
ContentDto contentDto1 = insertDummyContent(1000);
ContentDto contentDto2 = insertDummyContent(10010);
// プレイリスト登録
PlaylistDto playlistDto = new PlaylistDto();
int playlistId = 1;
playlistDto.playlistId = playlistId;
playlistDto.playlistName = "Playlist01";
playlistDao.insert(playlistDto);
PlaylistDetailDto dto1 = new PlaylistDetailDto();
dto1.playlistId = playlistId;
dto1.listOrder = 1;
dto1.contentId = contentDto1.contentId;
dto1.slide = 3;
dto1.stay = 5;
dao.insert(dto1);
PlaylistDetailDto dto2 = dao.getPlaylistDetail(playlistId, dto1.listOrder);
assertEquals(dto1.playlistId, dto2.playlistId);
assertEquals(dto1.listOrder, dto2.listOrder);
assertEquals(dto1.contentId, dto2.contentId);
assertEquals(dto1.slide, dto2.slide);
assertEquals(dto1.stay, dto2.stay);
dto2.contentId = contentDto2.contentId;
dto2.slide = 6;
dto2.stay = 10;
dao.update(dto2);
PlaylistDetailDto dto3 = dao.getPlaylistDetail(playlistId, dto2.listOrder);
assertEquals(dto3.playlistId, dto2.playlistId);
assertEquals(dto3.listOrder, dto2.listOrder);
assertEquals(dto3.contentId, dto2.contentId);
assertEquals(dto3.slide, dto2.slide);
assertEquals(dto3.stay, dto2.stay);
dao.rollback();
}
public void testDeleteByContentId() {
dao.beginTransaction();
ContentDto contentDto1 = insertDummyContent(100);
ContentDto contentDto2 = insertDummyContent(1000);
PlaylistDto playListDto1 = new PlaylistDto();
int playlistId = 1;
playListDto1.playlistId = playlistId;
playListDto1.playlistName = "Playlist01";
playlistDao.insert(playListDto1);
PlaylistDetailDto playlistDetailDto1 = new PlaylistDetailDto();
playlistDetailDto1.playlistId = playlistId;
playlistDetailDto1.listOrder = 1;
playlistDetailDto1.contentId = contentDto1.contentId;
playlistDetailDto1.slide = 3;
playlistDetailDto1.stay = 5;
dao.insert(playlistDetailDto1);
PlaylistDetailDto playlistDetailDto2 = new PlaylistDetailDto();
playlistDetailDto2.playlistId = playlistId;
playlistDetailDto2.listOrder = 2;
playlistDetailDto2.contentId = contentDto2.contentId;
playlistDetailDto2.slide = 3;
playlistDetailDto2.stay = 5;
dao.insert(playlistDetailDto2);
InteractiveInfoDto dto1 = new InteractiveInfoDto();
dto1.interactiveId = interactiveInfoDao.getNewId();
dto1.playlistId = playlistDetailDto2.playlistId;
dto1.listOrder = playlistDetailDto2.listOrder;
dto1.dstContentId = contentDto2.contentId;
dto1.pageFrom = 1;
dto1.pageTo = 3;
dto1.dstPageFrom = 4;
interactiveInfoDao.insert(dto1);
InteractiveInfoDto dto2 = new InteractiveInfoDto();
dto2.interactiveId = interactiveInfoDao.getNewId();
dto2.playlistId = playlistDetailDto1.playlistId;
dto2.listOrder = playlistDetailDto1.listOrder;
dto2.dstContentId = contentDto1.contentId;
dto2.pageFrom = 1;
dto2.pageTo = 3;
dto2.dstPageFrom = 4;
interactiveInfoDao.insert(dto2);
dao.deleteByContentId(100);
dao.rollback();
}
protected ContentDto insertDummyContent(long contentId) {
// コンテンツ登録
String time = "2013-08-08 15:00:00.0";
ContentDto contentDto = new ContentDto();
contentDto.alertMessage = "あらーと";
contentDto.alertMessageLevel = 1;
contentDto.allPageNum = 10;
contentDto.categoryId = 1233;
contentDto.contentDetail = "しょうさい";
contentDto.contentGroups = "ぐるーぷ";
contentDto.contentId = contentId;
contentDto.contentName = "たいとうr";
contentDto.contentNameKana = "...";
contentDto.contentProtectedFlg = true;
contentDto.contentSize = 1024;
contentDto.contentType = "pdfFile";
contentDto.contractContentId = 10;
contentDto.deliveryEndDate = DateTimeUtil.toDate(time, DateTimeFormat.yyyyMMddHHmmss_hyphen);
contentDto.deliveryStartDate = DateTimeUtil.toDate(time, DateTimeFormat.yyyyMMddHHmmss_hyphen);
contentDto.detailPageNum = 2;
contentDto.downloadedFlg = false;
contentDto.downloadingFlg = true;
contentDto.status = DownloadStatusType.Canceled.type();
contentDto.isChecked = false;
contentDto.favoriteFlg = false;
contentDto.groupIds = new int[] { 100, 200 };
contentDto.lastDeliveryDate = DateTimeUtil.toDate(time, DateTimeFormat.yyyyMMddHHmmss_hyphen);
contentDto.metaVersion = 2;
contentDto.newFlg = false;
contentDto.orientation = 1;
contentDto.pagePath = "/data/data/jp.agentec.abook.abv.launcher.android/files/ABook/contents/1062/detail";
List<ContentPageDto> list = null;
contentDto.pages = list;
contentDto.pdfSendMailFlg = false;
contentDto.printFlg = false;
contentDto.readingCount = 10;
contentDto.readingDate = DateTimeUtil.toDate(time, DateTimeFormat.yyyyMMddHHmmss_hyphen);
contentDto.downloadProgress = new Integer(1);
contentDto.resourcePath = null;
contentDto.resourceVersion = 3;
contentDto.tags = new String[3];
contentDto.thumbnailBigPath = "";
contentDto.thumbnailNormalPath = "";
contentDto.updatedFlg = true;
contentDao.insertContent(contentDto);
return contentDto;
}
}
package jp.agentec.abook.abv.bl.data.dao;
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.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
import junit.framework.TestCase;
import junit.framework.TestSuite;
public class ScheduleDaoTest extends TestCase {
private ScheduleDao dao = new ScheduleDao();
private PlaylistDao playlistDao = new PlaylistDao();
public ScheduleDaoTest(String string) {
super(string);
}
@Override
protected void setUp() throws Exception {
super.setUp();
ABVEnvironment.getInstance().isReader = true;
DBConnector conn = DBConnector.getInstance();
SQLiteOpenHelper sqlLiteOpenHelper = new JDBCSQLiteOpenHelper("test.db", 0);
conn.setSqlLiteOpenHelper(sqlLiteOpenHelper);
((JDBCSQLiteOpenHelper) sqlLiteOpenHelper).onCreate(conn.getDatabase());
}
public static TestSuite suite() {
TestSuite suite = new TestSuite("ScheduleDaoTest");
suite.addTest(new ScheduleDaoTest("testInsert"));
suite.addTest(new ScheduleDaoTest("testUpdate"));
return suite;
}
@Override
protected void tearDown() throws Exception {
super.tearDown();
}
public void testInsert() {
dao.beginTransaction();
PlaylistDto playlistDto1 = new PlaylistDto();
int playlistId1 = 1;
playlistDto1.playlistId = playlistId1;
playlistDto1.playlistName = "Playlist01";
playlistDao.insert(playlistDto1);
PlaylistDto playlistDto2 = new PlaylistDto();
int playlistId2 = 2;
playlistDto2.playlistId = playlistId2;
playlistDto2.playlistName = "Playlist02";
playlistDao.insert(playlistDto2);
ScheduleDto dto1 = new ScheduleDto();
dto1.scheduleId = dao.getNewId();
dto1.start = DateTimeUtil.toDate("2015-01-01 09:00:00.0", DateTimeFormat.yyyyMMddHHmmss_hyphen);
dto1.end = DateTimeUtil.toDate("2015-01-01 17:00:00.0", DateTimeFormat.yyyyMMddHHmmss_hyphen);
dto1.playlistId = playlistId1;
dto1.subPlaylistId = playlistId2;
dao.insert(dto1);
ScheduleDto dto2 = dao.getSchedule(dto1.scheduleId);
assertEquals(dto1.scheduleId, dto2.scheduleId);
assertEquals(dto1.start, dto2.start);
assertEquals(dto1.end, dto2.end);
assertEquals(dto1.playlistId, dto2.playlistId);
assertEquals(dto1.subPlaylistId, dto2.subPlaylistId);
dao.rollback();
}
public void testUpdate() {
dao.beginTransaction();
PlaylistDto playlistDto1 = new PlaylistDto();
int playlistId1 = 1;
playlistDto1.playlistId = playlistId1;
playlistDto1.playlistName = "Playlist01";
playlistDao.insert(playlistDto1);
PlaylistDto playlistDto2 = new PlaylistDto();
int playlistId2 = 2;
playlistDto2.playlistId = playlistId2;
playlistDto2.playlistName = "Playlist02";
playlistDao.insert(playlistDto2);
ScheduleDto dto1 = new ScheduleDto();
dto1.scheduleId = dao.getNewId();
dto1.start = DateTimeUtil.toDate("2015-01-01 09:00:00.0", DateTimeFormat.yyyyMMddHHmmss_hyphen);
dto1.end = DateTimeUtil.toDate("2015-01-01 17:00:00.0", DateTimeFormat.yyyyMMddHHmmss_hyphen);
dto1.playlistId = playlistId1;
dto1.subPlaylistId = playlistId2;
dao.insert(dto1);
ScheduleDto dto2 = dao.getSchedule(dto1.scheduleId);
assertEquals(dto1.scheduleId, dto2.scheduleId);
assertEquals(dto1.start, dto2.start);
assertEquals(dto1.end, dto2.end);
assertEquals(dto1.playlistId, dto2.playlistId);
assertEquals(dto1.subPlaylistId, dto2.subPlaylistId);
dto2.start = DateTimeUtil.toDate("2015-01-01 21:00:00.0", DateTimeFormat.yyyyMMddHHmmss_hyphen);
dto2.end = DateTimeUtil.toDate("2015-01-01 05:00:00.0", DateTimeFormat.yyyyMMddHHmmss_hyphen);
dto2.playlistId = playlistId2;
dto2.subPlaylistId = playlistId1;
dao.update(dto2);
ScheduleDto dto3 = dao.getSchedule(dto1.scheduleId);
assertEquals(dto3.scheduleId, dto2.scheduleId);
assertEquals(dto3.start, dto2.start);
assertEquals(dto3.end, dto2.end);
assertEquals(dto3.playlistId, dto2.playlistId);
assertEquals(dto3.subPlaylistId, dto2.subPlaylistId);
dao.rollback();
}
}
...@@ -56,7 +56,6 @@ android { ...@@ -56,7 +56,6 @@ android {
//abvFunctionOptions //abvFunctionOptions
resValue("integer", "login_mode", "${login_mode}") resValue("integer", "login_mode", "${login_mode}")
resValue("string", "account_path", "${account_path}") resValue("string", "account_path", "${account_path}")
resValue("integer", "location_mode", "${location_mode}")
resValue("integer", "setting_menu_account", "${setting_menu_account}") resValue("integer", "setting_menu_account", "${setting_menu_account}")
resValue("integer", "setting_menu_logout", "${setting_menu_logout}") resValue("integer", "setting_menu_logout", "${setting_menu_logout}")
resValue("integer", "setting_menu_password_change", "${setting_menu_password_change}") resValue("integer", "setting_menu_password_change", "${setting_menu_password_change}")
...@@ -64,23 +63,9 @@ android { ...@@ -64,23 +63,9 @@ android {
resValue("integer", "setting_menu_app_info", "${setting_menu_app_info}") resValue("integer", "setting_menu_app_info", "${setting_menu_app_info}")
resValue("integer", "setting_menu_url_path", "${setting_menu_url_path}") resValue("integer", "setting_menu_url_path", "${setting_menu_url_path}")
resValue("integer", "setting_menu_loginId", "${setting_menu_loginId}") resValue("integer", "setting_menu_loginId", "${setting_menu_loginId}")
resValue("integer", "viewer_menu_exit", "${viewer_menu_exit}")
resValue("integer", "viewer_menu_history", "${viewer_menu_history}")
resValue("integer", "viewer_menu_index", "${viewer_menu_index}")
resValue("integer", "viewer_menu_search", "${viewer_menu_search}")
resValue("integer", "viewer_menu_memo", "${viewer_menu_memo}")
resValue("integer", "viewer_menu_marking", "${viewer_menu_marking}")
resValue("integer", "viewer_menu_bookmark", "${viewer_menu_bookmark}")
resValue("integer", "usable_location_service", "${usable_location_service}")
resValue("integer", "usable_content_tag_search", "${usable_content_tag_search}")
resValue("integer", "push_message", "${push_message}") resValue("integer", "push_message", "${push_message}")
resValue("integer", "check_app_update", "${check_app_update}") resValue("integer", "check_app_update", "${check_app_update}")
resValue("integer", "download_service_check", "${download_service_check}")
resValue("string", "download_service_start_time", "${download_service_start_time}")
resValue("integer", "download_service_check_interval", "${download_service_check_interval}")
resValue("integer", "set_random_time", "${set_random_time}")
resValue("integer", "not_delete_all_contents", "${not_delete_all_contents}") resValue("integer", "not_delete_all_contents", "${not_delete_all_contents}")
resValue("integer", "edition_type", "${edition_type}")
} }
sourceSets { sourceSets {
main { main {
......
...@@ -654,9 +654,6 @@ ...@@ -654,9 +654,6 @@
<string name="monitor_mode_notouch">非タッチモード</string> <string name="monitor_mode_notouch">非タッチモード</string>
<string name="pdf_image_size_touch">外部モニタ解像度設定/タッチモニタ設定</string> <string name="pdf_image_size_touch">外部モニタ解像度設定/タッチモニタ設定</string>
<!-- 1.8.5.4-->
<string name="default_schedule_label">デフォルト</string>
<!-- 1.9.0.0--> <!-- 1.9.0.0-->
<string name="meetingroom_setting">会議室設定</string> <string name="meetingroom_setting">会議室設定</string>
<string name="marking_share_setting">マーキング共有設定</string> <string name="marking_share_setting">マーキング共有設定</string>
......
...@@ -654,9 +654,6 @@ ...@@ -654,9 +654,6 @@
<string name="monitor_mode_notouch">비 터치 모드</string> <string name="monitor_mode_notouch">비 터치 모드</string>
<string name="pdf_image_size_touch">외부 모니터 해상도 설정/터치 모니터 설정</string> <string name="pdf_image_size_touch">외부 모니터 해상도 설정/터치 모니터 설정</string>
<!-- 1.8.5.4-->
<string name="default_schedule_label">기본</string>
<!-- 1.9.0.0--> <!-- 1.9.0.0-->
<string name="meetingroom_setting">회의실 설정</string> <string name="meetingroom_setting">회의실 설정</string>
<string name="marking_share_setting">마킹 공유 설정</string> <string name="marking_share_setting">마킹 공유 설정</string>
......
...@@ -671,9 +671,6 @@ ...@@ -671,9 +671,6 @@
<string name="monitor_mode_notouch">NoTouch Mode</string> <string name="monitor_mode_notouch">NoTouch Mode</string>
<string name="pdf_image_size_touch">External monitor resolution/Touch monitor setting</string> <string name="pdf_image_size_touch">External monitor resolution/Touch monitor setting</string>
<!-- 1.8.5.4-->
<string name="default_schedule_label">default</string>
<!-- 1.9.0.0--> <!-- 1.9.0.0-->
<string name="meetingroom_setting">Meeting room setting</string> <string name="meetingroom_setting">Meeting room setting</string>
<string name="marking_share_setting">Marking sharing setting</string> <string name="marking_share_setting">Marking sharing setting</string>
......
...@@ -50,10 +50,6 @@ ...@@ -50,10 +50,6 @@
android:title="@string/licence_info" > android:title="@string/licence_info" >
</PreferenceScreen> </PreferenceScreen>
<PreferenceScreen <PreferenceScreen
android:key="termOfUse"
android:title="@string/term_of_use" >
</PreferenceScreen>
<PreferenceScreen
android:key="checkAppUpdate" android:key="checkAppUpdate"
android:title="@string/check_app_update" > android:title="@string/check_app_update" >
</PreferenceScreen> </PreferenceScreen>
......
...@@ -51,7 +51,7 @@ public class ContentLogUtil { ...@@ -51,7 +51,7 @@ public class ContentLogUtil {
int readingLogId = contentReadingLogLogic.startContentReadLog(contentId); int readingLogId = contentReadingLogLogic.startContentReadLog(contentId);
// 位置情報取得許可、サービスオプション、ビルドオプションチェック // 位置情報取得許可、サービスオプション、ビルドオプションチェック
if (permissionAccessLocation && checkUsableReadinglogGps(contentId) && context.getResources().getInteger(R.integer.usable_location_service) == 1) { if (permissionAccessLocation && checkUsableReadinglogGps(contentId)) {
// 位置情報取得 // 位置情報取得
locationManagerUtil = new LocationManagerUtil(context, new LocationManagerUtil.LocationManagerUtilListener() { locationManagerUtil = new LocationManagerUtil(context, new LocationManagerUtil.LocationManagerUtilListener() {
@Override @Override
......
...@@ -37,10 +37,6 @@ public class ABVUIDataCache { ...@@ -37,10 +37,6 @@ public class ABVUIDataCache {
public Stack<FolderDto> folderStack; public Stack<FolderDto> folderStack;
public boolean preIsCatalogEdition; public boolean preIsCatalogEdition;
public int preScale;
public int preDeviceLocationMode;
public boolean preUseGroup;
public boolean preUseGenre;
// ユーザ情報コピー元コンテンツID // ユーザ情報コピー元コンテンツID
public long srcContentId = -1; public long srcContentId = -1;
......
package jp.agentec.abook.abv.launcher.android;
import java.util.Calendar;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
public class AlarmService {
private Context context;
private SharedPreferences pref;
public AlarmService(Context context){
this.context = context;
}
public void setTimeDownload(int hour, int minute){
boolean checkDownload;
long lastTimeDownload;
//ダウンロードしたかどうかチェック
pref = context.getSharedPreferences("DOWNLOADED", Context.MODE_PRIVATE);
checkDownload = pref.getBoolean("downloaded", false);
lastTimeDownload = pref.getLong("DateTime", System.currentTimeMillis());
//指定した時間ダウンロード設定
Calendar cal_setTime = Calendar.getInstance();
cal_setTime.set(Calendar.HOUR_OF_DAY, hour);
cal_setTime.set(Calendar.MINUTE, minute);
long setTime_ms = cal_setTime.getTimeInMillis();
//現在の時間
Calendar cal_now = Calendar.getInstance();
cal_now.set(Calendar.SECOND, 2);
long now_ms = cal_now.getTimeInMillis();
//指定時間になっていない
if(setTime_ms >= now_ms){
scheduleService(setTime_ms);
} else {
//指定した時間を過ぎたがダウンロードしていない
if (checkDownload) {
//ダウンロードした場合、指定時間を次の日にセット、ダウンロードフラグfalseにする。
if (setTime_ms < lastTimeDownload) {
cal_setTime.add(Calendar.DAY_OF_MONTH, 1);
setTime_ms = cal_setTime.getTimeInMillis();
scheduleService(setTime_ms);
SharedPreferences.Editor editor = pref.edit();
editor.putBoolean("downloaded", false);
editor.commit();
} else {
//前の日ダウンロードを実行していなかったので、ダウンロードフラグtrueのまま
scheduleService(now_ms);
}
} else {
scheduleService(now_ms);
}
}
}
public void scheduleService(long timeStart){
Intent intent = new Intent(context, AutoDownloadService.class);
PendingIntent pendingIntent = PendingIntent.getService(context, -1,intent , PendingIntent.FLAG_CANCEL_CURRENT);
AlarmManager alarmManager = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
alarmManager.setInexactRepeating(AlarmManager.RTC_WAKEUP, timeStart,AlarmManager.INTERVAL_FIFTEEN_MINUTES, pendingIntent);
}
public void cancelService () {
Intent intent = new Intent(context, AutoDownloadService.class);
PendingIntent pendingIntent = PendingIntent.getService(context, -1, intent, PendingIntent.FLAG_UPDATE_CURRENT);
AlarmManager alarmManager = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
alarmManager.cancel(pendingIntent);
}
}
package jp.agentec.abook.abv.launcher.android;
import java.util.Random;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.log.LogLevel;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.download.ContentDownloader;
import jp.agentec.abook.abv.bl.download.ContentRefresher;
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.util.ABVToastUtil;
import android.app.IntentService;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Handler;
import android.widget.Toast;
public class AutoDownloadService extends IntentService {
private final static String TAG="AutoDownloadService";
private long autoDownloadStartTime;
private Runnable downloadStart;
private Runnable refreshContentList;
private final Handler mHandler = new Handler();
private final long ONE_MINUTE = 60000;
@Override
public void onCreate() {
super.onCreate();
}
public AutoDownloadService() {
super(TAG);
}
@Override
protected void onHandleIntent(Intent intent) {
Logger.d(TAG, "ServiceStart");
autoDownloadStartTime = intent.getLongExtra("AUTO_DOWNLOAD_START_TIME", System.currentTimeMillis());
SharedPreferences pref = getSharedPreferences(PrefName.AUTODOWNLOAD_INFO, MODE_PRIVATE);
if (!pref.getBoolean(AppDefType.AutoDownloadPrefKey.AUTO_DOWNLOAD_WAITTING, false)) {
if (!checkPauseStatus() && checkAutoDownloadTime()) {
setTimeDownloadRandom();
}
}
}
//自動ダウンロード停止する条件になっているかどうか確認
private boolean checkPauseStatus(){
SharedPreferences pref = getSharedPreferences(PrefName.AUTODOWNLOAD_INFO, MODE_PRIVATE);
boolean contentOpenPause = pref.getBoolean(AppDefType.AutoDownloadPrefKey.CONTENT_OPEN, false);
return contentOpenPause;
}
/**
* ダウンロード中にWifi ONからOFFになった場合再開するため
* @return
*/
// private boolean checkWifiNotAccess(){
//
// boolean isWifiOff = true;
//
// NetworkAdapter networkAdapter = ABVEnvironment.getInstance().networkAdapter;
// SharedPreferences pref = getPrefData();
// SharedPreferences.Editor editor = pref.edit();
// if (networkAdapter.isWifiConnected()) {
// isWifiOff = false;
// if (pref.getBoolean(AppDefType.PreferenceKey.WIFI_OFF, false)) {
// editor.putBoolean(AppDefType.PreferenceKey.WIFI_OFF_STATUS_CHANGE, true);
// editor.putBoolean(AppDefType.PreferenceKey.WIFI_OFF, false);
// editor.commit();
// }
// } else {
// editor.putBoolean(AppDefType.PreferenceKey.WIFI_OFF, true);
// editor.commit();
// }
//
// return isWifiOff;
// }
private boolean checkAutoDownloadTime(){
boolean isDownloadStart = false;
SharedPreferences pref = getSharedPreferences(PrefName.AUTODOWNLOAD_INFO, MODE_PRIVATE);
long autoDownloadStartedTime = pref.getLong(AppDefType.AutoDownloadPrefKey.AUTO_DOWNLOAD_STARTED_TIME, 0);
//指定した時間になった場合または過ぎた場合
if (autoDownloadStartTime <= System.currentTimeMillis() && autoDownloadStartTime > autoDownloadStartedTime) {
isDownloadStart = true;
SharedPreferences.Editor editor = pref.edit();
editor.putBoolean(AppDefType.AutoDownloadPrefKey.AUTO_DOWNLOAD_WAITTING, true);
editor.commit();
}
return isDownloadStart;
//自動ダウンロード再開するため
// else {
// //ダウンロードの停止された問題が解決されたかどうか確認
// boolean contentCloseStatus = pref.getBoolean(AppDefType.PreferenceKey.CONTENT_OPEN_STATUS_CHANGE, false);
// boolean wifiOnStatus = pref.getBoolean(AppDefType.PreferenceKey.WIFI_OFF_STATUS_CHANGE, false);
// //停止された問題が解決されたらダウンロード再開
// if ( contentCloseStatus || wifiOnStatus ) {
// isDownloadStart = true;
// editor.putBoolean(AppDefType.PreferenceKey.CONTENT_OPEN_STATUS_CHANGE, false);
// editor.putBoolean(AppDefType.PreferenceKey.WIFI_OFF_STATUS_CHANGE, false);
// editor.commit();
// }
// }
}
private void setTimeDownloadRandom(){
int downloadStartRandomTime = getResources().getInteger(R.integer.set_random_time);
Random timeRandom = new Random();
int getTimeRandom = timeRandom.nextInt(downloadStartRandomTime);
refreshContentList = new Runnable() {
@Override
public void run() {
try {
ContentRefresher.getInstance().refreshContentList(null);
if (ABVEnvironment.getInstance().getLogLevel().level() <= LogLevel.debug.level()) {
ABVToastUtil.showMakeText(getBaseContext(), "自動ダウンロードサービス開始", Toast.LENGTH_SHORT);
}
Logger.d(TAG, "自動ダウンロードサービス開始");
} catch (Exception e) {
Logger.e(TAG, "onHandleIntent refreshContentList", e);
}
}
};
downloadStart = new Runnable() {
@Override
public void run() {
ContentDownloader.getInstance().autoDownload();
Logger.d(TAG,"AutoDownloadCall");
SharedPreferences pref = getSharedPreferences(PrefName.AUTODOWNLOAD_INFO, MODE_PRIVATE);
SharedPreferences.Editor editor = pref.edit();
editor.putLong(AppDefType.AutoDownloadPrefKey.AUTO_DOWNLOAD_STARTED_TIME, System.currentTimeMillis());
editor.putBoolean(AppDefType.AutoDownloadPrefKey.AUTO_DOWNLOAD_WAITTING, false);
editor.commit();
}
};
Logger.i(TAG, "DownloadStartTime: After " + getTimeRandom + " minute");
mHandler.postDelayed(refreshContentList, getTimeRandom*ONE_MINUTE);
mHandler.postDelayed(downloadStart, (getTimeRandom+5)*ONE_MINUTE);
}
@Override
public void onDestroy(){
super.onDestroy();
}
}
...@@ -16,28 +16,9 @@ public class OnBootReceiver extends BroadcastReceiver { ...@@ -16,28 +16,9 @@ public class OnBootReceiver extends BroadcastReceiver {
@Override @Override
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED) || intent.getAction().equals(Intent.ACTION_PACKAGE_REPLACED) || intent.getAction().equals(Intent.ACTION_MY_PACKAGE_REPLACED)) { if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED) || intent.getAction().equals(Intent.ACTION_PACKAGE_REPLACED) || intent.getAction().equals(Intent.ACTION_MY_PACKAGE_REPLACED)) {
// 自動ダウンロードチェックの開始 // 自動ダウンロードチェックの開始
// TODO later ABVNoAuthenticatedActivityとソース重複のため統一 // TODO later ABVNoAuthenticatedActivityとソース重複のため統一
Resources res = context.getResources(); Resources res = context.getResources();
if (res.getInteger(R.integer.download_service_check) == 1) {
Calendar autoDownloadCalendar = Calendar.getInstance();
String autoDownTime = res.getString(R.string.download_service_start_time);
String[] setTimeDownload = autoDownTime.split(":");
//自動ダウンロード時間設定
autoDownloadCalendar.set(Calendar.HOUR_OF_DAY, Integer.parseInt(setTimeDownload[0]));
autoDownloadCalendar.set(Calendar.MINUTE, Integer.parseInt(setTimeDownload[1]));
long timeAutoDownload = autoDownloadCalendar.getTimeInMillis();
Intent serviceIntent = new Intent(context.getApplicationContext(), AutoDownloadService.class);
serviceIntent.putExtra("AUTO_DOWNLOAD_START_TIME", timeAutoDownload);
PendingIntent pendingIntent = PendingIntent.getService(context.getApplicationContext(), -1, serviceIntent, PendingIntent.FLAG_CANCEL_CURRENT);
AlarmManager alarmManager = (AlarmManager) context.getApplicationContext().getSystemService(Context.ALARM_SERVICE);
alarmManager.setInexactRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis(), 5 * 60 * 1000, pendingIntent);
Logger.d("OnBootReceiver onReceive Alarm register");
}
} }
} }
} }
\ No newline at end of file
...@@ -69,7 +69,6 @@ import jp.agentec.abook.abv.cl.helper.ABVUncaughtExceptionHandler; ...@@ -69,7 +69,6 @@ import jp.agentec.abook.abv.cl.helper.ABVUncaughtExceptionHandler;
import jp.agentec.abook.abv.cl.util.PreferenceUtil; import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.launcher.android.ABVApplication; import jp.agentec.abook.abv.launcher.android.ABVApplication;
import jp.agentec.abook.abv.launcher.android.ABVUIDataCache; import jp.agentec.abook.abv.launcher.android.ABVUIDataCache;
import jp.agentec.abook.abv.launcher.android.AutoDownloadService;
import jp.agentec.abook.abv.launcher.android.R; import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.PrefName; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.PrefName;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.UserPrefKey; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.UserPrefKey;
...@@ -109,7 +108,6 @@ public abstract class ABVActivity extends Activity { ...@@ -109,7 +108,6 @@ public abstract class ABVActivity extends Activity {
public static final String CID="cid"; public static final String CID="cid";
public static final String PAGE="page"; public static final String PAGE="page";
public static final String IS_STREAMING="isStreaming";
public static final String URL = "url"; public static final String URL = "url";
public static final String MESSAGE = "message"; public static final String MESSAGE = "message";
public static final String PASSWORD = "password"; public static final String PASSWORD = "password";
...@@ -302,13 +300,8 @@ public abstract class ABVActivity extends Activity { ...@@ -302,13 +300,8 @@ public abstract class ABVActivity extends Activity {
} }
protected void configureKeepScreen() { protected void configureKeepScreen() {
// 自動ロックがYの場合、スリープを有効にする
if (ABVDataCache.getInstance().serviceOption.isUseAutoLock()) {
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
} else {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
} }
}
public void logRunningTaskInfo() { public void logRunningTaskInfo() {
ActivityManager m = (ActivityManager) ABVActivity.this.getSystemService(Context.ACTIVITY_SERVICE); ActivityManager m = (ActivityManager) ABVActivity.this.getSystemService(Context.ACTIVITY_SERVICE);
...@@ -733,19 +726,6 @@ public abstract class ABVActivity extends Activity { ...@@ -733,19 +726,6 @@ public abstract class ABVActivity extends Activity {
user.forceSignoutUser(); user.forceSignoutUser();
} else { } else {
user.signoutUser(); user.signoutUser();
//自動ダウンロードする場合サービスキャンル、ダウンロード関する保存したデータを削除
if (getRInteger(R.integer.download_service_check) == 1) {
//プリファレンスデータ削除
SharedPreferences pref = getSharedPreferences(PrefName.AUTODOWNLOAD_INFO, MODE_PRIVATE);
SharedPreferences.Editor editor = pref.edit();
editor.clear();
editor.commit();
//ユーザ切り替え、前回のサービスキャンセル
Intent intent = new Intent(getApplicationContext(), AutoDownloadService.class);
PendingIntent pendingIntent = PendingIntent.getService(getApplicationContext(), -1, intent, PendingIntent.FLAG_UPDATE_CURRENT);
AlarmManager alarmManager = (AlarmManager)getApplicationContext().getSystemService(Context.ALARM_SERVICE);
alarmManager.cancel(pendingIntent);
}
} }
} }
} catch (Exception e) { } catch (Exception e) {
......
...@@ -324,14 +324,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -324,14 +324,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
if (!getRBoolean(R.bool.use_cache) && objectId == -1) { if (!getRBoolean(R.bool.use_cache) && objectId == -1) {
ContentFileExtractor.getInstance().removeContentCash(contentId); ContentFileExtractor.getInstance().removeContentCash(contentId);
} }
//自動ダウンロード再開設定
if (getRInteger(R.integer.download_service_check) == 1) {
//Autoダウンロード再開登録
SharedPreferences pref = getSharedPreferences(PrefName.AUTODOWNLOAD_INFO, MODE_PRIVATE);
SharedPreferences.Editor editor = pref.edit();
editor.putBoolean(AppDefType.AutoDownloadPrefKey.CONTENT_OPEN, false);
editor.commit();
}
} }
public long getContentId() { public long getContentId() {
...@@ -573,11 +565,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -573,11 +565,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
} }
@Override @Override
public boolean contentValidCheckAndDownload(long contentId) {
return false; // dummy
}
@Override
public boolean dispatchTouchEvent(MotionEvent ev) { public boolean dispatchTouchEvent(MotionEvent ev) {
Logger.v(TAG, "[dispatchTouchEvent]:start"); Logger.v(TAG, "[dispatchTouchEvent]:start");
try { try {
...@@ -589,6 +576,11 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -589,6 +576,11 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
} }
} }
@Override
public boolean contentValidCheckAndDownload(long contentId) {
return false; // dummy
}
protected void setMeetingParticipantCount(boolean isVisible, View toolBar) { protected void setMeetingParticipantCount(boolean isVisible, View toolBar) {
final TextView textView = (TextView)toolBar.findViewById(R.id.txt_meeting_participant); final TextView textView = (TextView)toolBar.findViewById(R.id.txt_meeting_participant);
if (textView == null) { if (textView == null) {
......
...@@ -48,7 +48,6 @@ import jp.agentec.abook.abv.bl.logic.UserAuthenticateLogic; ...@@ -48,7 +48,6 @@ import jp.agentec.abook.abv.bl.logic.UserAuthenticateLogic;
import jp.agentec.abook.abv.cl.environment.NetworkAdapter; import jp.agentec.abook.abv.cl.environment.NetworkAdapter;
import jp.agentec.abook.abv.cl.push.FcmManager; import jp.agentec.abook.abv.cl.push.FcmManager;
import jp.agentec.abook.abv.cl.util.PreferenceUtil; import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.launcher.android.AutoDownloadService;
import jp.agentec.abook.abv.launcher.android.OnAppDownloadReceiver; import jp.agentec.abook.abv.launcher.android.OnAppDownloadReceiver;
import jp.agentec.abook.abv.launcher.android.R; import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
...@@ -95,47 +94,12 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity { ...@@ -95,47 +94,12 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity {
*/ */
protected void showMainActivity(String loginId) { protected void showMainActivity(String loginId) {
//init_admin_modeがtrueの場合、管理者画面に遷移
alarmServiceStart();
startActivity(new Intent().setClassName(getApplicationContext().getPackageName(), getMainActivityClassName()).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP), NaviConsts.Right); startActivity(new Intent().setClassName(getApplicationContext().getPackageName(), getMainActivityClassName()).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP), NaviConsts.Right);
finish(); finish();
Intent intent = new Intent(); Intent intent = new Intent();
getApplicationContext().sendBroadcast(intent); getApplicationContext().sendBroadcast(intent);
} }
//AlarmService起動
private void alarmServiceStart() {
if (getRInteger(R.integer.download_service_check) == 1) {
Calendar autoDownloadCalendar = Calendar.getInstance();
String autoDownTime = getRString(R.string.download_service_start_time);
String[] setTimeDownload = autoDownTime.split(":");
//自動ダウンロード時間設定
int hourTime = Integer.parseInt(setTimeDownload[0]);
int minuteTime = Integer.parseInt(setTimeDownload[1]);
autoDownloadCalendar.set(Calendar.HOUR_OF_DAY, hourTime);
autoDownloadCalendar.set(Calendar.MINUTE, minuteTime);
long timeAutoDownload = autoDownloadCalendar.getTimeInMillis();
Logger.d(TAG, "AutoDownload Day:" + autoDownloadCalendar.get(Calendar.DAY_OF_MONTH));
// 開始予定時間が過去の場合は明日の同じ時間に変更
if (timeAutoDownload < System.currentTimeMillis()) {
autoDownloadCalendar.add(Calendar.DATE, 1);
timeAutoDownload = autoDownloadCalendar.getTimeInMillis();
Logger.d(TAG, "Change AutoDownload Day:" + autoDownloadCalendar.get(Calendar.DAY_OF_MONTH));
}
Intent intent = new Intent(getApplicationContext(), AutoDownloadService.class);
intent.putExtra("AUTO_DOWNLOAD_START_TIME", timeAutoDownload);
PendingIntent pendingIntent = PendingIntent.getService(getApplicationContext(), -1, intent , PendingIntent.FLAG_CANCEL_CURRENT);
AlarmManager alarmManager = (AlarmManager)getApplicationContext().getSystemService(ALARM_SERVICE);
// N分単位でチェックされるように設定
int checkInterval = getRInteger(R.integer.download_service_check_interval);
alarmManager.setInexactRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis(), checkInterval * 60 * 1000, pendingIntent);
}
}
// ログインなしの場合専用 // ログインなしの場合専用
protected void noAuthenticatedLogin(final boolean isGuestLogin, final String urlPath) { protected void noAuthenticatedLogin(final boolean isGuestLogin, final String urlPath) {
CommonExecutor.execute(new Runnable() { CommonExecutor.execute(new Runnable() {
...@@ -446,10 +410,6 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity { ...@@ -446,10 +410,6 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity {
final Uri data = getIntent().getData(); final Uri data = getIntent().getData();
Logger.i(TAG, "call from URI intent : %s", data); Logger.i(TAG, "call from URI intent : %s", data);
if (data != null && data.getScheme() != null) { if (data != null && data.getScheme() != null) {
if (data.getScheme().equals("file")) { // CMS入稿
contentUpload(intent, data);
return;
}
if (data.getScheme().equals(getString(R.string.scheme_url))) { // カスタムURI if (data.getScheme().equals(getString(R.string.scheme_url))) { // カスタムURI
intent.putExtra(CID, getLongValFromURI(data, CID)); intent.putExtra(CID, getLongValFromURI(data, CID));
intent.putExtra(PAGE, (int)getLongValFromURI(data, PAGE)); intent.putExtra(PAGE, (int)getLongValFromURI(data, PAGE));
...@@ -469,43 +429,6 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity { ...@@ -469,43 +429,6 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity {
} }
} }
/**
* CMSへファイルアップロード処理
*
* @param intent
* @param data
* @return
* @throws NetworkDisconnectedException
* @throws AcmsException
*/
private void contentUpload(final Intent intent, Uri data) throws AcmsException, NetworkDisconnectedException {
String ext = FileUtil.getExtension(data.getPath()).toLowerCase(Locale.getDefault());
ABVDataCache.getInstance().refreshServiceOptions();
boolean isUploadEnable = ABVDataCache.getInstance().serviceOption.isServiceOptionEnable(ServiceOptionId.ContentUpload); // サービスオプション(CMS入稿)
boolean isEditor = (AbstractLogic.getLogic(UserAuthenticateLogic.class).getAuthLevel() != AuthLevel.MOBILE); // 編集者(管理者含む)かどうか
boolean isOfficeEnable = ABVDataCache.getInstance().serviceOption.isServiceOptionEnable(ServiceOptionId.Office2pdf); // サービスオプション(Office入稿)
boolean isContentContainerEnable = ABVDataCache.getInstance().serviceOption.isServiceOptionEnable(ServiceOptionId.ContentContainer); // サービスオプション(コンテンツコンテナ)
if (StringUtil.contains(ext, new String[]{"xls","xlsx","doc","docx","ppt", "pptx"}) && !isOfficeEnable) { // Office入稿チェック
Logger.w(TAG, "Office2pdf is not allowed.");
showUploadAlertDialog(intent, R.string.error, R.string.content_upload_file_not_allowed);
}
else if (!StringUtil.contains(ext, new String[]{"pdf", "xls","xlsx","doc","docx","ppt", "pptx"}) && !isContentContainerEnable) { // コンテンツコンテナチェック
Logger.w(TAG, "ContentContainer is not allowed.");
showUploadAlertDialog(intent, R.string.error, R.string.content_upload_file_not_allowed);
}
else if (!isUploadEnable || !isEditor) { // サービスオプションが無効もしくは閲覧者の場合アップロード不可
showUploadAlertDialog(intent, R.string.error, R.string.content_upload_not_allowed);
}
else { // サービスオプション可能かつ編集者以上ならCMS入稿可能
showContentUploadDialog(intent, data.getPath(), ABVDataCache.getInstance().getUrlPath(), ABVDataCache.getInstance().getMemberInfo().sid);
}
}
private void showUploadAlertDialog(final Intent intent, int titleResId, int bodyResId) {
showUploadAlertDialog(intent, titleResId, getString(bodyResId));
}
private void showUploadAlertDialog(final Intent intent, final int titleResId, final String body) { private void showUploadAlertDialog(final Intent intent, final int titleResId, final String body) {
handler.post(new Runnable() { handler.post(new Runnable() {
@Override @Override
...@@ -522,69 +445,6 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity { ...@@ -522,69 +445,6 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity {
}); });
} }
/**
* ファイルアップロードダイアログ表示
*
* @param intent
* @param path
* @param urlPath
* @param sid
*/
private void showContentUploadDialog(final Intent intent, final String path, final String urlPath, final String sid) {
final CharSequence[] items = {getString(R.string.content_upload_auto_delivery)};
final boolean[] checkedItems = {true};
new AlertDialog.Builder(this)
.setTitle(R.string.content_upload_confirm)
.setMultiChoiceItems(items, checkedItems, new DialogInterface.OnMultiChoiceClickListener() {
@Override
public void onClick(DialogInterface dialog, int which, boolean isChecked) {
checkedItems[which] = isChecked;
}
})
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(final DialogInterface dialog, int id) {
Logger.v(TAG, "auto delivery:" + checkedItems[0]);
showProgressPopup();
dialog.cancel();
CommonExecutor.execute(new Runnable() {
@Override
public void run() {
try {
// ファイルアップロード処理
AcmsMessageJSON json = AcmsClient.getInstance(urlPath, ABVEnvironment.getInstance().networkAdapter).contentRegist(sid, new File(path), checkedItems[0]);
if (json.httpStatus == 200) {
showUploadAlertDialog(intent, R.string.confirm, R.string.content_upload_completed);
}
else {
Logger.e(TAG, "Content Upload failed. status=" + json.httpStatus + " message=" + StringUtil.join(",", json.errorMessage));
showUploadAlertDialog(intent, R.string.error, R.string.content_upload_failed);
}
} catch (AcmsException e) {
Logger.e(TAG, "Content Upload failed. ", e);
String msg = ErrorMessage.getErrorMessage(mContext, e);
showUploadAlertDialog(intent, R.string.error, msg);
} catch (Exception e) {
Logger.e(TAG, "Content Upload failed. ", e);
showUploadAlertDialog(intent, R.string.error, R.string.content_upload_failed);
} catch (OutOfMemoryError e) {
Logger.e(TAG, "Content Upload failed. ", e);
showUploadAlertDialog(intent, R.string.error, R.string.OUT_OF_MEMORY);
}
}
});
}
})
.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
moveToHome(intent, dialog);
}
})
.show();
}
private void moveToHome(final Intent intent, DialogInterface dialog) { private void moveToHome(final Intent intent, DialogInterface dialog) {
showProgressPopup(); showProgressPopup();
dialog.dismiss(); dialog.dismiss();
......
...@@ -149,10 +149,6 @@ public abstract class ABVUIActivity extends ABVAuthenticatedActivity { ...@@ -149,10 +149,6 @@ public abstract class ABVUIActivity extends ABVAuthenticatedActivity {
Logger.d(TAG, "contentDownloader.isRefreshing() %s", result); Logger.d(TAG, "contentDownloader.isRefreshing() %s", result);
getABVUIDataCache().preIsCatalogEdition = ABVDataCache.getInstance().serviceOption.isCatalogEdition(); getABVUIDataCache().preIsCatalogEdition = ABVDataCache.getInstance().serviceOption.isCatalogEdition();
getABVUIDataCache().preScale = ABVDataCache.getInstance().serviceOption.getContractScale();
getABVUIDataCache().preDeviceLocationMode = ABVDataCache.getInstance().serviceOption.getDeviceLocationMode();
getABVUIDataCache().preUseGroup = ABVDataCache.getInstance().serviceOption.isUseGroup();
getABVUIDataCache().preUseGenre = ABVDataCache.getInstance().serviceOption.isUseGenre();
if (!result) { if (!result) {
startUpdateAnimation(); startUpdateAnimation();
...@@ -397,11 +393,9 @@ public abstract class ABVUIActivity extends ABVAuthenticatedActivity { ...@@ -397,11 +393,9 @@ public abstract class ABVUIActivity extends ABVAuthenticatedActivity {
Logger.w(TAG, "you need to set mRefreshImage."); Logger.w(TAG, "you need to set mRefreshImage.");
} }
if (getRInteger(R.integer.download_service_check) == 0) {
// 自動ダウンロード対象がある場合、新着更新が完了したあとに開始するように修正(jang) // 自動ダウンロード対象がある場合、新着更新が完了したあとに開始するように修正(jang)
ContentDownloader.getInstance().autoDownload(); ContentDownloader.getInstance().autoDownload();
} }
}
/** /**
* メモ・マーキング・しおりをコピーします * メモ・マーキング・しおりをコピーします
......
...@@ -31,7 +31,6 @@ public interface AppDefType { ...@@ -31,7 +31,6 @@ public interface AppDefType {
String PERMISSION_ACCESS_LOCATION = "permissionAccessLocation"; String PERMISSION_ACCESS_LOCATION = "permissionAccessLocation";
String PUSH_MESSAGE ="pushMessage"; String PUSH_MESSAGE ="pushMessage";
String CURSOR_ENABLE = "cursorEnable"; String CURSOR_ENABLE = "cursorEnable";
String AUTO_DOWNLOAD = "autoDownload";
String IMAGE_CHANGE_EFFECT = "imageChangeEffect"; String IMAGE_CHANGE_EFFECT = "imageChangeEffect";
String ERROR_SEND_ENABLE = "errorSendEnable"; String ERROR_SEND_ENABLE = "errorSendEnable";
String LOG_SEND_ENABLE = "logSendEnable"; String LOG_SEND_ENABLE = "logSendEnable";
......
...@@ -16,15 +16,6 @@ public class ABVFunctionOptions extends AbstractOptions { ...@@ -16,15 +16,6 @@ public class ABVFunctionOptions extends AbstractOptions {
} }
@Override @Override
public int getLocationMode() {
if (context.getResources().getBoolean(R.bool.follow_service_option)) {
return ABVDataCache.getInstance().serviceOption.getDeviceLocationMode();
} else {
return context.getResources().getInteger(R.integer.location_mode);
}
}
@Override
public int getSettingMenuAccount() { public int getSettingMenuAccount() {
return context.getResources().getInteger(R.integer.setting_menu_account); return context.getResources().getInteger(R.integer.setting_menu_account);
} }
...@@ -50,41 +41,15 @@ public class ABVFunctionOptions extends AbstractOptions { ...@@ -50,41 +41,15 @@ public class ABVFunctionOptions extends AbstractOptions {
} }
@Override @Override
public int getViewerMenuExit() {
return context.getResources().getInteger(R.integer.viewer_menu_exit);
}
@Override
public int getViewerMenuIndex() {
return context.getResources().getInteger(R.integer.viewer_menu_index);
}
@Override
public int getViewerMenuSearch() {
return context.getResources().getInteger(R.integer.viewer_menu_search);
}
@Override
public int getViewerMenuTextcopy() { public int getViewerMenuTextcopy() {
return ABVDataCache.getInstance().serviceOption.isServiceOptionEnable(ServiceOptionId.PdfTextCopy) ? 1 : 0; return ABVDataCache.getInstance().serviceOption.isServiceOptionEnable(ServiceOptionId.PdfTextCopy) ? 1 : 0;
} }
@Override @Override
public int getViewerMenuMemo() {
return context.getResources().getInteger(R.integer.viewer_menu_memo);
}
@Override
public int getViewerMenuMarking() { public int getViewerMenuMarking() {
if (context.getResources().getBoolean(R.bool.follow_service_option)) { if (context.getResources().getBoolean(R.bool.follow_service_option)) {
return ABVDataCache.getInstance().serviceOption.isMarking() ? 1 : 0; return ABVDataCache.getInstance().serviceOption.isMarking() ? 1 : 0;
} else {
return context.getResources().getInteger(R.integer.viewer_menu_marking);
}
} }
return 1;
@Override
public int getViewerMenuBookmark() {
return context.getResources().getInteger(R.integer.viewer_menu_bookmark);
} }
} }
package jp.agentec.abook.abv.ui.common.appinfo.options; package jp.agentec.abook.abv.ui.common.appinfo.options;
import jp.agentec.abook.abv.bl.acms.client.json.DownloadedContentInfoJSON;
import jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON;
import jp.agentec.abook.abv.bl.acms.type.ServiceOption.ContentShareType;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.common.util.ContentFileUtil;
import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
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.ContractLogic;
import android.content.Context; import android.content.Context;
/** /**
...@@ -24,33 +13,4 @@ public abstract class AbstractOptions implements IOptions { ...@@ -24,33 +13,4 @@ public abstract class AbstractOptions implements IOptions {
public AbstractOptions(Context context) { public AbstractOptions(Context context) {
this.context = context.getApplicationContext(); this.context = context.getApplicationContext();
} }
protected int getContentShareVisibility(long contentId) {
int visible = 0;
int contentShareType = AbstractLogic.getLogic(ContractLogic.class).getContentShareType();
ContentDto contentDto = AbstractDao.getDao(ContentDao.class).getContent(contentId);
if (contentShareType == ContentShareType.ABOOK_TYPE) {
visible = 1;
}
return visible;
}
protected int getPdfSendMailVisibility(long contentId) {
ContractLogic cl = AbstractLogic.getLogic(ContractLogic.class);
ContentDto contentDto = AbstractDao.getDao(ContentDao.class).getContent(contentId);
try {
DownloadedContentInfoJSON json = ContentFileUtil.getDownloadedContentInfoJSON(contentId);
if (contentDto.contentType.equals(ContentJSON.KEY_PDF_TYPE) && cl.getPdfSendMail() && json.pdfSendMailFlg) {
return 1;
}
} catch (Exception e) {
Logger.e("PdfSendMail", "error", e);
}
return 0;
}
@Override
public int getSettingMenuErrorSend() {
return 1;
}
} }
...@@ -13,11 +13,6 @@ public class DefaultOptions extends AbstractOptions { ...@@ -13,11 +13,6 @@ public class DefaultOptions extends AbstractOptions {
} }
@Override @Override
public int getLocationMode() {
return 0;
}
@Override
public int getSettingMenuAccount() { public int getSettingMenuAccount() {
return 1; return 1;
} }
...@@ -43,37 +38,12 @@ public class DefaultOptions extends AbstractOptions { ...@@ -43,37 +38,12 @@ public class DefaultOptions extends AbstractOptions {
} }
@Override @Override
public int getViewerMenuExit() {
return 1;
}
@Override
public int getViewerMenuIndex() {
return 0;
}
@Override
public int getViewerMenuSearch() {
return 1;
}
@Override
public int getViewerMenuTextcopy() { public int getViewerMenuTextcopy() {
return 0; return 0;
} }
@Override @Override
public int getViewerMenuMemo() {
return 0;
}
@Override
public int getViewerMenuMarking() { public int getViewerMenuMarking() {
return 0; return 0;
} }
@Override
public int getViewerMenuBookmark() {
return 0;
}
} }
package jp.agentec.abook.abv.ui.common.appinfo.options; package jp.agentec.abook.abv.ui.common.appinfo.options;
public interface IOptions { public interface IOptions {
/**
* ロケーション切り替え
* @return 0:非表示(全部の固定)、1:表示
*/
int getLocationMode();
/** /**
* 設定:アカウント * 設定:アカウント
...@@ -38,51 +33,15 @@ public interface IOptions { ...@@ -38,51 +33,15 @@ public interface IOptions {
int getSettingMenuLogInfo(); int getSettingMenuLogInfo();
/** /**
* 設定:障害情報送信
* @return 0:非表示 1:表示
*/
int getSettingMenuErrorSend();
/**
* Viewerツールバー:戻る
* @return 0:非表示、1:表示
*/
int getViewerMenuExit();
/**
* Viewerツールバー:インデックス
* @return 0:非表示、1:表示
*/
int getViewerMenuIndex();
/**
* Viewerツールバー:検索
* @return 0:非表示、1:表示
*/
int getViewerMenuSearch();
/**
* Viewerツールバー:テキストコピー * Viewerツールバー:テキストコピー
* @return 0:非表示、1:表示 * @return 0:非表示、1:表示
*/ */
int getViewerMenuTextcopy(); int getViewerMenuTextcopy();
/** /**
* Viewer:メモ
* @return
*/
int getViewerMenuMemo();
/**
* Viewerツールバー:マーキング * Viewerツールバー:マーキング
* @return * @return
*/ */
int getViewerMenuMarking(); int getViewerMenuMarking();
/**
* Viewerツールバー:しおり
* @return
*/
int getViewerMenuBookmark();
} }
...@@ -15,11 +15,6 @@ public class LargeOptions extends AbstractOptions { ...@@ -15,11 +15,6 @@ public class LargeOptions extends AbstractOptions {
} }
@Override @Override
public int getLocationMode() {
return ABVDataCache.getInstance().serviceOption.getDeviceLocationMode();
}
@Override
public int getSettingMenuAccount() { public int getSettingMenuAccount() {
return 1; return 1;
} }
...@@ -45,37 +40,12 @@ public class LargeOptions extends AbstractOptions { ...@@ -45,37 +40,12 @@ public class LargeOptions extends AbstractOptions {
} }
@Override @Override
public int getViewerMenuExit() {
return 1;
}
@Override
public int getViewerMenuIndex() {
return 1;
}
@Override
public int getViewerMenuSearch() {
return 1;
}
@Override
public int getViewerMenuTextcopy() { public int getViewerMenuTextcopy() {
return ABVDataCache.getInstance().serviceOption.isServiceOptionEnable(ServiceOptionId.PdfTextCopy) ? 1 : 0; return ABVDataCache.getInstance().serviceOption.isServiceOptionEnable(ServiceOptionId.PdfTextCopy) ? 1 : 0;
} }
@Override @Override
public int getViewerMenuMemo() {
return 1;
}
@Override
public int getViewerMenuMarking() { public int getViewerMenuMarking() {
return ABVDataCache.getInstance().serviceOption.isMarking() ? 1 : 0; return ABVDataCache.getInstance().serviceOption.isMarking() ? 1 : 0;
} }
@Override
public int getViewerMenuBookmark() {
return 1;
}
} }
...@@ -15,11 +15,6 @@ public class MidOptions extends AbstractOptions { ...@@ -15,11 +15,6 @@ public class MidOptions extends AbstractOptions {
} }
@Override @Override
public int getLocationMode() {
return 0;
}
@Override
public int getSettingMenuAccount() { public int getSettingMenuAccount() {
return 1; return 1;
} }
...@@ -45,37 +40,12 @@ public class MidOptions extends AbstractOptions { ...@@ -45,37 +40,12 @@ public class MidOptions extends AbstractOptions {
} }
@Override @Override
public int getViewerMenuExit() {
return 1;
}
@Override
public int getViewerMenuIndex() {
return 0;
}
@Override
public int getViewerMenuSearch() {
return 1;
}
@Override
public int getViewerMenuTextcopy() { public int getViewerMenuTextcopy() {
return 0; return 0;
} }
@Override @Override
public int getViewerMenuMemo() {
return 0;
}
@Override
public int getViewerMenuMarking() { public int getViewerMenuMarking() {
return ABVDataCache.getInstance().serviceOption.isMarking() ? 1 : 0; return ABVDataCache.getInstance().serviceOption.isMarking() ? 1 : 0;
} }
@Override
public int getViewerMenuBookmark() {
return 0;
}
} }
package jp.agentec.abook.abv.ui.common.appinfo.options; package jp.agentec.abook.abv.ui.common.appinfo.options;
import jp.agentec.abook.abv.bl.common.Constant.ContractScale;
import jp.agentec.abook.abv.bl.data.ABVDataCache; import jp.agentec.abook.abv.bl.data.ABVDataCache;
import jp.agentec.abook.abv.launcher.android.R; import jp.agentec.abook.abv.launcher.android.R;
import android.content.Context; import android.content.Context;
...@@ -14,34 +13,9 @@ public class Options { ...@@ -14,34 +13,9 @@ public class Options {
public static IOptions getInstance(Context context) { public static IOptions getInstance(Context context) {
ABVDataCache cache = ABVDataCache.getInstance(); ABVDataCache cache = ABVDataCache.getInstance();
if (context.getResources().getBoolean(R.bool.follow_service_option)) {
if (cache.serviceOption.isCatalogEdition()) {
switch (cache.serviceOption.getContractScale()) {
case ContractScale.Large:
if (!(options instanceof LargeOptions)) {
options = new LargeOptions(context);
}
break;
case ContractScale.Mid:
if (!(options instanceof MidOptions)) {
options = new MidOptions(context);
}
break;
default:
if (!(options instanceof DefaultOptions)) {
options = new DefaultOptions(context);
}
}
} else {
if (!(options instanceof ABVFunctionOptions)) { if (!(options instanceof ABVFunctionOptions)) {
options = new ABVFunctionOptions(context); options = new ABVFunctionOptions(context);
} }
}
} else {
if (!(options instanceof ABVFunctionOptions)) {
options = new ABVFunctionOptions(context);
}
}
return options; return options;
} }
} }
...@@ -2,7 +2,6 @@ package jp.agentec.abook.abv.ui.common.helper; ...@@ -2,7 +2,6 @@ package jp.agentec.abook.abv.ui.common.helper;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date;
import java.util.List; import java.util.List;
import jp.agentec.abook.abv.bl.common.ABVEnvironment; import jp.agentec.abook.abv.bl.common.ABVEnvironment;
...@@ -12,11 +11,8 @@ import jp.agentec.abook.abv.bl.common.log.Logger; ...@@ -12,11 +11,8 @@ import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.data.ABVDataCache; 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.AbstractDao;
import jp.agentec.abook.abv.bl.data.dao.ContentDao; import jp.agentec.abook.abv.bl.data.dao.ContentDao;
import jp.agentec.abook.abv.bl.data.dao.SubscriptionHistoryDao;
import jp.agentec.abook.abv.bl.dto.ContentDto; import jp.agentec.abook.abv.bl.dto.ContentDto;
import jp.agentec.abook.abv.bl.dto.SubscriptionHistoryDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic; import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.SubscriptionHistoryLogic;
import jp.agentec.abook.abv.cl.billing.IabException; import jp.agentec.abook.abv.cl.billing.IabException;
import jp.agentec.abook.abv.cl.billing.IabHelper; import jp.agentec.abook.abv.cl.billing.IabHelper;
import jp.agentec.abook.abv.cl.billing.IabResult; import jp.agentec.abook.abv.cl.billing.IabResult;
...@@ -24,8 +20,6 @@ import jp.agentec.abook.abv.cl.billing.Inventory; ...@@ -24,8 +20,6 @@ import jp.agentec.abook.abv.cl.billing.Inventory;
import jp.agentec.abook.abv.cl.billing.Purchase; import jp.agentec.abook.abv.cl.billing.Purchase;
import jp.agentec.abook.abv.cl.billing.SkuDetails; import jp.agentec.abook.abv.cl.billing.SkuDetails;
import jp.agentec.abook.abv.launcher.android.R; import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.DateTimeUtil.DateUnit;
import jp.agentec.adf.util.StringUtil; import jp.agentec.adf.util.StringUtil;
import android.app.Activity; import android.app.Activity;
import android.app.AlertDialog; import android.app.AlertDialog;
...@@ -328,37 +322,6 @@ public class BillingHelper { ...@@ -328,37 +322,6 @@ public class BillingHelper {
if (purchase.getItemType().equals(IabHelper.ITEM_TYPE_INAPP)) { // 単品購入の場合 if (purchase.getItemType().equals(IabHelper.ITEM_TYPE_INAPP)) { // 単品購入の場合
AbstractDao.getDao(ContentDao.class).updatePurchaseStateBySku(purchase.getSku(), purchase.getPurchaseState(), purchase.getToken()); AbstractDao.getDao(ContentDao.class).updatePurchaseStateBySku(purchase.getSku(), purchase.getPurchaseState(), purchase.getToken());
} }
else { // 定期購読の場合
ABVEnvironment.getInstance().allSubscriptionProductId = null; // 購入済みなので購入不可に変更
SubscriptionHistoryDao subscriptionHistoryDao = AbstractDao.getDao(SubscriptionHistoryDao.class);
SubscriptionHistoryDto subscriptionHistoryDto = subscriptionHistoryDao.findByPurchaseToken(purchase.getToken());
if (subscriptionHistoryDto == null) {
subscriptionHistoryDto = new SubscriptionHistoryDto();
subscriptionHistoryDto.packageName = purchase.getPackageName();
subscriptionHistoryDto.developerPayload = purchase.getDeveloperPayload();
subscriptionHistoryDto.orderId = purchase.getOrderId();
subscriptionHistoryDto.purchaseTime = purchase.getPurchaseTime();
subscriptionHistoryDto.purchaseState = purchase.getPurchaseState();
subscriptionHistoryDto.purchaseToken = purchase.getToken();
subscriptionHistoryDto.productId = purchase.getSku();
subscriptionHistoryDto.startTimeMillis = purchase.getPurchaseTime(); // 仮の値を入れる
// この時点でYearlyかMonthlyかを判断することができないので、後でサーバでAPIで取得したデータで上書きされることになる。 TODO: 新着更新以外でも定期購読更新を実行した方がよい
subscriptionHistoryDto.expiryTimeMillis = DateTimeUtil.add(new Date(purchase.getPurchaseTime()), DateUnit.Month, 1).getTime();
subscriptionHistoryDto.allFlg = 1;
subscriptionHistoryDto.sentFlg = 0;
subscriptionHistoryDto.delFlg = 0;
AbstractDao.getDao(SubscriptionHistoryDao.class).insert(subscriptionHistoryDto);
}
}
try {
// サーバに履歴を送信する。未送信のものをまとめて送る。
AbstractLogic.getLogic(SubscriptionHistoryLogic.class).sendHistory();
} catch (AcmsException e) {
Logger.e(TAG, "sendHistory failed.", e);
Toast.makeText(act, R.string.S_E_ACMS_0500, Toast.LENGTH_SHORT).show();
} catch (NetworkDisconnectedException e) {
Toast.makeText(act, R.string.NETWORK, Toast.LENGTH_SHORT).show();
}
// 画面リフレッシュ // 画面リフレッシュ
refreshContentList(purchase); refreshContentList(purchase);
......
...@@ -99,7 +99,6 @@ public class Initializer { ...@@ -99,7 +99,6 @@ public class Initializer {
env.websocketServerWsUrl = s(R.string.websocket_server_ws_url); env.websocketServerWsUrl = s(R.string.websocket_server_ws_url);
} }
env.isCheckInvalidPasswordLimit = b(R.bool.is_check_invalid_passward_limit); env.isCheckInvalidPasswordLimit = b(R.bool.is_check_invalid_passward_limit);
env.editionType = i(R.integer.edition_type);
env.isContentProtected = b(R.bool.content_protected); env.isContentProtected = b(R.bool.content_protected);
env.isPdfThumbnailOutput = b(R.bool.pdf_thumbnail_output); env.isPdfThumbnailOutput = b(R.bool.pdf_thumbnail_output);
env.defaultLogName = s(R.string.default_log_name); env.defaultLogName = s(R.string.default_log_name);
......
...@@ -35,7 +35,6 @@ import jp.agentec.abook.abv.bl.acms.client.AcmsClient; ...@@ -35,7 +35,6 @@ import jp.agentec.abook.abv.bl.acms.client.AcmsClient;
import jp.agentec.abook.abv.bl.acms.client.parameters.AppLastVersionParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.AppLastVersionParameters;
import jp.agentec.abook.abv.bl.acms.type.AcmsApis; import jp.agentec.abook.abv.bl.acms.type.AcmsApis;
import jp.agentec.abook.abv.bl.acms.type.LoginMode; import jp.agentec.abook.abv.bl.acms.type.LoginMode;
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.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.CommonExecutor; import jp.agentec.abook.abv.bl.common.CommonExecutor;
import jp.agentec.abook.abv.bl.common.Constant; import jp.agentec.abook.abv.bl.common.Constant;
...@@ -43,19 +42,15 @@ import jp.agentec.abook.abv.bl.common.constant.ABookKeys; ...@@ -43,19 +42,15 @@ import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.log.Logger; import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.data.ABVDataCache; import jp.agentec.abook.abv.bl.data.ABVDataCache;
import jp.agentec.abook.abv.bl.dto.MemberInfoDto; import jp.agentec.abook.abv.bl.dto.MemberInfoDto;
import jp.agentec.abook.abv.bl.dto.ServiceOptionDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic; import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.ContractLogic; import jp.agentec.abook.abv.bl.logic.ContractLogic;
import jp.agentec.abook.abv.bl.logic.UserAuthenticateLogic; import jp.agentec.abook.abv.bl.logic.UserAuthenticateLogic;
import jp.agentec.abook.abv.cl.helper.ABVUncaughtExceptionHandler; import jp.agentec.abook.abv.cl.helper.ABVUncaughtExceptionHandler;
import jp.agentec.abook.abv.cl.util.PreferenceUtil; import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.cl.util.RawResourceUtil; import jp.agentec.abook.abv.cl.util.RawResourceUtil;
import jp.agentec.abook.abv.launcher.android.AutoDownloadService;
import jp.agentec.abook.abv.launcher.android.OnAppDownloadReceiver; import jp.agentec.abook.abv.launcher.android.OnAppDownloadReceiver;
import jp.agentec.abook.abv.launcher.android.R; import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.DefPrefKey;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.PrefName;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.UserPrefKey; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.UserPrefKey;
import jp.agentec.abook.abv.ui.common.appinfo.options.Options; import jp.agentec.abook.abv.ui.common.appinfo.options.Options;
import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog; import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog;
...@@ -74,10 +69,6 @@ public class ABookSettingFragment extends PreferenceFragment { ...@@ -74,10 +69,6 @@ public class ABookSettingFragment extends PreferenceFragment {
private static final String LOG_INFO = "log_info"; private static final String LOG_INFO = "log_info";
private static final String APP_INFO = "app_info"; private static final String APP_INFO = "app_info";
// 会議室設定
private static final String CHAIRMAN_MARKING_SHARE = "charmanMarkingShare";
private static final String MARKING_SHARE_AUTO_SAVE = "markingShareAutoSave";
// アカウント // アカウント
private static final String ACCOUNT_PATH = "accountPath"; private static final String ACCOUNT_PATH = "accountPath";
private static final String LOGINID = "loginid"; private static final String LOGINID = "loginid";
...@@ -85,18 +76,12 @@ public class ABookSettingFragment extends PreferenceFragment { ...@@ -85,18 +76,12 @@ public class ABookSettingFragment extends PreferenceFragment {
private static final String PASSWORD_CHANGE = "passwordChange"; private static final String PASSWORD_CHANGE = "passwordChange";
private static final String LOGOUT = "logout"; private static final String LOGOUT = "logout";
// データ管理
private static final String BACKUP = "backup";
private static final String RESTORE = "restore";
private static final String RESTORE_PURCHASE_HISTORY = "restore_purchase_history";
// ログ情報 // ログ情報
private static final String EXPORT = "export"; private static final String EXPORT = "export";
private static final String ERROR_SEND_ENABLE = "errorSendEnable"; private static final String ERROR_SEND_ENABLE = "errorSendEnable";
// アプリ情報 // アプリ情報
private static final String LICENSE_INFO = "licenseInfo"; private static final String LICENSE_INFO = "licenseInfo";
private static final String TERM_OF_USE = "termOfUse";
private static final String CHECK_APP_UPDATE = "checkAppUpdate"; private static final String CHECK_APP_UPDATE = "checkAppUpdate";
private static final String ABOUT_A_BOOK = "aboutABook"; private static final String ABOUT_A_BOOK = "aboutABook";
private static final String ABOOK_CHECK_MANUAL = "abookCheckManual"; private static final String ABOOK_CHECK_MANUAL = "abookCheckManual";
...@@ -112,13 +97,6 @@ public class ABookSettingFragment extends PreferenceFragment { ...@@ -112,13 +97,6 @@ public class ABookSettingFragment extends PreferenceFragment {
handler = new Handler(); handler = new Handler();
pref = PreferenceManager.getDefaultSharedPreferences(getActivity()); pref = PreferenceManager.getDefaultSharedPreferences(getActivity());
// 自動DLの初期値を設定する(レイアウトをセットした時点でPreferenceが保存されてしまうのでその前の段階で行う)
ServiceOptionDto dto = ABVDataCache.getInstance().getServiceOption(ServiceOptionId.AutoDownload);
if (!contains(DefPrefKey.AUTO_DOWNLOAD)) {
if (dto != null && "2".equals(dto.val)) {// 0:自動DL無効、1:自動DL有効&初期値はOFF、2:自動DL有効&初期値はON
put(DefPrefKey.AUTO_DOWNLOAD, true);
}
}
addPreferencesFromResource(R.xml.pref); addPreferencesFromResource(R.xml.pref);
// アカウント // アカウント
setAccountSetting(); setAccountSetting();
...@@ -280,20 +258,6 @@ public class ABookSettingFragment extends PreferenceFragment { ...@@ -280,20 +258,6 @@ public class ABookSettingFragment extends PreferenceFragment {
SharedPreferences sharedPreferences = getActivity().getSharedPreferences(AppDefType.PrefName.USER_PREFERENCE, Context.MODE_PRIVATE); SharedPreferences sharedPreferences = getActivity().getSharedPreferences(AppDefType.PrefName.USER_PREFERENCE, Context.MODE_PRIVATE);
sharedPreferences.edit().remove(AppDefType.UserPrefKey.GUEST_LOGIN).commit(); sharedPreferences.edit().remove(AppDefType.UserPrefKey.GUEST_LOGIN).commit();
if(getResources().getInteger(R.integer.download_service_check) == 1) {
//AlarmServiceをキャンセル
Intent intentService = new Intent(getActivity().getApplicationContext(), AutoDownloadService.class);
PendingIntent pendingIntent = PendingIntent.getService(getActivity().getApplicationContext(), -1, intentService, PendingIntent.FLAG_UPDATE_CURRENT);
AlarmManager alarmManager = (AlarmManager)getActivity().getApplicationContext().getSystemService(Context.ALARM_SERVICE);
alarmManager.cancel(pendingIntent);
//ダウンロード履歴削除
SharedPreferences preferences = getActivity().getSharedPreferences(PrefName.AUTODOWNLOAD_INFO, Context.MODE_PRIVATE);
SharedPreferences.Editor editor = preferences.edit();
editor.clear();
editor.commit();
}
Intent intent = new Intent(getActivity(), LoginActivity.class); Intent intent = new Intent(getActivity(), LoginActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
startActivity(intent); startActivity(intent);
...@@ -326,9 +290,6 @@ public class ABookSettingFragment extends PreferenceFragment { ...@@ -326,9 +290,6 @@ public class ABookSettingFragment extends PreferenceFragment {
return true; return true;
} }
}); });
if (Options.getInstance(getActivity()).getSettingMenuErrorSend() == 0) {
remove((PreferenceGroup)findPreference(LOG_INFO), ERROR_SEND_ENABLE);
}
} }
private void setAppInfoSetting() { private void setAppInfoSetting() {
...@@ -355,20 +316,6 @@ public class ABookSettingFragment extends PreferenceFragment { ...@@ -355,20 +316,6 @@ public class ABookSettingFragment extends PreferenceFragment {
} }
}); });
// 利用規約
Preference termOfUse = findPreference(TERM_OF_USE);
if (ABVDataCache.getInstance().serviceOption.isPayment()) {
termOfUse.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
showTermOfUseDialog();
return true;
}
});
} else {
appInfo.removePreference(termOfUse);
}
// アップデート確認 // アップデート確認
Preference checkAppUpdate = findPreference(CHECK_APP_UPDATE); Preference checkAppUpdate = findPreference(CHECK_APP_UPDATE);
if (getResources().getInteger(R.integer.check_app_update) == 1) { if (getResources().getInteger(R.integer.check_app_update) == 1) {
......
...@@ -609,10 +609,8 @@ public class GuideViewActivity extends ABVContentViewActivity { ...@@ -609,10 +609,8 @@ public class GuideViewActivity extends ABVContentViewActivity {
private void unlimitViewer() { private void unlimitViewer() {
overlapLayout.setVisibility(View.GONE); overlapLayout.setVisibility(View.GONE);
if (Options.getInstance(this).getViewerMenuExit() == 1) {
mExitBtn.setVisibility(View.VISIBLE); mExitBtn.setVisibility(View.VISIBLE);
} }
}
private void initRemoteLayout() { private void initRemoteLayout() {
overlapLayout = new RelativeLayout(this); overlapLayout = new RelativeLayout(this);
...@@ -831,47 +829,6 @@ public class GuideViewActivity extends ABVContentViewActivity { ...@@ -831,47 +829,6 @@ public class GuideViewActivity extends ABVContentViewActivity {
mMainLayout.addView(mToolBar, param1); mMainLayout.addView(mToolBar, param1);
} }
private void showPdfSendMailDialog(final DownloadedContentInfoJSON json) {
String fileName = mContentJSON.getPdfFileName();
String filepath = mContentDir + "/" + fileName;
File pdfFile = new File(filepath);
final Uri fileUri = Uri.parse("content://" + getPackageName() + ".pdffileprovider/" + contentId + "/" + fileName);
ABookAlertDialog messageDialog;
long L = pdfFile.length();
if (L > 20971520) {
//20메가 보다 큰 경우 송신 못한다고 메일 보냄
messageDialog = AlertDialogUtil.createAlertDialog(this, getString(R.string.pdf_mail), getString(R.string.mail_size_over));
messageDialog.setPositiveButton(R.string.ok, null);
} else {
//다 통과... 이제 보낼껀지 체크하는 팝업
messageDialog = AlertDialogUtil.createAlertDialog(this, getString(R.string.pdf_mail), getString(R.string.mail_submit));
messageDialog.setNegativeButton(R.string.cancel, null);
messageDialog.setPositiveButton(R.string.ok,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
sendPDF(json, fileUri);
}
});
}
messageDialog.show();
return;
}
private void sendPDF(DownloadedContentInfoJSON json, Uri fileUri){
PDFFileProvider.expired = DateTimeUtil.add(new Date(), DateUnit.Minute, 60);
Intent it = new Intent(Intent.ACTION_SEND);
it.setType("plain/text");
it.putExtra(Intent.EXTRA_SUBJECT, json.contentName);
it.putExtra(Intent.EXTRA_TEXT, json.contentName + getResources().getString(R.string.send_to));
it.putExtra(Intent.EXTRA_STREAM, fileUri);
startActivity(it);
}
private void setMarkingViewVisibility(boolean visible){ private void setMarkingViewVisibility(boolean visible){
for (MarkingView markingView : mMarkingViewList) { for (MarkingView markingView : mMarkingViewList) {
if (visible) { if (visible) {
......
package jp.agentec.abook.abv.ui.home.activity; package jp.agentec.abook.abv.ui.home.activity;
import jp.agentec.abook.abv.bl.acms.client.json.reader.CmsUrlJSON; import jp.agentec.abook.abv.bl.acms.client.json.CmsUrlJSON;
import jp.agentec.abook.abv.bl.acms.type.DeleteDataType; import jp.agentec.abook.abv.bl.acms.type.DeleteDataType;
import jp.agentec.abook.abv.bl.acms.type.LoginMode; 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.LoginStatus;
...@@ -18,7 +18,6 @@ import jp.agentec.abook.abv.bl.common.log.Logger; ...@@ -18,7 +18,6 @@ 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.AbstractDao;
import jp.agentec.abook.abv.bl.data.dao.AcmsDao; import jp.agentec.abook.abv.bl.data.dao.AcmsDao;
import jp.agentec.abook.abv.bl.data.dao.MemberInfoDao; import jp.agentec.abook.abv.bl.data.dao.MemberInfoDao;
import jp.agentec.abook.abv.bl.data.dao.SearchHistoryDao;
import jp.agentec.abook.abv.bl.download.ContentRefresher; import jp.agentec.abook.abv.bl.download.ContentRefresher;
import jp.agentec.abook.abv.bl.dto.MemberInfoDto; import jp.agentec.abook.abv.bl.dto.MemberInfoDto;
import jp.agentec.abook.abv.bl.dto.PasswordLockInfoDto; import jp.agentec.abook.abv.bl.dto.PasswordLockInfoDto;
...@@ -706,9 +705,6 @@ public class LoginActivity extends ABVLoginActivity { ...@@ -706,9 +705,6 @@ public class LoginActivity extends ABVLoginActivity {
ProjectLogic projectLogic = AbstractLogic.getLogic(ProjectLogic.class); ProjectLogic projectLogic = AbstractLogic.getLogic(ProjectLogic.class);
projectLogic.deleteAllProject(); projectLogic.deleteAllProject();
memberInfoDao.deleteMemberContentInfo(isAllDelete); memberInfoDao.deleteMemberContentInfo(isAllDelete);
// バグ対応:ユーザ切り替え時検索結果の履歴が削除する。
SearchHistoryDao searchHistoryDao = AbstractDao.getDao(SearchHistoryDao.class);
searchHistoryDao.deleteAllSearchHistory();
// MacAddress取得回答はOK済みと見なす // MacAddress取得回答はOK済みと見なす
Editor editor = PreferenceUtil.getUserEditor(this); Editor editor = PreferenceUtil.getUserEditor(this);
......
...@@ -46,8 +46,8 @@ import java.util.List; ...@@ -46,8 +46,8 @@ import java.util.List;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
import jp.agentec.abook.abv.bl.acms.client.AcmsClient; import jp.agentec.abook.abv.bl.acms.client.AcmsClient;
import jp.agentec.abook.abv.bl.acms.client.json.check.ProjectDataJSON; import jp.agentec.abook.abv.bl.acms.client.json.ProjectDataJSON;
import jp.agentec.abook.abv.bl.acms.client.json.check.ProjectInspectDataJSON; import jp.agentec.abook.abv.bl.acms.client.json.ProjectInspectDataJSON;
import jp.agentec.abook.abv.bl.acms.client.parameters.GetProjectDataParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.GetProjectDataParameters;
import jp.agentec.abook.abv.bl.acms.type.DownloadStatusType; import jp.agentec.abook.abv.bl.acms.type.DownloadStatusType;
import jp.agentec.abook.abv.bl.acms.type.ProjectAuthLevel; import jp.agentec.abook.abv.bl.acms.type.ProjectAuthLevel;
......
...@@ -19,7 +19,7 @@ import java.util.List; ...@@ -19,7 +19,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import jp.agentec.abook.abv.bl.acms.client.AcmsClient; import jp.agentec.abook.abv.bl.acms.client.AcmsClient;
import jp.agentec.abook.abv.bl.acms.client.json.check.ProjectDataJSON; import jp.agentec.abook.abv.bl.acms.client.json.ProjectDataJSON;
import jp.agentec.abook.abv.bl.acms.client.parameters.GetProjectDataParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.GetProjectDataParameters;
import jp.agentec.abook.abv.bl.acms.type.ProjectAuthLevel; import jp.agentec.abook.abv.bl.acms.type.ProjectAuthLevel;
import jp.agentec.abook.abv.bl.common.ABVEnvironment; import jp.agentec.abook.abv.bl.common.ABVEnvironment;
......
...@@ -182,11 +182,6 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve ...@@ -182,11 +182,6 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
public void startContentActivity(Context context, Intent intent, NaviConsts aBVNavi, Integer flags, long contentId) throws Exception { public void startContentActivity(Context context, Intent intent, NaviConsts aBVNavi, Integer flags, long contentId) throws Exception {
Logger.i(TAG, "startContentActivity contentId=" + contentId + " intent=" + intent); Logger.i(TAG, "startContentActivity contentId=" + contentId + " intent=" + intent);
if (isStreaming(contentId, intent)) {
startStreamingActivity(getCurrentActivity(), intent, contentId);
return;
}
String path = ContentFileExtractor.getInstance().getContentCacheDirWithExtract(contentId); String path = ContentFileExtractor.getInstance().getContentCacheDirWithExtract(contentId);
if (path == null) { if (path == null) {
Logger.e(TAG, "startContentActivity: JSON Data is Null.mContentDir=" + null); Logger.e(TAG, "startContentActivity: JSON Data is Null.mContentDir=" + null);
...@@ -285,66 +280,6 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve ...@@ -285,66 +280,6 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
}); });
} }
/**
* ストリーミングかどうかを判断する
* サービスオプション、コンテンツの指定がダウンロードの場合か、ダウンロードが完了しているか、
* さもなければストリーミングとみなす。(ここでは選択はなし)
*
* @param intent
*/
private boolean isStreaming(long contentId, Intent intent) {
if (intent.hasExtra(ABVActivity.IS_STREAMING)) {
return true;
}
int deliveryType = ABVDataCache.getInstance().serviceOption.getDeliveryType();
ContentDto contentDto = contentDao.getContent(contentId);
if (deliveryType == DeliveryType.DOWNLOAD || (deliveryType != DeliveryType.STREAMING && contentDto.deliveryType == DeliveryType.DOWNLOAD)) {
return false;
}
return !contentDto.downloadedFlg;
}
public void startStreamingActivity(final ABVAuthenticatedActivity activity, final Intent intentParam, final long contentId) {
if (!checkOwner(activity)) {
return;
}
// アラートを表示する設定かつ3G回線がアクティブの場合警告を表示
try {
activity.showWifiDisconnectAlert(R.string.C_E_SYSTEM_0005, R.string.streaming, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
ContentDto contentDto = contentDao.getContent(contentId);
Intent intent = (intentParam != null) ? intentParam : new Intent();
String baseUrl = ABVEnvironment.getInstance().acmsAddress + "webvw/stview.html?cid=%s&page=%s&sid=%s";
String url = String.format(baseUrl, contentId, intent.getIntExtra("page", 0), ABVDataCache.getInstance().getMemberInfo().sid);
Logger.d(TAG, "Streaming URL=%s", url);
if (StringUtil.equals(contentDto.contentType, ContentJSON.KEY_PANO_MOVIE_TYPE) && Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { // 360°動画の場合Chromeで表示
startChrome(activity, url);
return;
}
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra(ABookKeys.CONTENT_ID, contentId);
intent.putExtra("isStreaming", true);
intent.putExtra("isDownloadable", (!contentDto.downloadedFlg || contentDto.updatedFlg) && contentDto.deliveryType != DeliveryType.STREAMING);
intent.putExtra("isUpdate", contentDto.downloadedFlg && contentDto.updatedFlg);
intent.putExtra(ABookKeys.CONTENT_TYPE, contentDto.contentType);
intent.putExtra(ABookKeys.CONTENT_NAME, contentDto.contentName);
startHTMLWebActivity(activity, intent, url, contentId, -1, -1, -1, -1,-1);
}
}, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
} catch (NetworkDisconnectedException e) {
Logger.e(TAG, "NetworkDisconnectedException" + e);
activity.handleErrorMessageToast(ErrorCode.NETWORK);
}
}
private void startActivity(Context context, Intent intent, NaviConsts ABVNavi, Integer flags, long contentId, String contentType, String path) throws Exception { private void startActivity(Context context, Intent intent, NaviConsts ABVNavi, Integer flags, long contentId, String contentType, String path) throws Exception {
contentRefresher.stopRefresh(); // 新着更新を停止する contentRefresher.stopRefresh(); // 新着更新を停止する
if (intent == null) { if (intent == null) {
...@@ -1111,35 +1046,11 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve ...@@ -1111,35 +1046,11 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
} }
public boolean isDownloadEnable(ContentDto contentDto) { public boolean isDownloadEnable(ContentDto contentDto) {
return !isStreamingOnly(contentDto) && !contentDto.downloadedFlg; return !contentDto.downloadedFlg;
} }
public boolean isUpdateEnable(ContentDto contentDto) { public boolean isUpdateEnable(ContentDto contentDto) {
return !isStreamingOnly(contentDto) && contentDto.updatedFlg; return contentDto.updatedFlg;
}
private boolean isStreamingOnly(ContentDto contentDto) {
return ContentViewHelper.getInstance().isStreamingOnly(contentDto);
}
public boolean isStreamingEnable(ContentDto contentDto) {
int deliveryType = ABVDataCache.getInstance().serviceOption.getDeliveryType();
if (deliveryType == DeliveryType.DOWNLOAD || (deliveryType != DeliveryType.STREAMING && contentDto.deliveryType == DeliveryType.DOWNLOAD)) {
return false;
}
return !(!contentDto.updatedFlg && contentDto.downloadedFlg);
}
public boolean isStreamingPriority(ContentDto contentDto) {
if (isStreamingOnly(contentDto)) { // ストリーミングのみの時true
return true;
}
if (!isStreamingEnable(contentDto)) { // ダウンロードが優先の時true
return false;
}
// 選択が可能な場合、設定の優先に従って変更
return PreferenceUtil.getInt(mContext, DefPrefKey.TAP_ACTION_ON_DELIVERY_SELECT, "2") == DeliveryType.STREAMING;
} }
public void downloadUnAuthorizedContentInfo(long contentId) { public void downloadUnAuthorizedContentInfo(long contentId) {
...@@ -1173,13 +1084,10 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve ...@@ -1173,13 +1084,10 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
} }
if (meetingManager.isSubscribed() // 会議室参加者の場合: ストリーミング優先、リンクコンテンツ、その他タイプのとき不可Ha if (meetingManager.isSubscribed() // 会議室参加者の場合: ストリーミング優先、リンクコンテンツ、その他タイプのとき不可Ha
&& (isStreamingPriority(contentDto) || contentDto.isLinkType() || contentDto.isOtherType())) { && (contentDto.isLinkType() || contentDto.isOtherType())) {
showToast(mContext.getString(R.string.msg_content_not_allowed_at_meeting)); showToast(mContext.getString(R.string.msg_content_not_allowed_at_meeting));
return false; return false;
} else { } else {
if (isStreamingPriority(contentDto)) { // ストリーミングの場合OKで返す(会議室参加の場合はstartContentViewActivityで弾かれる)
return true;
}
handleDownload(contentId, contentDto); // DLを行ったのち開く handleDownload(contentId, contentDto); // DLを行ったのち開く
return false; return false;
} }
......
...@@ -44,20 +44,12 @@ public class ContentViewHelper { ...@@ -44,20 +44,12 @@ public class ContentViewHelper {
} else if (linkContentDto.downloadedFlg) { } else if (linkContentDto.downloadedFlg) {
// ダウンロード済み // ダウンロード済み
return LinkContentStatus.DownloadedContent; return LinkContentStatus.DownloadedContent;
} else if (isStreamingOnly(linkContentDto)) {
// Streamingコンテンツ
return LinkContentStatus.StreamingContent;
} else { } else {
// コンテンツ詳細を表示 // コンテンツ詳細を表示
return LinkContentStatus.StartContentDownloadAndStart; return LinkContentStatus.StartContentDownloadAndStart;
} }
} }
public boolean isStreamingOnly(ContentDto contentDto) {
int deliveryType = ABVDataCache.getInstance().serviceOption.getDeliveryType();
return deliveryType == DeliveryType.STREAMING || (deliveryType != DeliveryType.DOWNLOAD && contentDto.deliveryType == DeliveryType.STREAMING);
}
/** /**
* Panoコンテンツタイプのチェック * Panoコンテンツタイプのチェック
* @param contentId * @param contentId
......
...@@ -282,23 +282,6 @@ public class CheckOZDViewActivity extends ABVContentViewActivity { ...@@ -282,23 +282,6 @@ public class CheckOZDViewActivity extends ABVContentViewActivity {
// } // }
} }
private void showPdfSendMailDialog(final DownloadedContentInfoJSON json) {
ABookAlertDialog alert = AlertDialogUtil.createAlertDialog(this, getString(R.string.pdf_mail), getString(R.string.mail_submit));
alert.setNegativeButton(R.string.cancel, null);
alert.setPositiveButton(R.string.ok,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
if (exportViewer(getSaveParam("pdf"))) {
sendPDF(json);
}
}
});
alert.show();
return;
}
private void sendPDF(DownloadedContentInfoJSON json) { // PDFファイルメールで送信 private void sendPDF(DownloadedContentInfoJSON json) { // PDFファイルメールで送信
PDFFileProvider.expired = DateTimeUtil.add(new Date(), DateTimeUtil.DateUnit.Minute, 60); PDFFileProvider.expired = DateTimeUtil.add(new Date(), DateTimeUtil.DateUnit.Minute, 60);
......
...@@ -781,7 +781,7 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -781,7 +781,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
mBtnMeetingRoomSetting.setVisibility(View.GONE); mBtnMeetingRoomSetting.setVisibility(View.GONE);
} }
if (Options.getInstance(this).getViewerMenuExit() == 1 && !(isProjectPdf())) { if (!isProjectPdf()) {
mExitBtn.setVisibility(View.VISIBLE); mExitBtn.setVisibility(View.VISIBLE);
} }
} }
...@@ -1008,7 +1008,7 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -1008,7 +1008,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
} }
}); });
if (Options.getInstance(this).getViewerMenuExit() == 0 || isProjectPdf()) { if (isProjectPdf()) {
mExitBtn.setVisibility(View.GONE); mExitBtn.setVisibility(View.GONE);
} }
...@@ -1032,7 +1032,7 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -1032,7 +1032,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
ImageButton indexBtn = (ImageButton) mToolBar.findViewById(R.id.btn_index_list); ImageButton indexBtn = (ImageButton) mToolBar.findViewById(R.id.btn_index_list);
if ((Options.getInstance(this).getViewerMenuBookmark() == 1 || Options.getInstance(this).getViewerMenuIndex() == 1) && !(isProjectPdf())) { if (!isProjectPdf()) {
indexBtn.setOnClickListener(new OnClickListener() { indexBtn.setOnClickListener(new OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
...@@ -1044,10 +1044,8 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -1044,10 +1044,8 @@ public class ContentViewActivity extends ABVContentViewActivity {
} }
final ArrayList<String> menuNameList = new ArrayList<>(); final ArrayList<String> menuNameList = new ArrayList<>();
if (Options.getInstance(ContentViewActivity.this).getViewerMenuBookmark() == 1) {
menuNameList.add(getRString(R.string.bookmark)); menuNameList.add(getRString(R.string.bookmark));
} if (mContentJSON.isPdf()) {
if (Options.getInstance(ContentViewActivity.this).getViewerMenuIndex() == 1 && mContentJSON.isPdf()) {
menuNameList.add(getRString(R.string.index)); menuNameList.add(getRString(R.string.index));
} }
...@@ -1127,7 +1125,7 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -1127,7 +1125,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
// 検索 // 検索
ImageButton search = (ImageButton) mToolBar.findViewById(R.id.btn_search); ImageButton search = (ImageButton) mToolBar.findViewById(R.id.btn_search);
if (Options.getInstance(this).getViewerMenuSearch() == 1 && !(isProjectPdf())) { if (!isProjectPdf()) {
search.setOnClickListener(new View.OnClickListener() { search.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
...@@ -1162,7 +1160,7 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -1162,7 +1160,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
final long bookContentId = getContentId(); final long bookContentId = getContentId();
final ImageButton bookmark = (ImageButton) mToolBar.findViewById(R.id.btn_bookmark); final ImageButton bookmark = (ImageButton) mToolBar.findViewById(R.id.btn_bookmark);
if (Options.getInstance(this).getViewerMenuBookmark() == 1 && !(isProjectPdf())) { if (!isProjectPdf()) {
bookmark.setOnClickListener(new View.OnClickListener() { bookmark.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
...@@ -1362,47 +1360,6 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -1362,47 +1360,6 @@ public class ContentViewActivity extends ABVContentViewActivity {
} }
} }
private void showPdfSendMailDialog(final DownloadedContentInfoJSON json) {
String fileName = mContentJSON.getPdfFileName();
String filepath = mContentDir + "/" + fileName;
File pdfFile = new File(filepath);
final Uri fileUri = Uri.parse("content://" + getPackageName() + ".pdffileprovider/" + contentId + "/" + fileName);
ABookAlertDialog messageDialog;
long L = pdfFile.length();
if (L > 20971520) {
//20메가 보다 큰 경우 송신 못한다고 메일 보냄
messageDialog = AlertDialogUtil.createAlertDialog(this, getString(R.string.pdf_mail), getString(R.string.mail_size_over));
messageDialog.setPositiveButton(R.string.ok, null);
} else {
//다 통과... 이제 보낼껀지 체크하는 팝업
messageDialog = AlertDialogUtil.createAlertDialog(this, getString(R.string.pdf_mail), getString(R.string.mail_submit));
messageDialog.setNegativeButton(R.string.cancel, null);
messageDialog.setPositiveButton(R.string.ok,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
sendPDF(json, fileUri);
}
});
}
messageDialog.show();
return;
}
private void sendPDF(DownloadedContentInfoJSON json, Uri fileUri){
PDFFileProvider.expired = DateTimeUtil.add(new Date(), DateUnit.Minute, 60);
Intent it = new Intent(Intent.ACTION_SEND);
it.setType("plain/text");
it.putExtra(Intent.EXTRA_SUBJECT, json.contentName);
it.putExtra(Intent.EXTRA_TEXT, json.contentName + getResources().getString(R.string.send_to));
it.putExtra(Intent.EXTRA_STREAM, fileUri);
startActivity(it);
}
private void setMarkingViewVisibility(boolean visible){ private void setMarkingViewVisibility(boolean visible){
for (MarkingView markingView : mMarkingViewList) { for (MarkingView markingView : mMarkingViewList) {
if (visible) { if (visible) {
...@@ -2720,9 +2677,6 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -2720,9 +2677,6 @@ public class ContentViewActivity extends ABVContentViewActivity {
ActivityHandlingHelper.getInstance().startHTMLWebActivity(this, null, htmlFilePath, getContentId(), WEBVIEW, pageNumber, actionInfoJSON.getObjectId(), objectLogId, readingLogId); ActivityHandlingHelper.getInstance().startHTMLWebActivity(this, null, htmlFilePath, getContentId(), WEBVIEW, pageNumber, actionInfoJSON.getObjectId(), objectLogId, readingLogId);
break; break;
case ActionInfoJSON.CONTENTLINK_ACTION: case ActionInfoJSON.CONTENTLINK_ACTION:
if (ABVDataCache.getInstance().serviceOption.isPayment()) { // 決済ありの時は無視
break;
}
//コンテンツリンクに紐づいたAction Buttonのイベント //コンテンツリンクに紐づいたAction Buttonのイベント
long linkContentId = actionInfoJSON.getContentId(); long linkContentId = actionInfoJSON.getContentId();
...@@ -2738,7 +2692,6 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -2738,7 +2692,6 @@ public class ContentViewActivity extends ABVContentViewActivity {
break; break;
} }
} }
linkDownloadChecked(linkContentId, (int) actionInfoJSON.getPageNo());
try { try {
if (ActivityHandlingHelper.getInstance().checkContent(linkContentId, (int) actionInfoJSON.getPageNo())) { // コンテンツをチェックし、なければDL後開く if (ActivityHandlingHelper.getInstance().checkContent(linkContentId, (int) actionInfoJSON.getPageNo())) { // コンテンツをチェックし、なければDL後開く
if (isLinkedContent) { if (isLinkedContent) {
...@@ -3775,8 +3728,7 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -3775,8 +3728,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
} else { } else {
ActivityHandlingHelper.getInstance().startHTMLWebActivity(this, null, linkurl, getContentId(), WEBVIEW, pageNumber, objectId, objectLogId, readingLogId); ActivityHandlingHelper.getInstance().startHTMLWebActivity(this, null, linkurl, getContentId(), WEBVIEW, pageNumber, objectId, objectLogId, readingLogId);
} }
} } else {
else {
Intent i = new Intent(Intent.ACTION_VIEW); Intent i = new Intent(Intent.ACTION_VIEW);
if (StringUtil.isNullOrEmpty(linkurl)) { if (StringUtil.isNullOrEmpty(linkurl)) {
linkurl = "http://"; linkurl = "http://";
...@@ -4906,76 +4858,6 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -4906,76 +4858,6 @@ public class ContentViewActivity extends ABVContentViewActivity {
} }
//2012 12 17 Contents link by jeonghun
private void linkDownloadChecked(final long contentId, int page) {
Logger.i(TAG, "linkDownloadChecked targetContentId=" + contentId + " targetPage=" + page);
int result = ContentViewHelper.getInstance().linkDownloadChecked(contentId, page);
switch (result) {
case LinkContentStatus.NoExist:
// コンテンツが存在しない
ABookAlertDialog linknonServerDialog = AlertDialogUtil.createAlertDialog(this, R.string.content_link);
linknonServerDialog.setMessage(R.string.link_new_nonexits);
linknonServerDialog.setPositiveButton(R.string.confirm, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int whichButton) {
dialog.dismiss();
}
});
showAlertDialog(linknonServerDialog);
break;
case LinkContentStatus.BeforeReleaseDate:
{
// 公開日前
ABookAlertDialog linkBeforeReleaseDateDialog = AlertDialogUtil.createAlertDialog(this, R.string.content_link);
linkBeforeReleaseDateDialog.setMessage(R.string.reader_content_download_404);
linkBeforeReleaseDateDialog.setPositiveButton(R.string.confirm, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int whichButton) {
dialog.dismiss();
}
});
showAlertDialog(linkBeforeReleaseDateDialog);
}
break;
case LinkContentStatus.DownloadedContent:
// コンテンツがダウンロード済み
mActivityFinishFlg = true;
allReset();
if (isEnquete) {
isEnquete = false;
mMainLayout.removeView(enqueteLayout);
}
//戻る用のコンテンツIDをセット
getABVUIDataCache().setReturnContentIdList(getContentId(), getCurrentPageNumber());
Intent intent = new Intent();
intent.putExtra("page", page - 1);
Logger.d(TAG, "next page : %s", (page - 1));
if (mProjectId != null) {
intent.putExtra(ABookKeys.PROJECT_ID, mProjectId);
}
startContentViewActivity(intent, contentId);
break;
case LinkContentStatus.StreamingContent:
Intent streamingIntent = new Intent();
streamingIntent.putExtra("page", page - 1);
startStreamingActivity(contentId, streamingIntent);
break;
case LinkContentStatus.StartContentDownloadAndStart:
if (isLinkedContent) {
ActivityHandlingHelper.getInstance().startContentActivityForLinkedConent(mProjectId, contentId, page);
} else {
ActivityHandlingHelper.getInstance().startContentActivity(contentId, page);
}
//戻る用のコンテンツIDをセット
getABVUIDataCache().setReturnContentIdList(contentId, page);
break;
}
}
/** /**
* コンテンツリンク中でコンテンツがない場合、ダウンロードするように * コンテンツリンク中でコンテンツがない場合、ダウンロードするように
* checkContentをもう一度呼び出す * checkContentをもう一度呼び出す
......
...@@ -83,7 +83,6 @@ public class EnqueteWebViewActivity extends ABVContentViewActivity { ...@@ -83,7 +83,6 @@ public class EnqueteWebViewActivity extends ABVContentViewActivity {
private WebView webView; private WebView webView;
private boolean isStreaming;
private Double latitude; private Double latitude;
private Double longitude; private Double longitude;
private JsInf jsInf = new JsInf(); private JsInf jsInf = new JsInf();
...@@ -105,8 +104,7 @@ public class EnqueteWebViewActivity extends ABVContentViewActivity { ...@@ -105,8 +104,7 @@ public class EnqueteWebViewActivity extends ABVContentViewActivity {
// ***** 引数の取得 // ***** 引数の取得
Intent intent = getIntent(); Intent intent = getIntent();
isStreaming = intent.getBooleanExtra(IS_STREAMING, false); if (objectId != -1 || ABVEnvironment.getInstance().disableLogSend) {
if (objectId != -1 || ABVEnvironment.getInstance().disableLogSend || isStreaming) {
// アクションとして起動された場合, Streaming表示の場合ログは記録しない // アクションとして起動された場合, Streaming表示の場合ログは記録しない
readingLogFlg = false; readingLogFlg = false;
} }
...@@ -130,15 +128,6 @@ public class EnqueteWebViewActivity extends ABVContentViewActivity { ...@@ -130,15 +128,6 @@ public class EnqueteWebViewActivity extends ABVContentViewActivity {
this.sendResult = intent.getIntExtra("sendResult", -1);// 1:結果送信 this.sendResult = intent.getIntExtra("sendResult", -1);// 1:結果送信
// ***** WebViewセット // ***** WebViewセット
if (isStreaming) {
findViewById(R.id.webView2).setVisibility(View.GONE);
FrameLayout layout = (FrameLayout) findViewById(R.id.streamingLayout);
layout.setVisibility(View.VISIBLE);
webView = new HTML5WebView(this);
layout.addView(((HTML5WebView)webView).getBrowserLayout(), new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
removeNewFlag();
}
else {
webView = (WebView) findViewById(R.id.webView3); webView = (WebView) findViewById(R.id.webView3);
webView.setVerticalScrollbarOverlay(true); // スクロールバー部分の隙間を消す webView.setVerticalScrollbarOverlay(true); // スクロールバー部分の隙間を消す
// webView.setWebViewClient(new WebViewClient()); // webView.setWebViewClient(new WebViewClient());
...@@ -158,7 +147,6 @@ public class EnqueteWebViewActivity extends ABVContentViewActivity { ...@@ -158,7 +147,6 @@ public class EnqueteWebViewActivity extends ABVContentViewActivity {
settings.setAppCacheEnabled(false); settings.setAppCacheEnabled(false);
settings.setCacheMode(WebSettings.LOAD_NO_CACHE); settings.setCacheMode(WebSettings.LOAD_NO_CACHE);
// webView.loadDataWithBaseURL("", url2, "text/html", "UTF-8", ""); // webView.loadDataWithBaseURL("", url2, "text/html", "UTF-8", "");
}
final RelativeLayout fl = (RelativeLayout) findViewById(R.id.frameTopbar); final RelativeLayout fl = (RelativeLayout) findViewById(R.id.frameTopbar);
...@@ -167,13 +155,8 @@ public class EnqueteWebViewActivity extends ABVContentViewActivity { ...@@ -167,13 +155,8 @@ public class EnqueteWebViewActivity extends ABVContentViewActivity {
closeButton.setOnClickListener(new View.OnClickListener() { closeButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
if (isStreaming) {
callExistsSendLog();
}
else {
finishActivity(); finishActivity();
} }
}
}); });
// ***** リンク元コンテンツへ戻るボタン // ***** リンク元コンテンツへ戻るボタン
...@@ -262,7 +245,6 @@ public class EnqueteWebViewActivity extends ABVContentViewActivity { ...@@ -262,7 +245,6 @@ public class EnqueteWebViewActivity extends ABVContentViewActivity {
} }
}); });
if (!isStreaming) {
webView.setWebChromeClient(new WebChromeClient() { webView.setWebChromeClient(new WebChromeClient() {
@Override @Override
public void onProgressChanged(WebView view, int newProgress) { public void onProgressChanged(WebView view, int newProgress) {
...@@ -273,7 +255,7 @@ public class EnqueteWebViewActivity extends ABVContentViewActivity { ...@@ -273,7 +255,7 @@ public class EnqueteWebViewActivity extends ABVContentViewActivity {
} }
} }
}); });
}
webView.setWebViewClient(new WebViewClient() { webView.setWebViewClient(new WebViewClient() {
//오서링 설문 지정시 해당 설문으로 이동수정 //오서링 설문 지정시 해당 설문으로 이동수정
@Override @Override
...@@ -310,9 +292,6 @@ public class EnqueteWebViewActivity extends ABVContentViewActivity { ...@@ -310,9 +292,6 @@ public class EnqueteWebViewActivity extends ABVContentViewActivity {
if (mContentType.equals(ContentJSON.KEY_EXAM_TYPE) && sendResult == 0) { if (mContentType.equals(ContentJSON.KEY_EXAM_TYPE) && sendResult == 0) {
callChangeButton(); callChangeButton();
} }
if (isStreaming) {
callExistsSetLocation(); // setLocationメソッドがjsにあるかどうかを調べてあれば呼び出す
}
} }
@Override @Override
...@@ -339,31 +318,6 @@ public class EnqueteWebViewActivity extends ABVContentViewActivity { ...@@ -339,31 +318,6 @@ public class EnqueteWebViewActivity extends ABVContentViewActivity {
@Override @Override
public boolean shouldOverrideUrlLoading(WebView view, String url) { public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (isStreaming && url.startsWith("abook")) {
final Uri uri = Uri.parse(url);
if (url.startsWith("abooksendlog://")) { // ログ送信完了
finishActivity();
}
else if (url.startsWith("abookopenfinish://")) { // ページロード完了(Androidでは使用せず)
}
else if (url.startsWith("abookpagemove://")) { // ストリーミングコンテンツ・ページ遷移
CommonExecutor.execute(new Runnable() {
@Override
public void run() {
contentDao.updateLastViewedPage(Long.parseLong(uri.getQueryParameter("contentId")), Integer.parseInt(uri.getQueryParameter("page")));
}
});
}
else if (url.startsWith("abookopen://")) { // ストリーミングコンテンツ・コンテンツ間リンク
CommonExecutor.execute(new Runnable() {
@Override
public void run() {
contentDao.updateContentReadingDate(new Date(), Long.parseLong(uri.getQueryParameter("contentId")));
}
});
}
return true;
} else {
boolean isGotoNextScreen = true;////試験の場合:オフライン時 結果送信する場合且つオフライン時結果送信しない場合:結果画面に進ままない。 boolean isGotoNextScreen = true;////試験の場合:オフライン時 結果送信する場合且つオフライン時結果送信しない場合:結果画面に進ままない。
boolean show_result = true; //試験の場合結果採点表示 boolean show_result = true; //試験の場合結果採点表示
boolean send_result = true; //試験の場合:結果送信 boolean send_result = true; //試験の場合:結果送信
...@@ -436,15 +390,10 @@ public class EnqueteWebViewActivity extends ABVContentViewActivity { ...@@ -436,15 +390,10 @@ public class EnqueteWebViewActivity extends ABVContentViewActivity {
} }
} }
} }
}
return true; return true;
} }
}); });
if (isStreaming) {
webView.addJavascriptInterface(jsInf, "android");
}
// webView.postUrl(url,EncodingUtils.getBytes("", "utf-8")); // webView.postUrl(url,EncodingUtils.getBytes("", "utf-8"));
Logger.d(TAG, "loadUrl: " + url); Logger.d(TAG, "loadUrl: " + url);
webView.loadUrl(url); webView.loadUrl(url);
...@@ -455,8 +404,6 @@ public class EnqueteWebViewActivity extends ABVContentViewActivity { ...@@ -455,8 +404,6 @@ public class EnqueteWebViewActivity extends ABVContentViewActivity {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
setFontSmall(); setFontSmall();
} }
}); });
...@@ -497,12 +444,8 @@ public class EnqueteWebViewActivity extends ABVContentViewActivity { ...@@ -497,12 +444,8 @@ public class EnqueteWebViewActivity extends ABVContentViewActivity {
else { else {
webView.loadUrl(url + "&reload=true"); webView.loadUrl(url + "&reload=true");
} }
// webView.reload();
} }
}); });
if (isStreaming) {
reloadButton.setVisibility(View.VISIBLE);
}
downloadButton = (ImageButton) findViewById(R.id.btn_download); downloadButton = (ImageButton) findViewById(R.id.btn_download);
downloadButton.setOnClickListener(new View.OnClickListener() { downloadButton.setOnClickListener(new View.OnClickListener() {
...@@ -568,46 +511,6 @@ public class EnqueteWebViewActivity extends ABVContentViewActivity { ...@@ -568,46 +511,6 @@ public class EnqueteWebViewActivity extends ABVContentViewActivity {
} }
}); });
// 位置情報取得許可、サービスオプション、ビルドオプションチェック
if (isStreaming && PreferenceUtil.get(this, DefPrefKey.PERMISSION_ACCESS_LOCATION, false)
&& AbstractLogic.getLogic(ContractLogic.class).getUsableReadinglogGps()
&& getResources().getInteger(R.integer.usable_location_service) == 1) {
// 位置情報取得
LocationManagerUtil locationManagerUtil = new LocationManagerUtil(this, new LocationManagerUtil.LocationManagerUtilListener() {
@Override
public void onGetLocationFailed() {
Logger.w(TAG, "onGetLocationFailed");
}
@Override
public void onGetLocation(final Location location) {
latitude = location.getLatitude();
longitude = location.getLongitude();
Logger.v(TAG, "location latitude(%s), longitude(%s)", latitude, longitude);
CommonExecutor.execute(new Runnable() {
@Override
public void run() {
while (!isPageFinished) {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
}
}
runOnUiThread(new Runnable() {
@Override
public void run() {
if (webView != null) {
webView.loadUrl("javascript:setLocation(" + latitude + "," + longitude + ")");
}
}
});
}
});
}
});
locationManagerUtil.startLocationService();
}
if(isLinkedContent) { if(isLinkedContent) {
ContentDto contentDto = AbstractDao.getDao(ContentDao.class).getContent(contentId); ContentDto contentDto = AbstractDao.getDao(ContentDao.class).getContent(contentId);
if (ContentJSON.KEY_ENQUETE_TYPE.equals(contentDto.contentType) || ContentJSON.KEY_EXAM_TYPE.equals(contentDto.contentType)) { if (ContentJSON.KEY_ENQUETE_TYPE.equals(contentDto.contentType) || ContentJSON.KEY_EXAM_TYPE.equals(contentDto.contentType)) {
...@@ -730,13 +633,7 @@ public class EnqueteWebViewActivity extends ABVContentViewActivity { ...@@ -730,13 +633,7 @@ public class EnqueteWebViewActivity extends ABVContentViewActivity {
@Override @Override
public boolean onKeyUp(int keyCode, KeyEvent event) { public boolean onKeyUp(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) { if (keyCode == KeyEvent.KEYCODE_BACK) {
if (isStreaming) {
callExistsSendLog();
return true;
}
else {
finishActivity(); finishActivity();
}
} else { } else {
return super.onKeyUp(keyCode, event); return super.onKeyUp(keyCode, event);
} }
...@@ -757,7 +654,7 @@ public class EnqueteWebViewActivity extends ABVContentViewActivity { ...@@ -757,7 +654,7 @@ public class EnqueteWebViewActivity extends ABVContentViewActivity {
public void onResume() { public void onResume() {
Logger.i(TAG, "onResume"); Logger.i(TAG, "onResume");
super.onResume(); super.onResume();
if (objectLogId != -1 && !isStreaming) { if (objectLogId != -1) {
ContentLogUtil.getInstance().resumeObjectLog(getContentId(), objectLogId); ContentLogUtil.getInstance().resumeObjectLog(getContentId(), objectLogId);
} }
} }
...@@ -766,7 +663,7 @@ public class EnqueteWebViewActivity extends ABVContentViewActivity { ...@@ -766,7 +663,7 @@ public class EnqueteWebViewActivity extends ABVContentViewActivity {
protected void onStop() { protected void onStop() {
super.onStop(); super.onStop();
webView.stopLoading(); webView.stopLoading();
if (objectLogId != -1 && !isStreaming) { if (objectLogId != -1) {
ContentLogUtil.getInstance().endObjectLog(getContentId(), objectLogId); ContentLogUtil.getInstance().endObjectLog(getContentId(), objectLogId);
} }
} }
......
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