I have a java servlet that works as a REST service. My data is delivered through a categorized view with 3 categorized columns.
I create a view navigator using the View.createViewNavFromCategory("2014\43") where the category specified adheres to the first two categorized columns.
2014 = year and 43 = week number, which means there can be up to 53 second column categories.
My categorized columns are sorted decending. For some strange reason I found that all columns had to be sorted the same way (undocumented).
My code:
String viewCategory = "";
if (isYearSpecified) viewCategory = <year parameter>;
if (isWeekSpecified) viewCategory = viewCategory + "\\" + <week parameter>;
ViewNavigator nav = lookupView.createViewNavFromCategory(viewCategory);
//and set the size of the preloading cache:
nav.setBufferMaxEntries(numCacheEntries);
// Initialize list of JSON income objects
List prognosisJSON = new ArrayList();
//and then traverse the view:
ViewEntry currEntry = nav.getFirst();
This works as a charm until I specify a week lower than 13. If using category "2014\12", "2014\11" and lower the viewEntry returns null when trying to access the first entry in the navigator.
I should perhaps add that my view contains 2102 documents in categories before the one that fails (if there is an undocumented max limit).
What can I do to prevent this?