Examples of CRNavigationRequestBuilder


Examples of com.gentics.cr.util.CRNavigationRequestBuilder

    // starttime
    long s = new Date().getTime();
    HashMap<String, Resolvable> objects = new HashMap<String, Resolvable>();
    objects.put("request", new BeanWrapper(request));
    objects.put("session", new HttpSessionWrapper(request.getSession()));
    CRNavigationRequestBuilder requestBuilder = new CRNavigationRequestBuilder(request, crConf);
    container.processService(requestBuilder, objects, response.getOutputStream(), new ServletResponseTypeSetter(
        response));
    response.getOutputStream().flush();
    response.getOutputStream().close();
    // endtime
View Full Code Here

Examples of com.gentics.cr.util.CRNavigationRequestBuilder

   * @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);
      }

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.