use of org.apache.shindig.protocol.DataCollection in project liferay-ide by liferay.
the class LiferayAppDataService method doGetPersonData.
protected DataCollection doGetPersonData(Set<UserId> userIds, GroupId groupId, String appId, Set<String> fields, SecurityToken securityToken) throws Exception {
long companyId = getCompanyId(securityToken);
Map<String, Map<String, String>> peopleAppData = new HashMap<String, Map<String, String>>();
List<ExpandoColumn> expandoColumns = getExpandoColumns(companyId, appId);
if (expandoColumns == null) {
return null;
}
if (fields.isEmpty()) {
fields = new LinkedHashSet<String>();
for (ExpandoColumn expandoColumn : expandoColumns) {
fields.add(expandoColumn.getName());
}
}
for (UserId userId : userIds) {
String userIdString = userId.getUserId(securityToken);
long userIdLong = GetterUtil.getLong(userIdString);
Map<String, String> personAppData = new HashMap<String, String>();
for (String field : fields) {
String value = getExpandoValue(companyId, appId, userIdLong, getColumnName(appId, field));
personAppData.put(field, value);
}
peopleAppData.put(userIdString, personAppData);
}
return new DataCollection(peopleAppData);
}
Aggregations