コード例 #1
0
ファイル: EntityEditorPage.java プロジェクト: xwic/sandbox
 @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);
   }
 }
コード例 #2
0
ファイル: RoleEditorCreator.java プロジェクト: xwic/sandbox
  /*
   * (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;
  }
コード例 #3
0
ファイル: EntityEditorPage.java プロジェクト: xwic/appkit
  protected void closeEditor() {

    Site site = ExtendedApplication.getInstance(this).getSite();
    site.popPage(this);
  }
コード例 #4
0
ファイル: HttpTraceFilter.java プロジェクト: ApipA/appkit
  /* (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);
      }
    }
  }