I would like to create a mason Local component (/opt/rt3/local/html/MyComp)
that will decide to either handle the request or pass it off to
the original component (/opt/rt3/share/html/MyComp) to handle.
What’s the easiest way to do this? I want to call the actual original
component and not duplicate it’s functionality.
Can I just call the original component with an absolute path
and my args? I guess I need some way to re-call the component
but bypass the local system.
Ideas?
Thanks.
-Todd
At Wednesday 5/18/2005 12:00 PM, Todd Chapman wrote:
I would like to create a mason Local component (/opt/rt3/local/html/MyComp)
that will decide to either handle the request or pass it off to
the original component (/opt/rt3/share/html/MyComp) to handle.
What’s the easiest way to do this? I want to call the actual original
component and not duplicate it’s functionality.
Can I just call the original component with an absolute path
and my args? I guess I need some way to re-call the component
but bypass the local system.
Ideas?
I wonder if you could do something funky with a sym link? Create
local/html/MyCompLink that points to share/html/MyComp and have your local
MyComp call local MyCompLink when it needs to call the original component.
I suspect this won’t work . If you find a solution I’d be interested to
hear about it.
Thanks,
Steve
At Wednesday 5/18/2005 12:00 PM, Todd Chapman wrote:
I would like to create a mason Local component (/opt/rt3/local/html/MyComp)
that will decide to either handle the request or pass it off to
the original component (/opt/rt3/share/html/MyComp) to handle.
What’s the easiest way to do this? I want to call the actual original
component and not duplicate it’s functionality.
Can I just call the original component with an absolute path
and my args? I guess I need some way to re-call the component
but bypass the local system.
Ideas?
I wonder if you could do something funky with a sym link? Create
local/html/MyCompLink that points to share/html/MyComp and have your local
MyComp call local MyCompLink when it needs to call the original component.
I suspect this won’t work . If you find a solution I’d be interested to
hear about it.
Thanks,
Steve
Figured it out!
-
read: Mason+Poet: Home
-
perl -MCPAN -e ‘install MasonX::Request::ExtendedCompRoot’
-
In RT_SiteConfig.pm:
@MasonParameters = (request_class => ‘MasonX::Request::ExtendedCompRoot’, resolver_class => ‘MasonX::Resolver::ExtendedCompRoot’) unless (@MasonParameters);
-
mkdir /opt/rt3/local/html/Ticket
-
vi /opt/rt3/local/html/Ticket/Create.html with content:
% if ($ARGS{Queue} == 1) {
<& standard=>/Ticket/Create.html, %ARGS &>
% $m->abort;
% }
bite me!
-
mkdir /opt/rt3/local/html/Elements
-
vi /opt/rt3/local/html/Elements/SelectOwner with content:
Pick me! Pick me!
Try to create a ticket in queue with id 1.
Notice how SelectOwner is from local but Create.html is from share?
Try to create a ticket in queue with id > 1. Not happening!
See the MasonX::Request::ExtendedCompRoot for more fun.
-Todd
Todd, please post it on the wiki. Nice solution.
Regards, Ruslan.
Todd Chapman wrote:>On Wed, May 18, 2005 at 04:04:43PM -0400, Stephen Turner wrote:
At Wednesday 5/18/2005 12:00 PM, Todd Chapman wrote:
I would like to create a mason Local component (/opt/rt3/local/html/MyComp)
that will decide to either handle the request or pass it off to
the original component (/opt/rt3/share/html/MyComp) to handle.
What’s the easiest way to do this? I want to call the actual original
component and not duplicate it’s functionality.
Can I just call the original component with an absolute path
and my args? I guess I need some way to re-call the component
but bypass the local system.
Ideas?
I wonder if you could do something funky with a sym link? Create
local/html/MyCompLink that points to share/html/MyComp and have your local
MyComp call local MyCompLink when it needs to call the original component.
I suspect this won’t work . If you find a solution I’d be interested to
hear about it.
Thanks,
Steve
Figured it out!
-
read: Mason+Poet: Home
-
perl -MCPAN -e ‘install MasonX::Request::ExtendedCompRoot’
-
In RT_SiteConfig.pm:
@MasonParameters = (request_class => ‘MasonX::Request::ExtendedCompRoot’, resolver_class => ‘MasonX::Resolver::ExtendedCompRoot’) unless (@MasonParameters);
-
mkdir /opt/rt3/local/html/Ticket
-
vi /opt/rt3/local/html/Ticket/Create.html with content:
% if ($ARGS{Queue} == 1) {
<& standard=>/Ticket/Create.html, %ARGS &>
% $m->abort;
% }
bite me!
-
mkdir /opt/rt3/local/html/Elements
-
vi /opt/rt3/local/html/Elements/SelectOwner with content:
Pick me! Pick me!
Try to create a ticket in queue with id 1.
Notice how SelectOwner is from local but Create.html is from share?
Try to create a ticket in queue with id > 1. Not happening!
See the MasonX::Request::ExtendedCompRoot for more fun.
-Todd
The rt-users Archives
Be sure to check out the RT Wiki at http://wiki.bestpractical.com