use of org.alfresco.rest.api.model.Preference in project alfresco-remote-api by Alfresco.
the class PreferencesImpl method getPreferences.
public CollectionWithPagingInfo<Preference> getPreferences(String personId, Paging paging) {
personId = people.validatePerson(personId);
PagingResults<Pair<String, Serializable>> preferences = preferenceService.getPagedPreferences(personId, null, Util.getPagingRequest(paging));
List<Preference> ret = new ArrayList<Preference>(preferences.getPage().size());
for (Pair<String, Serializable> prefEntity : preferences.getPage()) {
Preference pref = new Preference(prefEntity.getFirst(), prefEntity.getSecond());
ret.add(pref);
}
return CollectionWithPagingInfo.asPaged(paging, ret, preferences.hasMoreItems(), preferences.getTotalResultCount().getFirst());
}
use of org.alfresco.rest.api.model.Preference in project alfresco-remote-api by Alfresco.
the class PreferencesImpl method getPreference.
public Preference getPreference(String personId, String preferenceName) {
personId = people.validatePerson(personId);
Serializable preferenceValue = preferenceService.getPreference(personId, preferenceName);
if (preferenceValue != null) {
return new Preference(preferenceName, preferenceValue);
} else {
throw new RelationshipResourceNotFoundException(personId, preferenceName);
}
}
Aggregations