Commit a4ca0597 by Kim Jinsung

Merge branch 'features/1.2.0_ogawa-y' into features/1.2.300

parents 86ddc893 66a79e68
...@@ -60,6 +60,8 @@ public class OperationListJSON extends AcmsCommonJSON { ...@@ -60,6 +60,8 @@ public class OperationListJSON extends AcmsCommonJSON {
public static final String OperationGroupMasterIdList = "operationGroupMasterIdList"; public static final String OperationGroupMasterIdList = "operationGroupMasterIdList";
public static final String QuickReport = "quickReport";
public List<OperationDto> operationList; public List<OperationDto> operationList;
public OperationListJSON(String jsonString) throws AcmsException { public OperationListJSON(String jsonString) throws AcmsException {
...@@ -89,6 +91,7 @@ public class OperationListJSON extends AcmsCommonJSON { ...@@ -89,6 +91,7 @@ public class OperationListJSON extends AcmsCommonJSON {
dto.enableReportHistory = operationJson.getInt(EnableReportHistory); // 報告履歴管理 dto.enableReportHistory = operationJson.getInt(EnableReportHistory); // 報告履歴管理
dto.enableReportEdit = operationJson.has(EnableReportEdit) ? operationJson.getInt(EnableReportEdit) : 0; // 作業編集区分 dto.enableReportEdit = operationJson.has(EnableReportEdit) ? operationJson.getInt(EnableReportEdit) : 0; // 作業編集区分
dto.enableAddReport = operationJson.has(EnableAddReport) ? operationJson.getInt(EnableAddReport) : 0; // 作業追加区分 dto.enableAddReport = operationJson.has(EnableAddReport) ? operationJson.getInt(EnableAddReport) : 0; // 作業追加区分
dto.quickReport = operationJson.getInt(QuickReport);
// 作業終了更新日 // 作業終了更新日
if (operationJson.has(OperationLastEditDate)) { if (operationJson.has(OperationLastEditDate)) {
......
...@@ -156,6 +156,10 @@ public class AcmsApis { ...@@ -156,6 +156,10 @@ public class AcmsApis {
public static final String ApiOperationGroupMaster = "operationGroupMaster"; public static final String ApiOperationGroupMaster = "operationGroupMaster";
// 絞り検索マスタデータ取得 // 絞り検索マスタデータ取得
public static final String ApiGetApertureMasterData = "getApertureMasterData"; public static final String ApiGetApertureMasterData = "getApertureMasterData";
// 簡易帳票一覧取得
public static final String ApiQuickReportSearch = "quickReportSearch";
// 簡易帳票リビジョン一覧取得
public static final String ApiQuickReportRevision = "quickReportRevision";
// download // download
/** /**
...@@ -200,7 +204,7 @@ public class AcmsApis { ...@@ -200,7 +204,7 @@ public class AcmsApis {
} else if (methodName.equals(ApiOperationList) || methodName.equals(ApiWorkingGroupList) || methodName.equals(ApiSendTaskData) || methodName.equals(ApiGetOperationData) || } else if (methodName.equals(ApiOperationList) || methodName.equals(ApiWorkingGroupList) || methodName.equals(ApiSendTaskData) || methodName.equals(ApiGetOperationData) ||
methodName.equals(ApiGetTaskFile) || methodName.equals(ApiSceneEntry) || methodName.equals(ApiTaskContentEntry) || methodName.equals(ApiGetTaskFile) || methodName.equals(ApiSceneEntry) || methodName.equals(ApiTaskContentEntry) ||
methodName.equals(ApiSendPushMessage) || methodName.equals(ApiGetPushMessages) || methodName.equals(ApiSendRoutineTaskData) || methodName.equals(ApiSendPushMessage) || methodName.equals(ApiGetPushMessages) || methodName.equals(ApiSendRoutineTaskData) ||
methodName.equals(ApiOperationGroupMaster) || methodName.equals(ApiGetApertureMasterData)) { methodName.equals(ApiOperationGroupMaster) || methodName.equals(ApiGetApertureMasterData) || methodName.equals(ApiQuickReportSearch) || methodName.equals(ApiQuickReportRevision)) {
apiValue = Constant.ApiValue.checkapi; apiValue = Constant.ApiValue.checkapi;
} }
......
...@@ -34,6 +34,7 @@ public class ABookKeys { ...@@ -34,6 +34,7 @@ public class ABookKeys {
public static final String CMD_MOVE_PAGE = "movePage"; public static final String CMD_MOVE_PAGE = "movePage";
public static final String CMD_SHOW_RELATED_CONTENT = "showRelatedContent"; public static final String CMD_SHOW_RELATED_CONTENT = "showRelatedContent";
public static final String CMD_PAGE_NUM = "pageNum"; public static final String CMD_PAGE_NUM = "pageNum";
public static final String CMD_GET_GROUP_TREE_INFO = "getGroupTreeInfo";
public static final String GPS_TYPE = "gpsType"; public static final String GPS_TYPE = "gpsType";
public static final String STATUS_CODE = "statusCode"; public static final String STATUS_CODE = "statusCode";
......
...@@ -19,7 +19,7 @@ import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase; ...@@ -19,7 +19,7 @@ import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase;
public class DBConnector { public class DBConnector {
private static volatile DBConnector dbConnector = null; private static volatile DBConnector dbConnector = null;
public static final String DatabaseName = "ABVJE"; public static final String DatabaseName = "ABVJE";
public static final int DatabaseVersion = DatabaseVersions.Ver1_2_0; public static final int DatabaseVersion = DatabaseVersions.Ver1_2_3;
protected SQLiteDatabase db = null; protected SQLiteDatabase db = null;
......
...@@ -5,5 +5,6 @@ public class DatabaseVersions { ...@@ -5,5 +5,6 @@ public class DatabaseVersions {
public static final int Ver1_0_0 = 1; public static final int Ver1_0_0 = 1;
public static final int Ver1_1_0 = 11; public static final int Ver1_1_0 = 11;
public static final int Ver1_2_0 = 21; public static final int Ver1_2_0 = 21;
public static final int Ver1_2_3 = 22;
} }
package jp.agentec.abook.abv.bl.data.dao; package jp.agentec.abook.abv.bl.data.dao;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -8,7 +7,6 @@ import jp.agentec.abook.abv.bl.acms.type.OperationSortingType; ...@@ -8,7 +7,6 @@ import jp.agentec.abook.abv.bl.acms.type.OperationSortingType;
import jp.agentec.abook.abv.bl.common.Constant; import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.db.Cursor; import jp.agentec.abook.abv.bl.common.db.Cursor;
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.SortDirection;
import jp.agentec.abook.abv.bl.dto.OperationDto; import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.adf.util.DateTimeFormat; import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil; import jp.agentec.adf.util.DateTimeUtil;
...@@ -113,6 +111,11 @@ public class OperationDao extends AbstractDao { ...@@ -113,6 +111,11 @@ public class OperationDao extends AbstractDao {
dto.enableAddReport = cursor.getInt(column); dto.enableAddReport = cursor.getInt(column);
} }
column = cursor.getColumnIndex("quick_report");
if (column != -1) {
dto.quickReport = cursor.getInt(column);
}
return dto; return dto;
} }
...@@ -187,9 +190,10 @@ public class OperationDao extends AbstractDao { ...@@ -187,9 +190,10 @@ public class OperationDao extends AbstractDao {
+ "enable_report_update, " + "enable_report_update, "
+ "enable_report_history, " + "enable_report_history, "
+ "enable_report_edit," + "enable_report_edit,"
+ "enable_add_report) " + "enable_add_report,"
+ "quick_report) "
+ "values " + "values "
+ "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", + "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
dto.getInsertValues()); dto.getInsertValues());
} }
...@@ -210,7 +214,8 @@ public class OperationDao extends AbstractDao { ...@@ -210,7 +214,8 @@ public class OperationDao extends AbstractDao {
+ "enable_report_update=?, " + "enable_report_update=?, "
+ "enable_report_history=?, " + "enable_report_history=?, "
+ "enable_report_edit=?, " + "enable_report_edit=?, "
+ "enable_add_report=? " + "enable_add_report=?, "
+ "quick_report=? "
+ "where operation_id=?", + "where operation_id=?",
dto.getUpdateValues()); dto.getUpdateValues());
return count > 0; return count > 0;
......
...@@ -39,6 +39,7 @@ public class TOperation extends SQLiteTableScript { ...@@ -39,6 +39,7 @@ public class TOperation extends SQLiteTableScript {
sql.append(" , enable_report_edit SMALLINT NOT NULL DEFAULT 0 "); sql.append(" , enable_report_edit SMALLINT NOT NULL DEFAULT 0 ");
sql.append(" , enable_add_report SMALLINT NOT NULL DEFAULT 0 "); sql.append(" , enable_add_report SMALLINT NOT NULL DEFAULT 0 ");
sql.append(" , operation_open_date DATETIME "); sql.append(" , operation_open_date DATETIME ");
sql.append(" , quick_report SMALLINT NOT NULL DEFAULT 0 ");
sql.append(" , PRIMARY KEY (operation_id) "); sql.append(" , PRIMARY KEY (operation_id) ");
sql.append(" ) "); sql.append(" ) ");
ddl.add(sql.toString()); ddl.add(sql.toString());
...@@ -54,6 +55,9 @@ public class TOperation extends SQLiteTableScript { ...@@ -54,6 +55,9 @@ public class TOperation extends SQLiteTableScript {
if (oldVersion < DatabaseVersions.Ver1_2_0) { // カラムの追加 if (oldVersion < DatabaseVersions.Ver1_2_0) { // カラムの追加
ddl.add("ALTER TABLE t_operation ADD COLUMN operation_open_date DATETIME"); ddl.add("ALTER TABLE t_operation ADD COLUMN operation_open_date DATETIME");
} }
if (oldVersion < DatabaseVersions.Ver1_2_3) {
ddl.add("ALTER TABLE t_operation ADD COLUMN quick_report SMALLINT NOT NULL DEFAULT 0 ");
}
return ddl; return ddl;
} }
......
...@@ -31,6 +31,7 @@ public class OperationDto extends AbstractDto { ...@@ -31,6 +31,7 @@ public class OperationDto extends AbstractDto {
public int enableReportHistory; // 0: 履歴無し, 1: 履歴可 public int enableReportHistory; // 0: 履歴無し, 1: 履歴可
public int enableReportEdit; // 作業編集可能区分 public int enableReportEdit; // 作業編集可能区分
public int enableAddReport; // 作業追加区分 public int enableAddReport; // 作業追加区分
public int quickReport; // 簡易帳票区分
public List<OperationGroupMasterRelationDto> operationGroupMasterRelationDtoList; // 作業種別に紐づく作業Dto public List<OperationGroupMasterRelationDto> operationGroupMasterRelationDtoList; // 作業種別に紐づく作業Dto
...@@ -48,12 +49,12 @@ public class OperationDto extends AbstractDto { ...@@ -48,12 +49,12 @@ public class OperationDto extends AbstractDto {
@Override @Override
public Object[] getInsertValues() { public Object[] getInsertValues() {
return new Object[] { operationId, operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, reportType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportCycle, enableReportUpdate, enableReportHistory, enableReportEdit, enableAddReport }; return new Object[] { operationId, operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, reportType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportCycle, enableReportUpdate, enableReportHistory, enableReportEdit, enableAddReport, quickReport };
} }
@Override @Override
public Object[] getUpdateValues() { public Object[] getUpdateValues() {
return new Object[] { operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, reportType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportCycle, enableReportUpdate, enableReportHistory, enableReportEdit, enableAddReport, operationId }; return new Object[] { operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, reportType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportCycle, enableReportUpdate, enableReportHistory, enableReportEdit, enableAddReport, quickReport, operationId };
} }
@Override @Override
......
package jp.agentec.abook.abv.bl.logic; package jp.agentec.abook.abv.bl.logic;
import org.json.adf.JSONObject;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
...@@ -25,30 +27,31 @@ import jp.agentec.adf.util.StringUtil; ...@@ -25,30 +27,31 @@ import jp.agentec.adf.util.StringUtil;
public class GroupLogic extends AbstractLogic { public class GroupLogic extends AbstractLogic {
private static final java.lang.String TAG = "GroupLogic"; private static final java.lang.String TAG = "GroupLogic";
private GroupDao groupDao = AbstractDao.getDao(GroupDao.class); private GroupDao groupDao = AbstractDao.getDao(GroupDao.class);
private ContentDao contentDao = AbstractDao.getDao(ContentDao.class); private ContentDao contentDao = AbstractDao.getDao(ContentDao.class);
private OperationDao mOperationDao = AbstractDao.getDao(OperationDao.class); private OperationDao mOperationDao = AbstractDao.getDao(OperationDao.class);
public Integer[] getServerUserGroupIds(String sid) throws NetworkDisconnectedException, ABVException { public Integer[] getServerUserGroupIds(String sid) throws NetworkDisconnectedException, ABVException {
AcmsParameters param = new AcmsParameters(sid); AcmsParameters param = new AcmsParameters(sid);
return AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).userGroup(param); return AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).userGroup(param);
} }
/** /**
* グループ情報をサーバから受信し、ローカルに保存します。既存のデータは上書きされます。また、サーバにないグループがローカルにある場合、そのグループは削除されます。 * グループ情報をサーバから受信し、ローカルに保存します。既存のデータは上書きされます。また、サーバにないグループがローカルにある場合、そのグループは削除されます。
* @throws ABVException キャッシュにユーザ情報がありません。再度ログインする必要があります。 *
* @throws AcmsException * @throws ABVException  キャッシュにユーザ情報がありません。再度ログインする必要があります。
* @throws Exception その他、例外です。 * @throws AcmsException
* @since 1.0.0 * @throws Exception その他、例外です。
*/ * @since 1.0.0
public void initializeGroups() throws NetworkDisconnectedException, AcmsException { */
AcmsParameters param = new AcmsParameters(cache.getMemberInfo().sid); public void initializeGroups() throws NetworkDisconnectedException, AcmsException {
List<GroupDto> serverGroups = AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).group(param); AcmsParameters param = new AcmsParameters(cache.getMemberInfo().sid);
ContentGroupDao contentGroupDao = AbstractDao.getDao(ContentGroupDao.class); List<GroupDto> serverGroups = AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).group(param);
ContentGroupDao contentGroupDao = AbstractDao.getDao(ContentGroupDao.class);
if (serverGroups == null || serverGroups.size() == 0) {
if (serverGroups == null || serverGroups.size() == 0) {
Logger.w(TAG, "Group Data is Nothing"); Logger.w(TAG, "Group Data is Nothing");
return; return;
} }
try { try {
groupDao.beginTransaction(); groupDao.beginTransaction();
...@@ -126,32 +129,49 @@ public class GroupLogic extends AbstractLogic { ...@@ -126,32 +129,49 @@ public class GroupLogic extends AbstractLogic {
throw new RuntimeException(e); throw new RuntimeException(e);
} finally { } finally {
} }
} }
//해당 콘텐츠 아이디를 가지고 있는 그룹정보 //해당 콘텐츠 아이디를 가지고 있는 그룹정보
public ArrayList<String>getExistContentsGroupInfo(long contentId) { public ArrayList<String> getExistContentsGroupInfo(long contentId) {
List<GroupDto>groupDtoList = groupDao.getExistContentGroup(contentId); List<GroupDto> groupDtoList = groupDao.getExistContentGroup(contentId);
ArrayList<String>groupList = new ArrayList<String>(); ArrayList<String> groupList = new ArrayList<String>();
for (GroupDto groupDto : groupDtoList) { for (GroupDto groupDto : groupDtoList) {
groupList.add(groupDto.groupName); groupList.add(groupDto.groupName);
} }
return groupList; return groupList;
} }
public Integer[] getLocalUserGroupIds() { public Integer[] getLocalUserGroupIds() {
List<GroupDto> userGroupList = groupDao.getUserGroups(); List<GroupDto> userGroupList = groupDao.getUserGroups();
TreeSet<Integer> userGroupIdSet = new TreeSet<Integer>(); TreeSet<Integer> userGroupIdSet = new TreeSet<Integer>();
for (GroupDto groupDto : userGroupList) { for (GroupDto groupDto : userGroupList) {
userGroupIdSet.add(groupDto.groupId); userGroupIdSet.add(groupDto.groupId);
} }
return userGroupIdSet.toArray(new Integer[userGroupIdSet.size()]); return userGroupIdSet.toArray(new Integer[userGroupIdSet.size()]);
} }
public AcmsMessageJSON addMemberGroup(String groupName) throws AcmsException, NetworkDisconnectedException { public AcmsMessageJSON addMemberGroup(String groupName) throws AcmsException, NetworkDisconnectedException {
AddMemberGroupParameters param = new AddMemberGroupParameters(cache.getMemberInfo().sid, groupName, Locale.getDefault().getLanguage()); AddMemberGroupParameters param = new AddMemberGroupParameters(cache.getMemberInfo().sid, groupName, Locale.getDefault().getLanguage());
return AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).addMemberGroup(param); return AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).addMemberGroup(param);
} }
public List<JSONObject> getAllGroupsJson() {
List<JSONObject> groupList = new ArrayList<JSONObject>();
List<GroupDto> groups = groupDao.getUserGroups();
if (groups != null) {
for (GroupDto groupDto : groups) {
JSONObject group = new JSONObject();
group.put("groupId", groupDto.groupId);
group.put("groupName", groupDto.groupName);
group.put("groupLevel", groupDto.groupLevel);
group.put("parentGroupId", groupDto.parentGroupId);
group.put("contentCount", groupDto.contentCount);
groupList.add(group);
}
}
return groupList;
}
} }
package jp.agentec.abook.abv.bl.logic;
import java.util.Map;
public class OnlineHTMLWebViewLogic extends AbstractLogic {
private static final String TAG = "OnlineHTMLWebViewLogic";
public byte[] getPostData(Map<String, String> param) {
String data = "sid=" + cache.getMemberInfo().sid;
for(Map.Entry<String, String> entry : param.entrySet()){
data += "&" + entry.getKey() + "=" + entry.getValue();
}
return data.getBytes();
}
}
...@@ -232,6 +232,10 @@ ...@@ -232,6 +232,10 @@
<activity android:name="jp.agentec.abook.abv.ui.home.activity.OperationMeetingListActivityDialog" android:theme="@style/Theme.MyTheme.ModalDialog"/> <activity android:name="jp.agentec.abook.abv.ui.home.activity.OperationMeetingListActivityDialog" android:theme="@style/Theme.MyTheme.ModalDialog"/>
<activity android:name="jp.agentec.abook.abv.ui.viewer.activity.CheckOZDViewActivity" android:configChanges="orientation|screenSize"/> <activity android:name="jp.agentec.abook.abv.ui.viewer.activity.CheckOZDViewActivity" android:configChanges="orientation|screenSize"/>
<activity
android:name="jp.agentec.abook.abv.ui.viewer.activity.OnlineHTMLWebViewActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
</activity>
</application> </application>
</manifest> </manifest>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:state_enabled="false"
android:drawable="@drawable/home_print_off"/>
<item
android:drawable="@drawable/home_print_on"/>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:state_enabled="false"
android:drawable="@drawable/home_print_off"/>
<item
android:drawable="@drawable/home_print_white"/>
</selector>
\ No newline at end of file
...@@ -533,6 +533,9 @@ ...@@ -533,6 +533,9 @@
<string name="title_category">カテゴリ</string> <string name="title_category">カテゴリ</string>
<string name="title_all_operation">全作業</string> <string name="title_all_operation">全作業</string>
<!-- ABookCheck 1.2.3 -->
<string name="title_quick_report_output">簡易帳票出力</string>
<!-- 1.0.1 Resource Pattern 1 --> <!-- 1.0.1 Resource Pattern 1 -->
<!-- 1.9.0.0--> <!-- 1.9.0.0-->
<string name="meetingroom_setting_1">会議室設定(1)</string> <string name="meetingroom_setting_1">会議室設定(1)</string>
......
...@@ -535,6 +535,9 @@ ...@@ -535,6 +535,9 @@
<string name="title_category">분류</string> <string name="title_category">분류</string>
<string name="title_all_operation">전체 작업</string> <string name="title_all_operation">전체 작업</string>
<!-- ABookCheck 1.2.3 -->
<string name="title_quick_report_output">簡易帳票出力</string>
<!-- 1.0.1 Resource Pattern 1 --> <!-- 1.0.1 Resource Pattern 1 -->
<!-- 1.9.0.0--> <!-- 1.9.0.0-->
<string name="meetingroom_setting_1">회의실 설정(1)</string> <string name="meetingroom_setting_1">회의실 설정(1)</string>
......
...@@ -539,6 +539,9 @@ ...@@ -539,6 +539,9 @@
<string name="title_category">Category</string> <string name="title_category">Category</string>
<string name="title_all_operation">All</string> <string name="title_all_operation">All</string>
<!-- ABookCheck 1.2.3 -->
<string name="title_quick_report_output">簡易帳票出力</string>
<!-- 1.0.1 Resource Pattern 1 --> <!-- 1.0.1 Resource Pattern 1 -->
<!-- 1.9.0.0--> <!-- 1.9.0.0-->
<string name="meetingroom_setting_1">Meeting room setting(1)</string> <string name="meetingroom_setting_1">Meeting room setting(1)</string>
......
...@@ -142,6 +142,19 @@ ...@@ -142,6 +142,19 @@
android:gravity="center"> android:gravity="center">
<ImageButton <ImageButton
android:id="@+id/btn_operation_print"
style="@style/ToolBarIcon"
android:layout_centerVertical="true"
android:src="@drawable/btn_operation_print" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center">
<ImageButton
android:id="@+id/btn_setting" android:id="@+id/btn_setting"
style="@style/ToolBarIcon" style="@style/ToolBarIcon"
android:onClick="onClickSetting" android:onClick="onClickSetting"
......
...@@ -145,6 +145,19 @@ ...@@ -145,6 +145,19 @@
android:gravity="center"> android:gravity="center">
<ImageButton <ImageButton
android:id="@+id/btn_operation_print"
style="@style/ToolBarIcon"
android:layout_centerVertical="true"
android:src="@drawable/btn_operation_print" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center">
<ImageButton
android:id="@+id/btn_setting" android:id="@+id/btn_setting"
style="@style/ToolBarIcon" style="@style/ToolBarIcon"
android:onClick="onClickSetting" android:onClick="onClickSetting"
......
...@@ -143,6 +143,20 @@ ...@@ -143,6 +143,20 @@
android:gravity="center"> android:gravity="center">
<ImageButton <ImageButton
android:id="@+id/btn_operation_print"
style="@style/ToolBarIcon"
android:layout_centerVertical="true"
android:src="@drawable/btn_operation_print" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center">
<ImageButton
android:id="@+id/btn_setting" android:id="@+id/btn_setting"
style="@style/ToolBarIcon" style="@style/ToolBarIcon"
android:layout_centerVertical="true" android:layout_centerVertical="true"
......
...@@ -136,6 +136,21 @@ ...@@ -136,6 +136,21 @@
android:gravity="center"> android:gravity="center">
<ImageButton <ImageButton
android:id="@+id/btn_operation_print"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:background="@drawable/btn_operation_print" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center">
<ImageButton
android:id="@+id/btn_setting" android:id="@+id/btn_setting"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
......
...@@ -128,6 +128,16 @@ ...@@ -128,6 +128,16 @@
android:visibility="gone" /> android:visibility="gone" />
<ImageButton <ImageButton
android:id="@+id/btn_print"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:layout_weight="1"
android:background="@drawable/btn_operation_print_white"
android:contentDescription="@string/print"
android:visibility="gone" />
<ImageButton
android:id="@+id/btn_download" android:id="@+id/btn_download"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/frameTopbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/app_color"
android:minHeight="50dp" >
<Button
android:id="@+id/closeBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="false"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_marginLeft="5dp"
android:layout_marginStart="5dp"
android:background="@drawable/btn_close"
android:contentDescription="@string/cont_desc" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true">
<TextView
android:id="@+id/title"
style="@style/DialogToolBarTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center"
android:maxLines="1"
android:textColor="@color/text_dialog"
android:textStyle="bold"
android:visibility="visible" />
</LinearLayout>
</RelativeLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="vertical" >
<WebView
android:id="@+id/webView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="0dp" android:layout_marginStart="0dp" />
<ProgressBar
android:id="@+id/refresh_prog"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:visibility="gone" />
</FrameLayout>
</LinearLayout>
\ No newline at end of file
package jp.agentec.abook.abv.launcher.android; package jp.agentec.abook.abv.launcher.android;
import java.io.File;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.log.Logger;
import android.app.DownloadManager; import android.app.DownloadManager;
import android.content.BroadcastReceiver; import android.content.BroadcastReceiver;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.database.Cursor;
import android.net.Uri; import android.net.Uri;
import android.os.Environment; import android.os.Environment;
import android.util.Log;
import android.widget.Toast; import android.widget.Toast;
import java.io.File;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.log.Logger;
import static android.content.ContentValues.TAG;
/** /**
* 新しいAPKのダウンロードが完了したときの通知を受け取る * 新しいAPKのダウンロードが完了したときの通知を受け取る
* @author jang * @author jang
...@@ -26,6 +30,25 @@ public class OnAppDownloadReceiver extends BroadcastReceiver { ...@@ -26,6 +30,25 @@ public class OnAppDownloadReceiver extends BroadcastReceiver {
long id = intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, -1); long id = intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, -1);
Logger.d("Download Complete ID : " + id); Logger.d("Download Complete ID : " + id);
DownloadManager dm = (DownloadManager)context.getSystemService(context.DOWNLOAD_SERVICE);
final Cursor cursor;
if (dm != null) {
cursor = dm.query(
new DownloadManager.Query().setFilterById(id));
if (cursor.moveToFirst()) {
final String downloadedTo = cursor.getString(
cursor.getColumnIndex(DownloadManager.COLUMN_LOCAL_URI));
Log.d(TAG, "The file has been downloaded to: " + downloadedTo);
if (downloadedTo != null && downloadedTo.endsWith(".pdf")) {
Toast.makeText(context, context.getResources().getString(R.string.download_success), //To notify the Client that the file is being downloaded
Toast.LENGTH_LONG).show();
// PDFファイルの場合はAPK用の処理は通過させない
return;
}
}
}
if (id == -1) { if (id == -1) {
// ダウンロードマネージャの通知領域をクリックした場合はメッセージ表示のみ // ダウンロードマネージャの通知領域をクリックした場合はメッセージ表示のみ
Toast.makeText(context, intent.getAction(), Toast.LENGTH_LONG).show(); Toast.makeText(context, intent.getAction(), Toast.LENGTH_LONG).show();
......
...@@ -13,7 +13,6 @@ import android.provider.MediaStore; ...@@ -13,7 +13,6 @@ import android.provider.MediaStore;
import android.view.Gravity; import android.view.Gravity;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.OrientationEventListener;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.AdapterView; import android.widget.AdapterView;
...@@ -52,6 +51,7 @@ import jp.agentec.abook.abv.bl.dto.OperationDto; ...@@ -52,6 +51,7 @@ import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.bl.dto.OperationTaskDto; import jp.agentec.abook.abv.bl.dto.OperationTaskDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic; import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.ContentReadingLogLogic; import jp.agentec.abook.abv.bl.logic.ContentReadingLogLogic;
import jp.agentec.abook.abv.bl.logic.GroupLogic;
import jp.agentec.abook.abv.bl.logic.OperationLogic; import jp.agentec.abook.abv.bl.logic.OperationLogic;
import jp.agentec.abook.abv.bl.websocket.MeetingManager; import jp.agentec.abook.abv.bl.websocket.MeetingManager;
import jp.agentec.abook.abv.cl.environment.DeviceInfo; import jp.agentec.abook.abv.cl.environment.DeviceInfo;
...@@ -85,6 +85,8 @@ import jp.agentec.adf.util.StringUtil; ...@@ -85,6 +85,8 @@ import jp.agentec.adf.util.StringUtil;
public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
protected static GroupLogic groupLogic = AbstractLogic.getLogic(GroupLogic.class);
private static final String TAG ="ABVContentViewActivity"; private static final String TAG ="ABVContentViewActivity";
public final static int ABOOK_CHECK_TASK_IMAGE = 103; public final static int ABOOK_CHECK_TASK_IMAGE = 103;
public final static int ABOOK_CHECK_TASK_VIDEO = 104; public final static int ABOOK_CHECK_TASK_VIDEO = 104;
...@@ -1087,6 +1089,9 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1087,6 +1089,9 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
Logger.e(TAG, "startContentActivity failed.", e); Logger.e(TAG, "startContentActivity failed.", e);
ErrorMessage.showErrorMessageToast(getApplicationContext(), ErrorCode.E107); ErrorMessage.showErrorMessageToast(getApplicationContext(), ErrorCode.E107);
} }
} else if (mCmd.equals(ABookKeys.CMD_GET_GROUP_TREE_INFO)) {
List<JSONObject> groups = groupLogic.getAllGroupsJson();
afterABookCheckApi(mCmd, null, 0, "getAllGroups", groups.toString());
} }
} }
......
...@@ -25,6 +25,7 @@ import android.widget.FrameLayout; ...@@ -25,6 +25,7 @@ import android.widget.FrameLayout;
import android.widget.GridView; import android.widget.GridView;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView; import android.widget.ListView;
import android.widget.RadioGroup; import android.widget.RadioGroup;
import android.widget.TextView; import android.widget.TextView;
...@@ -53,6 +54,7 @@ import java.util.Stack; ...@@ -53,6 +54,7 @@ import java.util.Stack;
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.OperationDataJSON; import jp.agentec.abook.abv.bl.acms.client.json.OperationDataJSON;
import jp.agentec.abook.abv.bl.acms.client.parameters.GetOperationDataParameters; import jp.agentec.abook.abv.bl.acms.client.parameters.GetOperationDataParameters;
import jp.agentec.abook.abv.bl.acms.type.AcmsApis;
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.OperationType; import jp.agentec.abook.abv.bl.acms.type.OperationType;
import jp.agentec.abook.abv.bl.common.ABVEnvironment; import jp.agentec.abook.abv.bl.common.ABVEnvironment;
...@@ -86,6 +88,7 @@ import jp.agentec.abook.abv.bl.logic.OperationGroupMasterLogic; ...@@ -86,6 +88,7 @@ import jp.agentec.abook.abv.bl.logic.OperationGroupMasterLogic;
import jp.agentec.abook.abv.bl.logic.OperationLogic; import jp.agentec.abook.abv.bl.logic.OperationLogic;
import jp.agentec.abook.abv.cl.util.PreferenceUtil; import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.launcher.android.R; import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.viewer.activity.OnlineHTMLWebViewActivity;
import jp.agentec.abook.abv.ui.common.activity.ABVUIActivity; import jp.agentec.abook.abv.ui.common.activity.ABVUIActivity;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.OperationLocationType; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.OperationLocationType;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
...@@ -127,6 +130,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -127,6 +130,7 @@ public class OperationListActivity extends ABVUIActivity {
private ImageButton mCommonContentButton; // 共通資料ボタン private ImageButton mCommonContentButton; // 共通資料ボタン
private ImageButton mOperationBatchSyncButton; // カテゴリの一括同期ボタン private ImageButton mOperationBatchSyncButton; // カテゴリの一括同期ボタン
private ImageButton mCategoryLocationButton; // カテゴリ選択ボタン private ImageButton mCategoryLocationButton; // カテゴリ選択ボタン
private ImageButton mQuickReportPrintButton; // 簡易帳票印刷ボタン
private TextView mOperationTitle; // 一覧のタイトル private TextView mOperationTitle; // 一覧のタイトル
...@@ -206,6 +210,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -206,6 +210,7 @@ public class OperationListActivity extends ABVUIActivity {
communicationButton = (ImageButton) findViewById(R.id.btn_communication_menu); communicationButton = (ImageButton) findViewById(R.id.btn_communication_menu);
mCommonContentButton = (ImageButton) findViewById(R.id.btn_common_content); mCommonContentButton = (ImageButton) findViewById(R.id.btn_common_content);
mCategoryLocationButton = (ImageButton) findViewById(R.id.btn_category_location); mCategoryLocationButton = (ImageButton) findViewById(R.id.btn_category_location);
mQuickReportPrintButton = (ImageButton) findViewById(R.id.btn_operation_print);
// 定期点検で同期ボタンタップの日付と現在の日付が異なる且つ、作業するデータが存在しない場合、needSyncFlgをtrueに更新 // 定期点検で同期ボタンタップの日付と現在の日付が異なる且つ、作業するデータが存在しない場合、needSyncFlgをtrueに更新
updateNeedSyncRoutineOperation(); updateNeedSyncRoutineOperation();
...@@ -254,6 +259,15 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -254,6 +259,15 @@ public class OperationListActivity extends ABVUIActivity {
} }
}); });
// 簡易帳票印刷ボタン
mQuickReportPrintButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showPrintTargetSelect();
}
});
mQuickReportPrintButton.setVisibility(View.VISIBLE);
// 一括同期ボタン // 一括同期ボタン
mOperationBatchSyncButton.setOnClickListener(new View.OnClickListener() { mOperationBatchSyncButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
...@@ -347,6 +361,19 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -347,6 +361,19 @@ public class OperationListActivity extends ABVUIActivity {
startActivity(intent, NaviConsts.Right); startActivity(intent, NaviConsts.Right);
} }
// 簡易帳票印刷対象選択画面表示
private void showPrintTargetSelect() {
if (!ABVEnvironment.getInstance().networkAdapter.isNetworkConnected()) {
showDisConnectNetworkDialog();
return;
}
Intent intent = new Intent();
intent.setClass(OperationListActivity.this, OnlineHTMLWebViewActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
intent.putExtra("LINKURL", AcmsApis.getApiUrl(ABVEnvironment.getInstance().acmsAddress, ABVDataCache.getInstance().getUrlPath(), AcmsApis.ApiQuickReportSearch));
startActivity(intent, NaviConsts.Right);
}
// ツールバーの設定 // ツールバーの設定
private void configurationToolbarIcon() { private void configurationToolbarIcon() {
...@@ -1865,4 +1892,5 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1865,4 +1892,5 @@ public class OperationListActivity extends ABVUIActivity {
public int getSortCondition() { public int getSortCondition() {
return getABVUIDataCache().getSortCondition(); return getABVUIDataCache().getSortCondition();
} }
} }
...@@ -16,8 +16,11 @@ import java.util.ArrayList; ...@@ -16,8 +16,11 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON; import jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON;
import jp.agentec.abook.abv.bl.acms.type.AcmsApis;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.exception.ExceptionHandler; import jp.agentec.abook.abv.bl.common.exception.ExceptionHandler;
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.download.ContentZipDownloadNotification; import jp.agentec.abook.abv.bl.download.ContentZipDownloadNotification;
import jp.agentec.abook.abv.bl.dto.CategoryContentDto; import jp.agentec.abook.abv.bl.dto.CategoryContentDto;
import jp.agentec.abook.abv.bl.dto.ContentDto; import jp.agentec.abook.abv.bl.dto.ContentDto;
...@@ -29,12 +32,14 @@ import jp.agentec.abook.abv.ui.common.activity.ABVUIActivity; ...@@ -29,12 +32,14 @@ import jp.agentec.abook.abv.ui.common.activity.ABVUIActivity;
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.constant.ErrorCode; import jp.agentec.abook.abv.ui.common.constant.ErrorCode;
import jp.agentec.abook.abv.ui.common.constant.ErrorMessage; import jp.agentec.abook.abv.ui.common.constant.ErrorMessage;
import jp.agentec.abook.abv.ui.common.constant.NaviConsts;
import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog; import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog;
import jp.agentec.abook.abv.ui.common.util.ABVToastUtil; import jp.agentec.abook.abv.ui.common.util.ABVToastUtil;
import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil; import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
import jp.agentec.abook.abv.ui.common.util.PatternStringUtil; import jp.agentec.abook.abv.ui.common.util.PatternStringUtil;
import jp.agentec.abook.abv.ui.home.adapter.OperationRelatedContentSectionAdapter; import jp.agentec.abook.abv.ui.home.adapter.OperationRelatedContentSectionAdapter;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper; import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.viewer.activity.OnlineHTMLWebViewActivity;
import jp.agentec.adf.util.StringUtil; import jp.agentec.adf.util.StringUtil;
/** /**
...@@ -47,7 +52,8 @@ public class OperationRelatedContentActivity extends ABVUIActivity { ...@@ -47,7 +52,8 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
private OperationRelatedContentSectionAdapter mOperationRelatedContentSectionAdapter; private OperationRelatedContentSectionAdapter mOperationRelatedContentSectionAdapter;
private ImageButton mOperationHomeButton; // ホームボタン private ImageButton mOperationHomeButton; // ホームボタン
private ImageButton mOperationRelatedContentButton; // 関連資料ボタン private ImageButton mOperationRelatedContentButton; //
private ImageButton mQuickReportPrintButton; // 簡易帳票印刷ボタン
private TextView mTxtOperationRelatedContent; private TextView mTxtOperationRelatedContent;
private Button mAllSaveButton; private Button mAllSaveButton;
...@@ -74,6 +80,8 @@ public class OperationRelatedContentActivity extends ABVUIActivity { ...@@ -74,6 +80,8 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
mContentListView = (ListView) findViewById(R.id.lv_content_list); mContentListView = (ListView) findViewById(R.id.lv_content_list);
mTxtOperationRelatedContent = (TextView) findViewById(R.id.txt_operation_related_content); mTxtOperationRelatedContent = (TextView) findViewById(R.id.txt_operation_related_content);
mQuickReportPrintButton = (ImageButton) findViewById(R.id.btn_operation_print);
// リソースパターンの適用 // リソースパターンの適用
mTxtOperationRelatedContent.setText("" + PatternStringUtil.patternToString(getApplicationContext(), mTxtOperationRelatedContent.setText("" + PatternStringUtil.patternToString(getApplicationContext(),
R.string.title_common_content, R.string.title_common_content,
...@@ -101,6 +109,8 @@ public class OperationRelatedContentActivity extends ABVUIActivity { ...@@ -101,6 +109,8 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
showCommunicationMenuDialog(); showCommunicationMenuDialog();
} }
}); });
// 印刷ボタン活性化
mQuickReportPrintButton.setVisibility(View.VISIBLE);
} }
@Override @Override
...@@ -330,6 +340,14 @@ public class OperationRelatedContentActivity extends ABVUIActivity { ...@@ -330,6 +340,14 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
}.execute(); }.execute();
} }
}); });
// 簡易帳票印刷ボタン
mQuickReportPrintButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showPrintTargetSelect();
}
});
} }
/** /**
...@@ -383,6 +401,43 @@ public class OperationRelatedContentActivity extends ABVUIActivity { ...@@ -383,6 +401,43 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
showAlertDialog(cancelDownloadDialog); showAlertDialog(cancelDownloadDialog);
} }
/**
* 簡易帳票印刷対象選択画面表示
*/
private void showPrintTargetSelect() {
if (!ABVEnvironment.getInstance().networkAdapter.isNetworkConnected()) {
showDisConnectNetworkDialog();
return;
}
Intent intent = new Intent();
intent.setClass(OperationRelatedContentActivity.this, OnlineHTMLWebViewActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
intent.putExtra("LINKURL", AcmsApis.getApiUrl(ABVEnvironment.getInstance().acmsAddress, ABVDataCache.getInstance().getUrlPath(), AcmsApis.ApiQuickReportSearch));
startActivity(intent, NaviConsts.Right);
}
/**
* インターネットが繋がってない場合のダイアログ表示
*/
private void showDisConnectNetworkDialog() {
handler.post(new Runnable() {
@Override
public void run() {
// ヘッダーの新着更新処理を完了にさせる
stopUpdateAnimation();
final ABookAlertDialog messageDialog = AlertDialogUtil.createAlertDialog(OperationRelatedContentActivity.this, R.string.app_name);
messageDialog.setMessage(getString(R.string.msg_network_offline));
messageDialog.setPositiveButton(R.string.confirm, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int whichButton) {
messageDialog.dismiss();
}
});
messageDialog.show();
}
});
}
@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) {
......
package jp.agentec.abook.abv.ui.viewer.activity; package jp.agentec.abook.abv.ui.viewer.activity;
import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
...@@ -13,7 +14,6 @@ import android.view.Window; ...@@ -13,7 +14,6 @@ import android.view.Window;
import android.webkit.JavascriptInterface; import android.webkit.JavascriptInterface;
import android.webkit.ValueCallback; import android.webkit.ValueCallback;
import android.webkit.WebChromeClient; import android.webkit.WebChromeClient;
import android.webkit.WebResourceResponse;
import android.webkit.WebSettings; import android.webkit.WebSettings;
import android.webkit.WebSettings.PluginState; import android.webkit.WebSettings.PluginState;
import android.webkit.WebView; import android.webkit.WebView;
...@@ -24,45 +24,38 @@ import android.widget.ImageButton; ...@@ -24,45 +24,38 @@ import android.widget.ImageButton;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.Toast; import android.widget.Toast;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON; import jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON;
import jp.agentec.abook.abv.bl.acms.type.AcmsApis;
import jp.agentec.abook.abv.bl.acms.type.DownloadStatusType; import jp.agentec.abook.abv.bl.acms.type.DownloadStatusType;
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;
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.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.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.OperationDao;
import jp.agentec.abook.abv.bl.download.ContentDownloader; import jp.agentec.abook.abv.bl.download.ContentDownloader;
import jp.agentec.abook.abv.bl.download.ContentZipDownloadNotification; import jp.agentec.abook.abv.bl.download.ContentZipDownloadNotification;
import jp.agentec.abook.abv.bl.dto.ContentDto; import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.ContractLogic;
import jp.agentec.abook.abv.cl.util.ContentLogUtil; import jp.agentec.abook.abv.cl.util.ContentLogUtil;
import jp.agentec.abook.abv.cl.util.LocationManagerUtil;
import jp.agentec.abook.abv.cl.util.PreferenceUtil;
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.DefPrefKey;
import jp.agentec.abook.abv.ui.common.constant.ErrorCode; import jp.agentec.abook.abv.ui.common.constant.ErrorCode;
import jp.agentec.abook.abv.ui.common.constant.ErrorMessage; import jp.agentec.abook.abv.ui.common.constant.ErrorMessage;
import jp.agentec.abook.abv.ui.common.constant.NaviConsts;
import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog;
import jp.agentec.abook.abv.ui.common.util.ABVToastUtil; import jp.agentec.abook.abv.ui.common.util.ABVToastUtil;
import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
import jp.agentec.abook.abv.ui.common.view.ABVPopupListWindow; import jp.agentec.abook.abv.ui.common.view.ABVPopupListWindow;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
//TODO: later 遠隔連動関連はContentView,NoPdfViewと共通しているので要集約 //TODO: later 遠隔連動関連はContentView,NoPdfViewと共通しているので要集約
public class HTMLWebViewActivity extends ParentWebViewActivity { public class HTMLWebViewActivity extends ParentWebViewActivity {
private static final String TAG = "HTMLWebViewActivity"; private static final String TAG = "HTMLWebViewActivity";
private OperationDao mOperationDao = AbstractDao.getDao(OperationDao.class);
/** /**
* Called when the activity is first created. * Called when the activity is first created.
*/ */
...@@ -71,6 +64,7 @@ public class HTMLWebViewActivity extends ParentWebViewActivity { ...@@ -71,6 +64,7 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
private ImageButton reloadButton; private ImageButton reloadButton;
private ImageButton downloadButton; private ImageButton downloadButton;
private ImageButton printButton;
private int objectLogId; private int objectLogId;
private WebView webView; private WebView webView;
...@@ -320,6 +314,15 @@ public class HTMLWebViewActivity extends ParentWebViewActivity { ...@@ -320,6 +314,15 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
} }
}); });
printButton = (ImageButton) findViewById(R.id.btn_print);
printButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Logger.d(TAG, "Print");
showPrintTargetSelect();
}
});
downloadButton = (ImageButton) findViewById(R.id.btn_download); downloadButton = (ImageButton) findViewById(R.id.btn_download);
downloadButton.setOnClickListener(new View.OnClickListener() { downloadButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
...@@ -379,6 +382,8 @@ public class HTMLWebViewActivity extends ParentWebViewActivity { ...@@ -379,6 +382,8 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
} }
}); });
printButtonActivityControl();
historyListBtn.setVisibility(View.GONE); historyListBtn.setVisibility(View.GONE);
if (isLinkedContent) { if (isLinkedContent) {
...@@ -612,6 +617,53 @@ public class HTMLWebViewActivity extends ParentWebViewActivity { ...@@ -612,6 +617,53 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
}); });
} }
/**
* 簡易帳票印刷ボタン活性制御
* 簡易帳票区分が1のデータが存在する場合表示、それ以外非表示
*/
private void printButtonActivityControl() {
OperationDto operation = mOperationDao.getOperation(mOperationId);
if (operation != null && operation.quickReport == 1) {
printButton.setVisibility(View.VISIBLE);
} else {
printButton.setVisibility(View.GONE);
}
}
// 簡易帳票印刷対象選択画面表示
private void showPrintTargetSelect() {
if (!ABVEnvironment.getInstance().networkAdapter.isNetworkConnected()) {
showDisConnectNetworkDialog();
return;
}
Intent intent = new Intent();
intent.setClass(HTMLWebViewActivity.this, OnlineHTMLWebViewActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
intent.putExtra("LINKURL", AcmsApis.getApiUrl(ABVEnvironment.getInstance().acmsAddress, ABVDataCache.getInstance().getUrlPath(), AcmsApis.ApiQuickReportRevision));
intent.putExtra("operationId", mOperationId);
startActivity(intent, NaviConsts.Right);
}
/**
* インターネットが繋がってない場合のダイアログ表示
*/
private void showDisConnectNetworkDialog() {
handler.post(new Runnable() {
@Override
public void run() {
final ABookAlertDialog messageDialog = AlertDialogUtil.createAlertDialog(HTMLWebViewActivity.this, R.string.app_name);
messageDialog.setMessage(getString(R.string.msg_network_offline));
messageDialog.setPositiveButton(R.string.confirm, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int whichButton) {
messageDialog.dismiss();
}
});
messageDialog.show();
}
});
}
@Override @Override
protected void webViewLoadUrl(String url) { protected void webViewLoadUrl(String url) {
if (webView != null) { if (webView != null) {
......
package jp.agentec.abook.abv.ui.viewer.activity;
import android.app.DownloadManager;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.view.View;
import android.view.Window;
import android.webkit.CookieManager;
import android.webkit.DownloadListener;
import android.webkit.URLUtil;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import java.util.HashMap;
import java.util.Map;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.OnlineHTMLWebViewLogic;
import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.activity.ABVContentViewActivity;
/**
* Created by ogawa-y on 2020/06/22.
*/
public class OnlineHTMLWebViewActivity extends ABVContentViewActivity {
private static final String TAG = "OnlineHTMLWebView";
private WebView webView;
private Button closeButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
Logger.i(TAG, "onCreate");
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE); // タイトルバー非表示
setContentView(R.layout.ac_online_html_webview);
TextView title = findViewById(R.id.title);
title.setText(R.string.title_quick_report_output);
setWebView();
// 引継ぎパラメータ
Intent intent = getIntent();
final String url = intent.getStringExtra("LINKURL"); // LinkURL
final Long operaitonId = intent.getLongExtra("operationId", -1);
Map<String, String> param = new HashMap<>();
if (operaitonId != -1) {
param.put("operationId", operaitonId.toString());
}
OnlineHTMLWebViewLogic logic = AbstractLogic.getLogic(OnlineHTMLWebViewLogic.class);
webView.postUrl(url, logic.getPostData(param));
// ***** 戻るボタン
closeButton = findViewById(R.id.closeBtn);
closeButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finishActivity();
}
});
}
private void setWebView() {
webView = findViewById(R.id.webView);
webView.setVisibility(View.VISIBLE);
webView.setVerticalScrollbarOverlay(true); // スクロールバー部分の隙間を消す
if (Logger.isDebugEnabled()) {
webView.setWebContentsDebuggingEnabled(true); //デバッグモード(chromeからinspect可)
}
// //ブラウザの描画領域を対象としたイベントをフック
WebSettings settings = webView.getSettings();
settings.setSupportMultipleWindows(true); // 新しいウィンドウを開くイベントを取得する
settings.setLoadsImagesAutomatically(true); // イメージを自動的にロードする
settings.setBuiltInZoomControls(true); // ズーム機能を有効にする
settings.setSupportZoom(true); // ズーム機能を有効にする
settings.setJavaScriptEnabled(true); // JavaScriptを有効にする
settings.setLoadWithOverviewMode(true); // 画面の横幅にページの横幅を合わせる
settings.setUseWideViewPort(true); // 画面の横幅にページの横幅を合わせる
settings.setPluginState(WebSettings.PluginState.ON); // 「EventHub.removeMessages(int what = 107) is not supported before the WebViewCore is set up.」のエラー対応(あまり効果ない?)
settings.setDomStorageEnabled(true); // WebStorage有効化
settings.setAppCacheEnabled(false);
settings.setCacheMode(WebSettings.LOAD_NO_CACHE);
settings.setAllowFileAccessFromFileURLs(true); //Android7利用で警告ダイヤログ表示問題対応
webView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
Logger.v(TAG, "shouldOverrideUrlLoading: %s", url);
return false;
}
});
webView.setDownloadListener(new DownloadListener() {
@Override
public void onDownloadStart(String url, String userAgent,
String contentDisposition, String mimetype,
long contentLength) {
DownloadManager.Request request = new DownloadManager.Request(
Uri.parse(url));
final String fileName = URLUtil.guessFileName(url, contentDisposition, mimetype);
request.setMimeType(mimetype);
//------------------------COOKIE!!------------------------
String cookies = CookieManager.getInstance().getCookie(url);
request.addRequestHeader("cookie", cookies);
//------------------------COOKIE!!------------------------
request.addRequestHeader("User-Agent", userAgent);
request.setTitle(fileName);
request.allowScanningByMediaScanner();
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED); //Notify client once download is completed!
request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, fileName);
DownloadManager dm = (DownloadManager) getSystemService(DOWNLOAD_SERVICE);
if (dm != null) {
dm.enqueue(request);
}
Toast.makeText(getApplicationContext(), getString(R.string.download_start), //To notify the Client that the file is being downloaded
Toast.LENGTH_LONG).show();
}
});
}
@Override
protected void finishActivity() {
setResult(RESULT_OK, new Intent());
finish();
}
}
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