Package de.odysseus.calyxo.base

Examples of de.odysseus.calyxo.base.ModuleContext


  protected ModuleSelector extend(final ModuleSelector delegate) {
    return new ModuleSelector() {
      public ModuleContext getModuleContext(HttpServletRequest request) {
        ModuleConfig config = ModuleUtils.getInstance().getModuleConfig(request);
        if (config != null) {
          ModuleContext module = getStrutsModuleContext(config);
          if (module != null) {
            return module;
          }
        }
        return delegate.getModuleContext(request);
View Full Code Here


   * @see TestCase#setUp()
   */
  protected void setUp() throws Exception {
    super.setUp();

    ModuleContext context = new TestModuleContext("test");
    I18nSupport support = new TestI18nSupport();
    context.setAttribute(I18nSupport.I18N_SUPPORT_KEY, support);
    parser = new FormsRootConfigParser(context);
  }
View Full Code Here

public class AccessTag extends TagSupport {
  private String var;

  public int doEndTag() throws JspException {
    ModuleSupport modules = ModuleSupport.getInstance(pageContext);
    ModuleContext context = modules.getModuleContext(pageContext);
    HttpServletRequest request =
      (HttpServletRequest)pageContext.getRequest();

    AccessSupport support = AccessSupport.getInstance(context);
    request.setAttribute(var, support.create(request));
View Full Code Here

    HttpServletResponse response,
    DispatchConfig dispatch
  ) throws IOException, ServletException {
    String path = null;
    if (dispatch.getAction() != null) {
      ModuleContext module = context;
      if (dispatch.getModule() != null) { // switch module
        module = support.getModuleContext(dispatch.getModule());
        if (module == null) {
          throw new ServletException("Unknown module in '" + dispatch.toInlineString() + "'");
        }
      }
      path = module.getPath(dispatch.getAction());
    } else /* if (dispatch.getPath() != null) */ {
      path = dispatch.getPath();
    }
    path = addParams(path, dispatch, "UTF-8");
    dispatch(request, response, path, dispatch.isRedirect());
View Full Code Here

  }
 
  protected ModuleSelector extend(final ModuleSelector delegate) {
    return new ModuleSelector() {
      public ModuleContext getModuleContext(HttpServletRequest request) {
        ModuleContext result = delegate.getModuleContext(request);
        if (result == null) {
          result = (ModuleContext)request.getAttribute(MODULE_CONTEXT_KEY);
        }
        return result;
      }
View Full Code Here

  /**
   * Lookup message support for module determined by specified request
   */
  public static final MessageSupport getInstance(HttpServletRequest request) {
    ModuleContext context =
      ModuleSupport.getInstance(request).getModuleContext(request);
    return (MessageSupport)context.getAttribute(MESSAGE_SUPPORT_KEY);
  }
View Full Code Here

   */
  protected String getActionAttribute() throws Exception {
    HttpServletRequest request =
      (HttpServletRequest)pageContext.getRequest();
    ModuleSupport support = ModuleSupport.getInstance(request);
    ModuleContext context = support.getModuleContext(request);
    StringBuffer buffer = new StringBuffer();
    buffer.append(request.getContextPath());
    buffer.append(context.getPath(action));
    return buffer.toString();
  }
View Full Code Here

  }
 
  protected ModuleSelector extend(final ModuleSelector delegate) {
    return new ModuleSelector() {
      public ModuleContext getModuleContext(HttpServletRequest request) {
        ModuleContext result = delegate.getModuleContext(request);
        if (result == null) {
          result = (ModuleContext)request.getAttribute(MODULE_CONTEXT_KEY);
        }
        return result;
      }
View Full Code Here

      String name = key.toString();
      ModuleAccessor result = null;
      if (name.equals(ModuleAccessor.this.getName())) {
        return ModuleAccessor.this;
      } else {
        ModuleContext context = support.getModuleContext(name);
        if (context == null) {
          if (cache.containsKey(name)) {
            cache.remove(name);
          }
          return null;
        }
        result = (ModuleAccessor)cache.get(context.getName());
        if (result == null) {
          result = new ModuleAccessor(context);
          cache.put(context.getName(), result);
        }
      }
      return result;
    }
View Full Code Here

  /**
   * Lookup panels support for module determined by specified request
   */
  public static final PanelsSupport getInstance(HttpServletRequest request) {
    ModuleContext context =
      ModuleSupport.getInstance(request).getModuleContext(request);
    return (PanelsSupport)context.getAttribute(PANELS_SUPPORT_KEY);
  }
View Full Code Here

TOP

Related Classes of de.odysseus.calyxo.base.ModuleContext

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.