Package grails.web.mapping

Examples of grails.web.mapping.UrlMappingData


            return new RegexUrlMapping(deleteUrlMappingData,controllerName, ACTION_DELETE, namespace, pluginName, null, HttpMethod.DELETE.toString(), version, deleteUrlMappingConstraints.toArray(new ConstrainedProperty[deleteUrlMappingConstraints.size()]) , servletContext);
        }

        protected UrlMapping createUpdateActionResourceRestfulMapping(String controllerName, Object pluginName, Object namespace, String version, UrlMappingData urlData, List<ConstrainedProperty> constrainedList) {
            UrlMappingData updateUrlMappingData = createFormatOnlyUrlMappingData(urlData);
            List<ConstrainedProperty> updateUrlMappingConstraints = createFormatOnlyConstraints(constrainedList);

            return new RegexUrlMapping(updateUrlMappingData,controllerName, ACTION_UPDATE, namespace, pluginName, null, HttpMethod.PUT.toString(),version, updateUrlMappingConstraints.toArray(new ConstrainedProperty[updateUrlMappingConstraints.size()]) , servletContext);
        }
View Full Code Here


            return new RegexUrlMapping(updateUrlMappingData,controllerName, ACTION_UPDATE, namespace, pluginName, null, HttpMethod.PUT.toString(),version, updateUrlMappingConstraints.toArray(new ConstrainedProperty[updateUrlMappingConstraints.size()]) , servletContext);
        }

        protected UrlMapping createPatchActionResourceRestfulMapping(String controllerName, Object pluginName, Object namespace, String version, UrlMappingData urlData, List<ConstrainedProperty> constrainedList) {
            UrlMappingData patchUrlMappingData = createFormatOnlyUrlMappingData(urlData);
            List<ConstrainedProperty> patchUrlMappingConstraints = createFormatOnlyConstraints(constrainedList);

            return new RegexUrlMapping(patchUrlMappingData,controllerName, ACTION_PATCH, namespace, pluginName, null, HttpMethod.PATCH.toString(),version, patchUrlMappingConstraints.toArray(new ConstrainedProperty[patchUrlMappingConstraints.size()]) , servletContext);
        }
View Full Code Here

            return new RegexUrlMapping(patchUrlMappingData,controllerName, ACTION_PATCH, namespace, pluginName, null, HttpMethod.PATCH.toString(),version, patchUrlMappingConstraints.toArray(new ConstrainedProperty[patchUrlMappingConstraints.size()]) , servletContext);
        }

        protected UrlMapping createEditActionResourceRestfulMapping(String controllerName, Object pluginName, Object namespace, String version, UrlMappingData urlData, ConstrainedProperty[] constraintArray) {
            UrlMappingData editMappingData = urlData.createRelative("/edit");
            return new RegexUrlMapping(editMappingData,controllerName,ACTION_EDIT, namespace, pluginName, null, HttpMethod.GET.toString(),version, constraintArray, servletContext);
        }
View Full Code Here

            UrlMappingData editMappingData = urlData.createRelative("/edit");
            return new RegexUrlMapping(editMappingData,controllerName,ACTION_EDIT, namespace, pluginName, null, HttpMethod.GET.toString(),version, constraintArray, servletContext);
        }

        protected UrlMapping createShowActionResourceRestfulMapping(String controllerName, Object pluginName, Object namespace, String version, UrlMappingData urlData, List<ConstrainedProperty> constrainedList) {
            UrlMappingData showUrlMappingData = createFormatOnlyUrlMappingData(urlData);
            List<ConstrainedProperty> showUrlMappingConstraints = createFormatOnlyConstraints(constrainedList);

            return new RegexUrlMapping(showUrlMappingData,controllerName, ACTION_SHOW, namespace, pluginName, null, HttpMethod.GET.toString(), version, showUrlMappingConstraints.toArray(new ConstrainedProperty[showUrlMappingConstraints.size()]) , servletContext);
        }
View Full Code Here

*        Time: 7:50:41 AM
*/
public class UrlMappingDataTests extends TestCase {

    public void testOptionals() {
        UrlMappingData data = new DefaultUrlMappingData("/surveys/(*)?");

        assertEquals(2, data.getTokens().length);
        assertTrue(data.isOptional(0));
    }
View Full Code Here

        assertEquals(2, data.getTokens().length);
        assertTrue(data.isOptional(0));
    }

    public void testTokens() {
        UrlMappingData data = new DefaultUrlMappingData("/blog/(*)/2007/(*)?");

        String[] tokens = data.getTokens();

        assertFalse(tokens.length == 0);

        assertEquals("blog",tokens[0]);
        assertEquals("(*)",tokens[1]);
        assertEquals("2007",tokens[2]);
        assertEquals("(*)?",tokens[3]);

        assertFalse(data.isOptional(0));
        assertTrue(data.isOptional(1));
    }
View Full Code Here

        assertFalse(data.isOptional(0));
        assertTrue(data.isOptional(1));
    }

    public void testLogicalUrls() {
        UrlMappingData data = new DefaultUrlMappingData("/blog/(*)?/2007/*/*?");

        String[] urls = data.getLogicalUrls();

        assertEquals(3, urls.length);

        assertEquals("/blog/(*)?/2007/*/*?", urls[0]);
        assertEquals("/blog/(*)?/2007/*", urls[1]);
View Full Code Here

    }

    public void testUrlMappingDataParser() {
        UrlMappingParser parser = new DefaultUrlMappingParser();

        UrlMappingData data = parser.parse("/blog/(*)?/2007/*/*?");

        String[] urls = data.getLogicalUrls();

        assertEquals(3, urls.length);

        assertEquals("/blog/(*)?/2007/*/*?", urls[0]);
        assertEquals("/blog/(*)?/2007/*", urls[1]);
View Full Code Here

TOP

Related Classes of grails.web.mapping.UrlMappingData

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.