Examples of GrailsControllerClass


Examples of grails.core.GrailsControllerClass

        return null;
    }

    private String getActionName(GrailsApplication application, String controllerName) {
        if (application != null) {
            final GrailsControllerClass controllerClass = (GrailsControllerClass) application.getArtefactByLogicalPropertyName(ControllerArtefactHandler.TYPE, controllerName);
            if (controllerClass != null) {
                return controllerClass.getDefaultAction();
            }
        }
        return null;
    }
View Full Code Here

Examples of grails.core.GrailsControllerClass

     * @return true if it is a flow request
     */
    public boolean isFlowRequest() {
        GrailsApplication application = getAttributes().getGrailsApplication();
        Object controllerClassObject = getControllerClass();
        GrailsControllerClass controllerClass = null;
        if(controllerClassObject instanceof GrailsControllerClass) {
            controllerClass = (GrailsControllerClass) controllerClassObject;
        }

        if (controllerClass == null) return false;

        String actionName = getActionName();
        if (actionName == null) actionName = controllerClass.getDefaultAction();
        if (actionName == null) return false;

        return false;
    }
View Full Code Here

Examples of grails.core.GrailsControllerClass

        GroovyPageScriptSource scriptSource = null;
        if(grailsApplication != null) {
          Object controllerArtefact = grailsApplication.getArtefact("Controller", controller.getClass().getName());
          if(controllerArtefact instanceof GrailsControllerClass) {
            GrailsControllerClass gcc = (GrailsControllerClass)controllerArtefact;
            String namespace = gcc.getNamespace();
            if(namespace != null) {
          scriptSource = findPage("/" + namespace + uriService.getViewURI(controllerName, viewNameWithFormat));
          if(scriptSource == null) {
            scriptSource = findPage("/" + namespace + uriService.getViewURI(controllerName, viewName));
          }
View Full Code Here

Examples of org.codehaus.groovy.grails.commons.GrailsControllerClass

        public GrailsControllerClass getControllerClassByName(String arg) {
            return null;
        }

        public GrailsControllerClass getControllerClassByURI(String arg0) {
            GrailsControllerClass res = mock(GrailsControllerClass.class);
            when(res.getFullName()).thenReturn("my.controller.MyClass");
            when(res.getShortName()).thenReturn("MyClass");
            return res;
        }
View Full Code Here

Examples of org.codehaus.groovy.grails.commons.GrailsControllerClass

        public ModelAndView handleURI(String uri, GrailsWebRequest webRequest, @SuppressWarnings("rawtypes") Map parms) {
            if (whenToBlowUp.equals("blowUpBeforeController")) {
                throw new RuntimeException("Kaboom");
            }

            GrailsControllerClass controllerClass = getControllerClassByURI(uri);
            assertNotNull(controllerClass);
            if (whenToBlowUp.equals("blowUpAfterController")) {
                throw new RuntimeException("Kaboom2");
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.