Ejemplo n.º 1
0
 @Override
 public void modelContentChanged(EditorModelEvent event) {
   if (EditorModelEvent.CLOSE_REQUEST == event.getEventType()) {
     // someone wants to close this
     Site site = ExtendedApplication.getInstance(this).getSite();
     site.popPage(this);
   }
 }
Ejemplo n.º 2
0
  /*
   * (non-Javadoc)
   *
   * @see de.xwic.appkit.webbase.actions.editors.IEntityEditorCreator#createAndOpenEditor(de.xwic.appkit.webbase.toolkit.app.Site,
   * de.xwic.appkit.core.dao.IEntity, de.xwic.appkit.core.dao.IEntity)
   */
  @Override
  public EditorModel createAndOpenEditor(Site site, IEntity entity, IEntity baseEntity) {
    RolesEditorModel model = new RolesEditorModel((IRole) entity);

    RolesEditorPage page = new RolesEditorPage(site.getContentContainer(), "rolesEditor", model);
    site.pushPage(page);

    return model;
  }
Ejemplo n.º 3
0
  protected void closeEditor() {

    Site site = ExtendedApplication.getInstance(this).getSite();
    site.popPage(this);
  }
Ejemplo n.º 4
0
  /* (non-Javadoc)
   * @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain)
   */
  @Override
  public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
      throws IOException, ServletException {

    if (!Trace.isEnabled()) {

      chain.doFilter(req, res);

    } else {

      ITraceContext traceCtx = Trace.startTrace();
      try {

        traceCtx.setAttribute(ATTR_REMOTE_ADDR, req.getRemoteAddr());
        if (req instanceof HttpServletRequest) {
          HttpServletRequest hReq = (HttpServletRequest) req;
          traceCtx.setAttribute(ATTR_QUERY_STRING, hReq.getQueryString());
          traceCtx.setAttribute(ATTR_METHOD, hReq.getMethod());
          traceCtx.setAttribute(ATTR_REQUEST_URI, hReq.getRequestURI());
          traceCtx.setAttribute(ATTR_REMOTE_USER, hReq.getRemoteUser());
          String s = hReq.getParameter("__action");
          if (s != null) {
            traceCtx.setAttribute(ATTR_JWIC_ACTION, s);
          }
          s = hReq.getParameter("__ctrlid");
          if (s != null) {
            traceCtx.setAttribute(ATTR_JWIC_CONTROL, s);
          }
        }

        chain.doFilter(req, res);
        if (req instanceof HttpServletRequest) {
          HttpServletRequest hReq = (HttpServletRequest) req;
          String s = hReq.getParameter("_msid");
          if (s != null) { // JWic Session ID -> See if its a XWic App and store info.
            SessionContext ctx =
                JWicRuntime.getJWicRuntime().getSessionContext(hReq.getSession().getId(), s, hReq);
            if (ctx != null) {
              if (ctx.getApplication() instanceof ExtendedApplication) {
                ExtendedApplication eApp = (ExtendedApplication) ctx.getApplication();
                Site site = eApp.getSite();
                if (site != null) {
                  traceCtx.setAttribute(ATTR_SITE_MODULE, site.getActiveModuleKey());
                  traceCtx.setAttribute(ATTR_SITE_SUBMODULE, site.getActiveSubModuleKey());
                  BreadCrumbControl bcc = (BreadCrumbControl) site.getControl("breadCrumb");
                  if (bcc != null) {
                    StringBuilder path = new StringBuilder();
                    for (String key : bcc.getBreadCrumbs()) {
                      if (path.length() != 0) {
                        path.append(" >> ");
                      }
                      path.append(bcc.getCrumbTitle(key));
                    }
                    traceCtx.setAttribute(ATTR_USER_PATH, path.toString());
                  }
                }
              }
            }
          }
        }

      } finally {

        // log trace information?
        Trace.endTrace();
        Trace.getDataManager().handleTraceResult(traceCtx);
      }
    }
  }