* @param responsetypesetter TODO javadoc
*/
public final void processService(final CRNavigationRequestBuilder reqBuilder, final Map<String, Resolvable> wrappedObjectsToDeploy,
final OutputStream stream, final IResponseTypeSetter responsetypesetter) {
Collection<CRResolvableBean> coll;
CRNavigationRequestBuilder myReqBuilder = reqBuilder;
ContentRepository cr = null;
ContentRepositoryConfig contentRepository = myReqBuilder.getContentRepositoryConfig();
try {
cr = contentRepository.getContentRepository(responseEncoding, conf);
contenttype = cr.getContentType();
responsetypesetter.setContentType(getContentType());
CRRequest req = myReqBuilder.getNavigationRequest();
//DEPLOY OBJECTS TO REQUEST
for (Map.Entry<String, Resolvable> entry : wrappedObjectsToDeploy.entrySet()) {
req.addObjectForFilterDeployment(entry.getKey(), entry.getValue());
}
// Query the Objects from RequestProcessor
coll = rp.getNavigation(req);
// add the objects to repository as serializeable beans
if (coll != null) {
for (CRResolvableBean bean : coll) {
cr.addObject(bean);
}
}
cr.toStream(stream);
} catch (CRException e1) {
//CR Error Handling
//CRException is passed down from methods that want to post
//the occured error to the client
cr.respondWithError((OutputStream) stream, e1, myReqBuilder.isDebug());
log.debug(e1.getMessage(), e1);
} catch (Exception ex) {
CRException crex = new CRException(ex);
if (cr != null) {
cr.respondWithError((OutputStream) stream, crex, myReqBuilder.isDebug());
log.debug(ex.getMessage(), ex);
} else {
log.error("Cannot initialize ContentRepository", ex);
}