public void saveFavorites ( List < CmsFavoriteEntry > favorites ) throws CmsException { try { JSONObject json = new JSONObject ( ) ; JSONArray array = new JSONArray ( ) ; for ( CmsFavoriteEntry entry : favorites ) { array . put ( entry . toJson ( ) ) ; } json . put ( BASE_KEY , array ) ; String data = json . toString ( ) ; CmsUser user = readUser ( ) ; user . setAdditionalInfo ( ADDINFO_KEY , data ) ; m_cms . writeUser ( user ) ; } catch ( JSONException e ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; } }
Saves the favorites .