Commit 22f66fba by Lee Munkyeong

グループ検索API連動修正

parent 735f5ace
......@@ -56,5 +56,7 @@ public interface ABookCommConstants {
Integer OFF = 0;
Integer ON = 1;
}
Integer GROUP_REQUEST_ALL = 0;
}
}
......@@ -3,51 +3,21 @@ package jp.agentec.abook.abv.bl.logic;
import org.json.adf.JSONArray;
import org.json.adf.JSONObject;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import jdk.nashorn.internal.parser.JSONParser;
import jp.agentec.abook.abv.bl.acms.client.AcmsClient;
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.client.parameters.AcmsContentCheckParameters;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.constant.ABookCommConstants;
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.common.util.ContentFileUtil;
import jp.agentec.abook.abv.bl.common.util.JsonUtil;
import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
import jp.agentec.abook.abv.bl.data.dao.ChatMessageDao;
import jp.agentec.abook.abv.bl.data.dao.ChatRoomDao;
import jp.agentec.abook.abv.bl.data.dao.ContentCategoryDao;
import jp.agentec.abook.abv.bl.data.dao.ContentDao;
import jp.agentec.abook.abv.bl.data.dao.ContentGroupDao;
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.ContentResourceDao;
import jp.agentec.abook.abv.bl.data.dao.ContentTagDao;
import jp.agentec.abook.abv.bl.data.dao.GroupDao;
import jp.agentec.abook.abv.bl.data.dao.ShopMemberDao;
import jp.agentec.abook.abv.bl.dto.ChatMessageDto;
import jp.agentec.abook.abv.bl.dto.ChatRoomDto;
import jp.agentec.abook.abv.bl.dto.ContentDto;
import jp.agentec.abook.abv.bl.dto.ContentPageDto;
import jp.agentec.abook.abv.bl.dto.ContentTagDto;
import jp.agentec.abook.abv.bl.dto.GroupDto;
import jp.agentec.abook.abv.bl.dto.ShopMemberDto;
import jp.agentec.abook.abv.bl.dto.comparator.ContentPageDtoComparator;
import jp.agentec.adf.util.FileUtil;
import jp.agentec.adf.util.StringUtil;
/**
* @author Lee-mk
......@@ -155,6 +125,10 @@ public class CommunicationLogic extends AbstractLogic {
return groupIds;
}
public List<GroupDto> getAllGroup() {
return groupDao.getAllGroups();
}
public String getFavoriteUsers() {
List<ShopMemberDto> favoriteUsers = shopMemberDao.getfavoriteUserList();
......
......@@ -40,6 +40,7 @@ import jp.agentec.abook.abv.bl.acms.client.json.MessageInfoListJSON;
import jp.agentec.abook.abv.bl.acms.client.json.MyInfoJSON;
import jp.agentec.abook.abv.bl.acms.client.json.RoomListJSON;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.constant.ABookCommConstants;
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.NetworkDisconnectedException;
......@@ -125,6 +126,7 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
isOnline = true;
chatWebviewUrl = CHAT_PAGE_URL;
updateMyInfoFromServer();
updateAllGroupInfo();
}
} catch (Exception e) {
Logger.d("SID_CHECK_ERROR");
......@@ -765,6 +767,7 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
String myGroupUsersStr = communicationLogic.getMyGroupUsers();
return myGroupUsersStr;
}
@JavascriptInterface
public String getFavoriteGroups() {
String favoriteGroupsStr = communicationLogic.getFavoriteGroups();
......@@ -809,6 +812,14 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
GroupListJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).getGroupInfo(sid,groupIds,DEFAULT_CHECKSUM);
communicationLogic.updateGroup(resultJson.groupList);
}
private void updateAllGroupInfo() throws NetworkDisconnectedException, AcmsException {
updateGroupInfoFromServer(ABookCommConstants.FLAG.GROUP_REQUEST_ALL.toString());
List<GroupDto> groupList = communicationLogic.getAllGroup();
for (GroupDto group : groupList) {
updateGroupInfoFromServer(Integer.toString(group.groupId));
}
}
/** 
* ボタンイベント設定
*/
......
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