Tabnine Logo
DispatcherUtil
Code IndexAdd Tabnine to your IDE (free)

How to use
DispatcherUtil
in
com.manydesigns.portofino.dispatcher

Best Java code snippets using com.manydesigns.portofino.dispatcher.DispatcherUtil (Showing top 12 results out of 315)

origin: com.manydesigns/portofino-pageactions

public static Dispatch getDispatch(HttpServletRequest request) {
  Dispatcher dispatcher = get(request);
  return getDispatch(dispatcher, request);
}
origin: com.manydesigns/portofino-pageactions

public void doFilter(ServletRequest request,
           ServletResponse response,
           FilterChain chain
) throws IOException, ServletException {
  // cast to http type
  HttpServletRequest httpRequest = (HttpServletRequest) request;
  logger.debug("Installing the dispatcher in the http current request");
  DispatcherUtil.install(httpRequest);
  chain.doFilter(request, response);
}
origin: com.manydesigns/portofino-pageactions

protected Dispatch getDispatch(String path) {
  HttpServletRequest request = ElementsThreadLocals.getHttpServletRequest();
  Dispatcher dispatcher = DispatcherUtil.get(request);
  return dispatcher != null ?
      dispatcher.getDispatch(path) :
      null;
}
origin: com.manydesigns/portofino-pageactions

public Resolution intercept(ExecutionContext context) throws Exception {
  logger.debug("Retrieving Stripes objects");
  ActionBeanContext actionContext = context.getActionBeanContext();
  ActionBean actionBean = context.getActionBean();
  Method handler = context.getHandler();
  logger.debug("Retrieving Servlet API objects");
  HttpServletRequest request = actionContext.getRequest();
  Dispatch dispatch = DispatcherUtil.getDispatch(request);
  if(SecurityLogic.isAllowed(request, dispatch, actionBean, handler)) {
    logger.debug("Security check passed.");
    return context.proceed();
  } else {
    return new ForbiddenAccessResolution();
  }
}
origin: com.manydesigns/portofino-pageactions

@Path(":pages")
@GET
@Produces(MimeTypes.APPLICATION_JSON_UTF8)
public NavigationItem getPages() {
  Configuration configuration = (Configuration) servletContext.getAttribute(BaseModule.PORTOFINO_CONFIGURATION);
  String landingPage = configuration.getString(PortofinoProperties.LANDING_PAGE);
  if(landingPage != null) {
    HttpServletRequest request = ElementsThreadLocals.getHttpServletRequest();
    return new Navigation(
        configuration, DispatcherUtil.get(request).getDispatch(landingPage), SecurityUtils.getSubject(), false).
        getRootNavigationItem();
  } else {
    return null;
  }
}
origin: com.manydesigns/portofino-pageactions

ognlContext.put("textProvider", new TextProviderBean(ElementsThreadLocals.getTextProvider()));
Dispatch dispatch = DispatcherUtil.getDispatch(actionContext);
if (dispatch != null) {
  HttpServletRequest request = actionContext.getRequest();
origin: com.manydesigns/portofino-pageactions

public static Dispatch getDispatch(ActionBeanContext context) {
  HttpServletRequest request = context.getRequest();
  Dispatcher dispatcher = get(request);
  if(context instanceof ElementsActionBeanContext) {
    String actionPath = ((ElementsActionBeanContext) context).getActionPath();
    return dispatcher.getDispatch(actionPath);
  } else {
    return getDispatch(request);
  }
}
origin: com.manydesigns/portofino-admin

@Before
public Resolution prepare() {
  Dispatcher dispatcher = DispatcherUtil.get(context.getRequest());
  dispatch = dispatcher.getDispatch(originalPath);
  try{
    pageInstance = dispatch.getLastPageInstance();
  }catch (Exception e){
    logger.warn(e.getMessage());
    return new ForbiddenAccessResolution();
  }
  if(pageInstance==null || !SecurityLogic.hasPermissions(
      portofinoConfiguration, pageInstance, SecurityUtils.getSubject(), AccessLevel.EDIT)) {
    return new ForbiddenAccessResolution();
  } else {
    return null;
  }
}
origin: com.manydesigns/portofino-pageactions

@Override
protected ActionBean makeNewActionBean(
    Class<? extends ActionBean> type, ActionBeanContext context) throws Exception {
  Dispatch dispatch = DispatcherUtil.getDispatch(context.getRequest());
  if(dispatch != null) {
    PageInstance pageInstance = dispatch.getLastPageInstance();
    if(type.equals(pageInstance.getActionClass())) {
      if(pageInstance.getActionBean() != null) {
        return pageInstance.getActionBean();
      } else {
        assert false;
        if(DispatcherLogic.isValidActionClass(type)) {
          ActionBean actionBean = super.makeNewActionBean(type, context);
          pageInstance.setActionBean((PageAction) actionBean);
          return actionBean;
        } else {
          throw new Exception("Invalid action bean type for dispatch: " + type); //TODO
        }
      }
    }
  }
  return super.makeNewActionBean(type, context);
}
origin: com.manydesigns/portofino-pageactions

public static Dispatch getDispatch(HttpServletRequest request, Object actionBean) {
  Dispatcher dispatcher = get(request);
  if(actionBean instanceof AbstractActionBean) {
    String actionPath = ((AbstractActionBean) actionBean).getContext().getActionPath();
    return dispatcher.getDispatch(actionPath);
  } else {
    return getDispatch(request);
  }
}
origin: com.manydesigns/portofino-admin

  return new ForbiddenAccessResolution("You are not authorized to delete this page.");
Dispatcher dispatcher = DispatcherUtil.get(context.getRequest());
String contextPath = context.getRequest().getContextPath();
String landingPagePath = portofinoConfiguration.getString(PortofinoProperties.LANDING_PAGE);
origin: com.manydesigns/portofino-admin

Dispatcher dispatcher = DispatcherUtil.get(context.getRequest());
String contextPath = context.getRequest().getContextPath();
String landingPagePath = portofinoConfiguration.getString(PortofinoProperties.LANDING_PAGE);
Dispatcher dispatcher = DispatcherUtil.get(context.getRequest());
Dispatch destinationDispatch = dispatcher.getDispatch(destinationPagePath);
com.manydesigns.portofino.dispatcherDispatcherUtil

Most used methods

  • get
  • getDispatch
  • install

Popular in Java

  • Running tasks concurrently on multiple threads
  • scheduleAtFixedRate (Timer)
  • setRequestProperty (URLConnection)
  • getApplicationContext (Context)
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • JList (javax.swing)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Option (scala)
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now