Package org.corrib.s3b.mbb.beans

Examples of org.corrib.s3b.mbb.beans.ServletCallBean


      this.setStaticContent(obj);
     
      JSONArray items = new JSONArray();
      obj.put("items", items);
     
      ServletCallBean callBean = (ServletCallBean)req.getAttribute("callBean");
     
    try {
      Map<String, Map<String, Collection<String>>> triples = callBean.getGraphStats().getTriples();
      for(String resource : callBean.getGraphStats().getResults()){
        String type = MbbTypes.detectType(triples, resource);
       
        if("book".equals(type))
          items.add(this.jsonBook(triples, resource, serverAddress));
        else if("person".equals(type))
View Full Code Here


 
  /* (non-Java-doc)
   * @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
   */
  protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    ServletCallBean bean = (ServletCallBean)request.getAttribute("callBean");   
    String dispatcherUrl = null;
   
    if(bean != null) {
      LocalRepository repo = bean.getRepository();
     
      try {
        dispatcherUrl = ((StatsMetaService)bean.getChain().getMetaservice()).executeStats(repo);
      } catch (AccessDeniedException e) {
        response.sendError(500, "Graph access problem: "+e);
      }
     
     
View Full Code Here

   * @throws IOException
   */
  protected ServletCallBean preprocess(HttpServletRequest request) {
    String serialize = request.getParameter(PARAM_SERIALIZE);
    FieldValueWrapperMap reqparams = ContextKeeper.readRequestParams(request);
    ServletCallBean bean = new ServletCallBean();
    boolean isAjaxCall = "XMLHttpRequest".equals(request.getHeader("X-Requested-With"));
   
    bean.setSerialization((ISerialization)null);
    bean.setRequest(request);
   
   
    bean.setCall(request.getRequestURL().toString());
    bean.setChain(ServiceChain.decode(bean.getCall(), ConfigKeeper.getServiceUrl()));
   
   
    bean.setParams(reqparams);
    bean.setMethod(request.getMethod());
   
    bean.getChain().setUser(request.getUserPrincipal());
    bean.setRequest(request);
   
   
    request.setAttribute("call", bean.getCall());
    request.setAttribute("callBean", bean);

    this.selectSerialization(bean, isAjaxCall, serialize);
   
    return bean;
View Full Code Here

   * @param serialize
   */
  protected abstract void selectSerialization(ServletCallBean bean, boolean isAjaxCall, String serialize);

  protected void processServlet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
    ServletCallBean bean = this.preprocess(request);
    bean.setResponse(response);
   
    request.setAttribute("time", System.currentTimeMillis());
    request.setAttribute("callAxisPath", bean.getParams().getValueS("callAxisPath"));
   
   
    if(!(bean.getChain().getMetaservice() instanceof GetIdMetaService) &&
       !(bean.getChain().getMetaservice() instanceof ChainMetaService)) {
      this.process(bean);
    }
   
    this.send(bean, request, response);   
  }
View Full Code Here

TOP

Related Classes of org.corrib.s3b.mbb.beans.ServletCallBean

Copyright © 2018 www.massapicom. 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.