Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Routing question
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  23 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
raulriera  
View profile  
 More options Apr 3, 4:17 pm
From: raulriera <rierar...@gmail.com>
Date: Fri, 3 Apr 2009 13:17:15 -0700 (PDT)
Local: Fri, Apr 3 2009 4:17 pm
Subject: Routing question
Hi,

I may be trying to bend the rules here, but I was wondering if anyone
knew how to do this

routes.cfm

<cfset addRoute(name="userContracts", pattern="users/[userId]/
contracts/[action]/[key]", controller="contracts")>
<cfset addRoute(name="userContracts", pattern="users/[userId]/
contracts/[action]", controller="contracts")>
<cfset addRoute(name="userContracts", pattern="users/[userId]/
contracts/", controller="contracts", action="index")>

I can do

linkTo(route="userContracts") just fine, but the link instead of beign

users/1/contracts

becomes

users/contracts


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Peters  
View profile  
 More options Apr 3, 5:06 pm
From: Chris Peters <ch...@clearcrystalmedia.com>
Date: Fri, 3 Apr 2009 17:06:47 -0400
Local: Fri, Apr 3 2009 5:06 pm
Subject: Re: [cfwheels] Routing question

I've been having some troubles with routes myself.

If I do something like this, calls to linkTo() fail:

<cfset addRoute(name="adminSettings", pattern="admin/settings/[action]",
controller="AdminSettings", action="index")>
<cfset addRoute(name="adminSettingsMain", pattern="admin/settings",
controller="AdminSettings", action="index")>


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
raulriera  
View profile  
 More options Apr 3, 8:01 pm
From: raulriera <rierar...@gmail.com>
Date: Fri, 3 Apr 2009 17:01:13 -0700 (PDT)
Local: Fri, Apr 3 2009 8:01 pm
Subject: Re: Routing question
How are you handling that /admin on your app? I am wondering how to do
that as well (if that is the "best" way to go anyway)

On Apr 4, 4:06 pm, Chris Peters <ch...@clearcrystalmedia.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Peters  
View profile  
 More options Apr 4, 1:18 am
From: Chris Peters <ch...@clearcrystalmedia.com>
Date: Sat, 4 Apr 2009 01:18:13 -0400
Local: Sat, Apr 4 2009 1:18 am
Subject: Re: [cfwheels] Re: Routing question

I've decided to just go with putting an entire copy of Wheels in the admin
folder. It's not as important to have the full rewriting, and my admin
section is going to be rather large so as to be too much for one single
admin controller.

I'm going to be playing around with virtual directories in Apache to see if
I can at least get the admin area to share the same config and models as the
base app. Will let you know how that works out.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
raulriera  
View profile  
 More options Apr 4, 5:31 am
From: raulriera <rierar...@gmail.com>
Date: Sat, 4 Apr 2009 02:31:37 -0700 (PDT)
Local: Sat, Apr 4 2009 5:31 am
Subject: Re: Routing question
Ohhhhh that would be too sweet actually, I am struggling right now on
how to manage this... (too much used to the old ways) If you find
anything please share :)

On Apr 5, 12:18 am, Chris Peters <ch...@clearcrystalmedia.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
raulriera  
View profile  
 More options Apr 4, 6:07 am
From: raulriera <rierar...@gmail.com>
Date: Sat, 4 Apr 2009 03:07:22 -0700 (PDT)
Local: Sat, Apr 4 2009 6:07 am
Subject: Re: Routing question
Reading the docs I found out the answer to my question up top
(including the userId to the linkTo is the way to do it) but now I
have a new problem, if I just want to do this

<cfset addRoute(name="home", pattern="", controller="wheels",
action="congratulations")>
<cfset addRoute(name="userProfile", pattern="users/[login]",
controller="users", action="show")>

How do I do this without having to hardcode EACH action of the Users
controller in the routes as well? corrently all actions but the
"index" action will call this "userProfile" route. The workaround is
to manually add each action of the controller to the routes.cfm but
this seems like a big pain.

Am I doing something wrong?

On Apr 5, 4:31 am, raulriera <rierar...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
rip747  
View profile  
 More options Apr 4, 8:48 am
From: rip747 <tpetru...@gmail.com>
Date: Sat, 4 Apr 2009 05:48:16 -0700 (PDT)
Local: Sat, Apr 4 2009 8:48 am
Subject: Re: Routing question
well once we get to 1.0, it might be time to give the routing engine
an overhaul and see what else we can add to it.

i think to solve your problem raul, we will need to add some sort of
restful code to the routing engine.

there might already be some code out there to do this, i'll have to
look around.

adding support for namespaces could be the answer to what chris is
doing.

an example would be:

<cfset addRoute(namespace="admin", pattern="", controller="settings",
action="index")>

now the routing engine would automatically prepend "admin" to the
controller like so "admin/settings". then all we need to do is figure
out a way to get the models, views, and helpers to map. if anyone
knows ruby, check so see how rails is doing this and maybe we could
port the code.

just a thought.

i also found another routing engine on github:

http://github.com/shaynesweeney/coldfusion-routes/tree/master

he added support for regex and udfs into the engine.

On Apr 4, 6:07 am, raulriera <rierar...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
raulriera  
View profile  
 More options Apr 4, 3:26 pm
From: raulriera <rierar...@gmail.com>
Date: Sat, 4 Apr 2009 12:26:08 -0700 (PDT)
Local: Sat, Apr 4 2009 3:26 pm
Subject: Re: Routing question
Although an overhaul will help, all of that can be done with the
current solution (with a little bit of time to copy and paste lines
like crazy into the routes.cfm). In the mean while I am going to add
all "manual" routes to the routes.cfm via the Scaffold.cfc

On Apr 5, 7:48 am, rip747 <tpetru...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ch...@clearcrystalmedia.com  
View profile  
 More options Apr 4, 4:59 pm
From: ch...@clearcrystalmedia.com
Date: Sat, 4 Apr 2009 13:59:40 -0700 (PDT)
Local: Sat, Apr 4 2009 4:59 pm
Subject: Re: Routing question
I tried creating an alias to the root wheels, config, models, and
plugin folders, but unfortunately ColdFusion reads the aliases as
files and not folders.

I ran these lines of code from my admin folder:
<cfdirectory action="list" directory="/path/to/admin"
name="directory">
<cfdump var="#directory#"><cfabort>

Unfortunately, the line for the aliased wheels folder looks like this:

        ATTRIBUTES      DATELASTMODIFIED        DIRECTORY       MODE    NAME    SIZE
TYPE
[empty string]          04/04/2009 04:52:15 PM          /path/to/admin          [empty
string]         wheels          0       File

I wonder if the same thing happens on Linux or Windows.

On Apr 4, 5:31 am, raulriera <rierar...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ch...@clearcrystalmedia.com  
View profile  
 More options Apr 4, 5:00 pm
From: ch...@clearcrystalmedia.com
Date: Sat, 4 Apr 2009 14:00:32 -0700 (PDT)
Local: Sat, Apr 4 2009 5:00 pm
Subject: Re: Routing question
Forgot to mention that the aliases are OS X aliases.

On Apr 4, 4:59 pm, ch...@clearcrystalmedia.com wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
raulriera  
View profile  
 More options Apr 4, 9:04 pm
From: raulriera <rierar...@gmail.com>
Date: Sat, 4 Apr 2009 18:04:04 -0700 (PDT)
Local: Sat, Apr 4 2009 9:04 pm
Subject: Re: Routing question
here is what I think are the possible scenarios for an "admin" area:

1 - Have 2 separate wheels applications with duplication all over the
place.
2 - Have 2 separate wheels applications where the "site" consumes the
"admin" controllers via cfhttp
3 - Have everything in one application where you render a different
view and layout depending if the URL contrains "/admin/[controller]/
[action]/etc" or not

I think you are going with the first one and trying to not duplicate
everything right?

On Apr 5, 4:00 pm, ch...@clearcrystalmedia.com wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Peters  
View profile  
 More options Apr 4, 10:32 pm
From: Chris Peters <ch...@clearcrystalmedia.com>
Date: Sat, 4 Apr 2009 22:32:49 -0400
Local: Sat, Apr 4 2009 10:32 pm
Subject: Re: [cfwheels] Re: Routing question

The "main" app is a CMS where the URL structure is 100% defined in the
database. That messes up the "regular" Wheels routes pretty bad, so I was
trying to get the admin stuff out of that system.

I was able to hard code controller/action stuff in routes.cfm to a certain
point (your option #3 below), but it stopped working in certain cases, and
it was going to get really bad after a certain point of complexity.

I may need to try #2 or settle for #1. #2 actually feels a little uglier to
me, but I'm sure that's a matter of opinion. :)


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
raulriera  
View profile  
 More options Apr 5, 2:25 am
From: raulriera <rierar...@gmail.com>
Date: Sat, 4 Apr 2009 23:25:24 -0700 (PDT)
Local: Sun, Apr 5 2009 2:25 am
Subject: Re: Routing question
I was hoping you will prove me wrong :( I don't like either of those
scenarios haha... I am going with "4" for now:

4 - Everything in one place, but the "admin" is "Users.cfc" and the
"site" is either "Pages.cfc" or another Controller that will make
sense, like "Articles.cfc" is the "admin" controller and "News.cfc" is
the "site" controller.

On Apr 5, 9:32 pm, Chris Peters <ch...@clearcrystalmedia.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Peters  
View profile  
 More options Apr 5, 9:24 am
From: Chris Peters <ch...@clearcrystalmedia.com>
Date: Sun, 5 Apr 2009 09:24:00 -0400
Subject: Re: [cfwheels] Re: Routing question

I kind of like that. I could have a Site.cfc that preps public-facing
functionality and an Admin.cfc that preps back office stuff (like forcing
the user to log in). Depending on what the controller is meant to do, it
could extend the appropriate CFC.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Peters  
View profile  
 More options Apr 5, 9:35 am
From: Chris Peters <ch...@clearcrystalmedia.com>
Date: Sun, 5 Apr 2009 09:35:47 -0400
Local: Sun, Apr 5 2009 9:35 am
Subject: Re: [cfwheels] Re: Routing question

Also, I think I may need to go back to the drawing board on the
database-driven CMS. Maybe custom routes aren't the best way to go about it?
I think I will poke around in the dark corners of the events folder, like
onmissingtemplate.cfm and onerror.cfm.

On Sun, Apr 5, 2009 at 9:24 AM, Chris Peters <ch...@clearcrystalmedia.com>wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
rip747  
View profile  
 More options Apr 5, 1:48 pm
From: rip747 <tpetru...@gmail.com>
Date: Sun, 5 Apr 2009 10:48:05 -0700 (PDT)
Local: Sun, Apr 5 2009 1:48 pm
Subject: Re: Routing question
chris,

if i'm following you correctly, you want to different wheels
application to be able to share some of the same components.

I think you approach with having the admin section and the cms
frontend in separate applications is a good idea. That sort of setup
will allow you to make the admin application use an SSL cert for
better seurity. I know this could probably be accomplished with a
filter checking against getpagecontext().getrequest().issecure().

As for reusing the components from the cms frontend in the admin
application, you could just create an application based mapping to the
cms frontend application and then just extend those component in your
admin application.

If any of this is off base then just tell me and shut up. :)

On Apr 5, 9:35 am, Chris Peters <ch...@clearcrystalmedia.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Peters  
View profile  
 More options Apr 5, 4:19 pm
From: Chris Peters <ch...@clearcrystalmedia.com>
Date: Sun, 5 Apr 2009 16:19:17 -0400
Local: Sun, Apr 5 2009 4:19 pm
Subject: Re: [cfwheels] Re: Routing question

No, that's useful Tony. Let me give it a shot. I may as well try everything
possible since I'm so early in the project.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ch...@clearcrystalmedia.com  
View profile  
 More options Apr 5, 5:18 pm
From: ch...@clearcrystalmedia.com
Date: Sun, 5 Apr 2009 14:18:37 -0700 (PDT)
Local: Sun, Apr 5 2009 5:18 pm
Subject: Re: Routing question
I promise that this isn't me telling you to shut up. But my CMS is
going to be one such that admin functions are incorporated into the
public interface. I love the idea in this chapter:
http://gettingreal.37signals.com/ch09_One_Interface.php

So the public-facing part of the site needs to be aware of the same
admin session too. A separate Wheels app wouldn't share the session
unless I authenticated the public-facing part against the admin app.
So many ways to solve the problem.

On Apr 5, 4:19 pm, Chris Peters <ch...@clearcrystalmedia.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
rip747  
View profile  
 More options Apr 6, 1:02 am
From: rip747 <tpetru...@gmail.com>
Date: Sun, 5 Apr 2009 22:02:00 -0700 (PDT)
Subject: Re: Routing question
you can get separate applications to share sessions and application
variables, it's just a little tricky.

you have to enable j2ee session in cfadministrator and also make sure
that the names of the application are the same. believe it or not, ibm
actually has an article about how to go about doing this:

http://www.ibm.com/developerworks/ibm/library/i-coldstudio/

also, if you want to share cookies amongst the applications, you can
accomplish this by using the domain attribute of the cfcookie tag.

http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tag...

On Apr 5, 5:18 pm, ch...@clearcrystalmedia.com wrote:

...

read more »


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Peters  
View profile  
 More options Apr 6, 6:15 am
From: Chris Peters <ch...@clearcrystalmedia.com>
Date: Mon, 6 Apr 2009 06:15:40 -0400
Local: Mon, Apr 6 2009 6:15 am
Subject: Re: [cfwheels] Re: Routing question

Cool. Will give that a shot then because my other approach isn't quite
working as planned. I was trying to use events/onmissingtemplate.cfm and
events/onerror.cfm to dispatch the URL to the CMS controller.

...

read more »


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Per Djurner  
View profile  
 More options Apr 14, 11:34 am
From: Per Djurner <per.djur...@gmail.com>
Date: Tue, 14 Apr 2009 17:34:31 +0200
Local: Tues, Apr 14 2009 11:34 am
Subject: Re: [cfwheels] Routing question

You need to give each route a unique name and it should work.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Per Djurner  
View profile  
 More options Apr 14, 11:36 am
From: Per Djurner <per.djur...@gmail.com>
Date: Tue, 14 Apr 2009 17:36:59 +0200
Local: Tues, Apr 14 2009 11:36 am
Subject: Re: [cfwheels] Re: Routing question

I have removed the code that was causing linkTo to fail with those URLs so
give it a try again :)Also, I think you can remove the action="index" part
from "adminSettings" as I think the controller/action should be either in
the pattern or specified as an argument, not both.

On Fri, Apr 3, 2009 at 11:06 PM, Chris Peters
<ch...@clearcrystalmedia.com>wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Peters  
View profile  
 More options Apr 14, 9:36 pm
From: Chris Peters <ch...@clearcrystalmedia.com>
Date: Tue, 14 Apr 2009 21:36:12 -0400
Local: Tues, Apr 14 2009 9:36 pm
Subject: Re: [cfwheels] Re: Routing question

Nice. Thanks. :)


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google