Modify

Ticket #32 (closed enhancement: completed)

Opened 4 years ago

Last modified 3 years ago

Implement configurable URL schemes as an enhancement to URL management features

Reported by: folkstring@… Owned by: kurtwiersma
Priority: critical Milestone: Mach-II 1.8.0 alpha
Component: framework - core Version: 1.8.0 - Framework
Keywords: BuildUrl BuildRoute url routes route urls SES friendly Cc:
Blocked By: Blocking:

Description

I am proposing an enhancement to the URL management features of Mach-II. After working with buildUrl() extensively in a recent project, I found myself wishing for more features.

Here are the problems I was experiencing:

  1. No way to easily retrieve a built URL for the current request
  1. No way to easily pop in new values for one or two URL parameters (e.g., pagination, sorting columns)
  1. Cumbersome syntax to pass in URL parameters as pipe-delimited string
  1. Passing in URL parameters as a structure cannot be accomplished in one line on CF7
  1. No way to hide names of URL parameters in built URLs (sometimes necessary when managing URLs through a rewrite program)
  1. No way to guarantee the order of certain parameters in the built URL (again, necessary when rewriting URLs at the Web server)

To overcome these issues, I propose the following:

  1. Provide buildCurrentUrl() method to build the URL for the current request
  1. Provide an interface into the current URL to assign new values to specific parameters
  1. Provide alternate syntax for passing URL parameters into buildUrl() -- specifically, use alternating name/value parameters:
buildUrl('parameter1', parameter1Value, 'parameter2', parameter2Value, ...)
  1. Create new elements in Mach-II config XML to establish one or more URL schemes that can be called throughout the framework

I have attached a short text file with some sample syntax for the XML and some proposed object/method descriptions.

Attachments

url_schemes.txt Download (1.5 KB) - added by folkstring@… 4 years ago.
Sample URL scheme syntax

Change History

Changed 4 years ago by folkstring@…

Sample URL scheme syntax

comment:1 Changed 4 years ago by peterfarrell

  • Status changed from new to assigned

Definitely something already on the list for 2.0 (as I mentioned in my presentation at cf.Objective). Thanks for the suggestions.

comment:1 Changed 3 years ago by kurtwiersma

  • Owner changed from peterfarrell to kurtwiersma
  • Status changed from assigned to new
  • Version changed from 2.0.0 to 1.8.0
  • Milestone set to Mach-II 1.8.0 alpha

This ticket has been chosen for Mach II 1.8. More information can be found on the MachII1.8SESImprovements wiki page.

comment:2 Changed 3 years ago by peterfarrell

  • hours set to 0
  • estimatedhours set to 0
  • totalhours set to 0
  • billable set to 1

I was thinking it would be great if the property could optionally output the syntax required for Apache Rewrite to a location on disk which then could be included in an httpd.conf file via a link.. This would allow deploying a Mach-II application with route easier as you don't have to manually update the rewriting rules in Apache. Thoughts?

comment:3 Changed 3 years ago by peterfarrell

Kurt, you'll need to add support for routes in the form tag library's form tag. Right now we have actionEvent and optionally actionModule / actionUrlParams attributes to build urls. I think we need to add actionRoute and actionRouteParams both of which would be mutually exclusive to routes versus event.

comment:4 Changed 3 years ago by peterfarrell

I guess redirect needs to be upgraded as well to support routes as well.

comment:5 Changed 3 years ago by kurtwiersma

We have decide not to implement #3 under the proposed buildUrl section.

comment:6 Changed 3 years ago by peterfarrell

Just wanted to comment on item number 6 on the list of things to fix. I think we can fix this by taking in the incoming struct and building the url by sorting the struct keys. We currently don't sort the struct keys when building the URL so this should be an easy fix.

comment:7 Changed 3 years ago by peterfarrell

  • Keywords BuildUrl BuildRoute url routes route urls SES friendly added

comment:8 Changed 3 years ago by peterfarrell

  • Priority changed from minor to critical

Just wanted to mention that this feature enhancement is detailed in the M2SPF SES Improvements

comment:10 Changed 3 years ago by kurtwiersma

[None] - buildCurrentUrl() now works with SES urlsn- Alpha ordered the url args for the url that come out of buildUrl()n- refs #32

comment:11 Changed 3 years ago by kurtwiersma

  • Status changed from new to closed
  • Resolution set to completed

comment:12 Changed 3 years ago by peterfarrell

FYI, if you want a more name/value tag based format to do buildUrl check out the new <a> tag in the view custom tag library that ships with Mach-II 1.8. Check out the wiki for how to do it.

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.