jim moore | 4 Feb 12:33 2004

New patches in cvs

Hi all,

I just applied 3 patches from Aaron Clauson to cvs, so if any daring
individuals want to get latest from cvs and beat on it a little, it would be
appreciated:

The changed files are:

Ctl\Aspx\AspxController.cs
Transform\XsltTransform.cs
View\DispatchedViewFactory.cs

Change comments are in cvs.

I also updated the sln and csproj files to visual studio 2003 while I was in
there.

--jim

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
Cort Schaefer | 6 Feb 06:58 2004

RE: New patches in cvs

I have a new client that I am just about to start development on, so I will
check it out (within the next week).  

What would you think about updating to the 1.2 beta 8 build of log4net?  I
could do the updates and submit patches (or commit) if you want.  If that is
done, I can also update Opt-NVelocity to the latest version as well.

Cort

-----Original Message-----
From: jim moore [mailto:jim <at> scolamoore.com] 
Sent: Wednesday, February 04, 2004 4:33 AM
To: mavnet-user <at> lists.sourceforge.net
Subject: [Mavnet-user] New patches in cvs

Hi all, 

I just applied 3 patches from Aaron Clauson to cvs, so if any daring 
individuals want to get latest from cvs and beat on it a little, it would be

appreciated: 

The changed files are: 

Ctl\Aspx\AspxController.cs 
Transform\XsltTransform.cs 
View\DispatchedViewFactory.cs 

Change comments are in cvs. 

(Continue reading)

jim moore | 6 Feb 10:27 2004

RE: New patches in cvs

Yes by all means, update both log4net and opt-nvelocity (you can go ahead
and commit).

Thanks cort.

--jim 

> -----Original Message-----
> From: mavnet-user-admin <at> lists.sourceforge.net 
> [mailto:mavnet-user-admin <at> lists.sourceforge.net] On Behalf Of 
> Cort Schaefer
> Sent: Friday, February 06, 2004 5:59 AM
> To: mavnet-user <at> lists.sourceforge.net
> Subject: RE: [Mavnet-user] New patches in cvs
> 
> I have a new client that I am just about to start development 
> on, so I will check it out (within the next week).  
> 
> What would you think about updating to the 1.2 beta 8 build 
> of log4net?  I could do the updates and submit patches (or 
> commit) if you want.  If that is done, I can also update 
> Opt-NVelocity to the latest version as well.
> 
> Cort
> 
> -----Original Message-----
> From: jim moore [mailto:jim <at> scolamoore.com]
> Sent: Wednesday, February 04, 2004 4:33 AM
> To: mavnet-user <at> lists.sourceforge.net
> Subject: [Mavnet-user] New patches in cvs
(Continue reading)

Ihor Bobak | 11 Feb 14:15 2004

Docs needed

Dear all,

I am searching for a normal documentation for Maverick.NET.
Does there exist any?

Please, do not propose to see the manual on
http://mavnet.sourceforge.net/, since it is absolutely
useless for beginners.

Thanks in advance.

Best regards,
 Ihor.

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
Braswell Paul | 13 Feb 17:48 2004

Problems in Inheriting Page from Maverick.Ctl.Aspx.ControllablePa ge

I'm facing a similar problem as listed below.  For a simple test case I changed maverick.config in the Calendar application to the following and returned "error" from Default.aspx:
 
<?xml version="1.0"?>
 
<maverick version="2.0" default-view-type="document" default-transform-type="document">
 <commands>
  <command name="Default.aspx">
   <view name="success" type="trivial">
    <transform path="~/Wrapper.aspx"/>
   </view>
   <view name="april" path="~/April.aspx">
    <transform path="~/Wrapper.aspx"/>
   </view>
   <view name="button" path="~/Button.aspx">
    <transform path="~/Wrapper.aspx"/>
   </view>
   <view name="error" path="~/Foo/Default.aspx">
    <transform path="~/Wrapper.aspx"/>
   </view>   
  </command>
 
  <command name="Foo/Default.aspx">
   <view name="success" type="trivial">
    <transform path="~/Wrapper.aspx"/>
   </view>
   <view name="april" path="~/Foo/December.aspx">
    <transform path="~/Wrapper.aspx"/>
   </view>
   <view name="button" path="~/Button.aspx">
    <transform path="~/Wrapper.aspx"/>
   </view>
  </command>  
 </commands>
</maverick>
 
I get the same error as Rocky: OutputStream is not available when a custom TextWriter is used.
 
Is this a bug or am I missing something?  If this is not a bug, how do I redirect to another controller?
 
Thanks in advance.
 
Paul
 
 
 
>  -----Original Message-----
> From: Rocky Luthria 
> Sent: Wednesday, July 09, 2003 2:54 PM
> To: 'mavnet-user <at> li...'
> Subject: Problems in Inheriting Page from Maverick.Ctl.Aspx.ControllablePage
>
> I am facing a problem when I have page inherited from Maverick.Ctl.Aspx.ControllablePage
and on the overriden Go Method I am passing a view Name as another Page and that page
inherits from the Maverick.Ctl.Aspx.ControllablePage then throws an exception
> OutputStream is not available when a custom TextWriter is used.
>
> For Example
>
> 1. First Aspx Page
>
> public class HomePage :Maverick.Ctl.Aspx.ControllablePage
> {
> public string viewName="success";
> public override string Go(Maverick.Flow.IControllerContext cctx)
> {
> //Context.Items.Add("title","calendar");
> return viewName;
> }
> private void Page_Load(object sender, System.EventArgs e)
> {
> viewName="UserDetails";
> }
> }
>
> 2. Second Aspx Page
>
> public class UserDetails : Maverick.Ctl.Aspx.ControllablePage
> {
> public string viewName="success";
> public override string Go(Maverick.Flow.IControllerContext cctx)
> {
> //Context.Items.Add("title","calendar");
> return viewName;
> }
> }
> 3 Maverick.config
> <?xml version="1.0"?>
> <maverick version="2.0">
> <commands>
> <command name="HomePage.aspx">
> <view name="success" type="trivial" />
> <view name="UserDetails" path="UserDetails.aspx" />
> <view name="Error" path="Error.aspx" />
> </command>
> <command name="UserDetails.aspx">
> <view name="success" type="trivial" />
> </command>
> </commands>
> </maverick>
>
> what could be the problem and the effective solution to this problem.
> Thanks


From
Braswell Paul | 17 Feb 23:30 2004

Error when adding a parameter that is null to ControllerContext

Not sure if this is a bug or not.  Here is my line of code:

    ControllerContext.SetParam("facilityId", this.FacilityId);

When this.FacilityId is null, you get the following error:

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 111: url.Append(HttpUtility.UrlEncode(key)); Line 112: url.Append("="); Line 113: url.Append(HttpUtility.UrlEncode(val.ToString())); Line 114: } Line 115: }


Source File: E:\Applications\Maverick\src\Maverick\View\RedirectView.cs    Line: 113

To get around this you can either check for null before you add a param to ControllerContext or

you can modify the AddQueryParam(StringBuilder url, string key, object val) method in RedirectView.cs to check for null before it calls val.ToString().

Aaron Clauson | 20 Feb 11:38 2004
Picon

Re: Mavnet-user digest, Vol 1 #118 - 7 msgs

>Message: 4
>Date: Wed, 11 Feb 2004 15:15:49 +0200
>From: Ihor Bobak <ibobak <at> ukeess.com>
>Organization: UKEESS Software House
>To: mavnet-user <at> lists.sourceforge.net
>Subject: [Mavnet-user] Docs needed
>Reply-To: mavnet-user <at> lists.sourceforge.net
>
>Dear all,
>
>I am searching for a normal documentation for
>Maverick.NET.
>Does there exist any?
>
>Please, do not propose to see the manual on
>http://mavnet.sourceforge.net/, since it is
absolutely
>useless for beginners.
>
>Thanks in advance.
>
>Best regards,
> Ihor.

While I don't have any documentation to add I have put
some examples/samples for using Maverick.Net at: 

http://azaclauson.com/Maverick/MaverickWebApps/samples.aspx

Although you should be aware that these are not
particularly verbose and were designed more as a quick
code 

reference then a user guide. 

Aaron

>Message: 5
>From: Braswell Paul <Paul.Braswell <at> eHC.com>
>To: "'mavnet-user <at> lists.sourceforge.net'"
>	 <mavnet-user <at> lists.sourceforge.net>
>Date: Fri, 13 Feb 2004 10:48:55 -0600
>Subject: [Mavnet-user] Problems in Inheriting Page
from 
>Maverick.Ctl.Aspx.ControllablePa
> ge
>Reply-To: mavnet-user <at> lists.sourceforge.net
>
>
>I'm facing a similar problem as listed below.  For a
simple test case I
>changed maverick.config in the Calendar application
to the following 
>and
>returned "error" from Default.aspx:
> 
><?xml version="1.0"?>
> 
><maverick version="2.0" default-view-type="document"
>default-transform-type="document">
> <commands>
>  <command name="Default.aspx">
>   <view name="success" type="trivial">
>    <transform path="~/Wrapper.aspx"/>
>   </view>
>   <view name="april" path="~/April.aspx">
>    <transform path="~/Wrapper.aspx"/>
>   </view>
>   <view name="button" path="~/Button.aspx">
>    <transform path="~/Wrapper.aspx"/>
>   </view>
>   <view name="error" path="~/Foo/Default.aspx">
>    <transform path="~/Wrapper.aspx"/>
>   </view>   
>  </command>
> 
>  <command name="Foo/Default.aspx">
>   <view name="success" type="trivial">
>    <transform path="~/Wrapper.aspx"/>
>   </view>
>   <view name="april" path="~/Foo/December.aspx">
>    <transform path="~/Wrapper.aspx"/>
>   </view>
>   <view name="button" path="~/Button.aspx">
>    <transform path="~/Wrapper.aspx"/>
>   </view>
>  </command>  
> </commands>
></maverick>
>
>
>I get the same error as Rocky: OutputStream is not
available when a 
>custom
>TextWriter is used.
> 
>Is this a bug or am I missing something?  If this is
not a bug, how do 
>I
>redirect to another controller?
> 
>Thanks in advance.
>
>Paul

The quick answer is to use the redirect view, e.g.,
 <view name="error" type="redirect"
path="~/Foo/Default.aspx" >

The long answer is:

In the view processing stage for a document view
(DispatchedViewFactory.cs) the following code is used,

vctx.HttpContext.Server.Execute(path, output);

This line while seeming fairly straight forward,
simply calling another web page and placing the
results into the 

output stream, seems to be causing a few problems. One
problem I have already encountered is that xml files
are 

returned as invalid xml due to some extra characters
at the start of the stream (this could have been the
content 

encoding but I didn't track it down further,
preferring to load the file directly).

In your case the problem appears to be more
complicated. Before I go into it I should just say
that the 

integration between ASP.Net and Maverick.Net is a bit
confusing and while the solution in the Maverick.Net 

framework is a good one that generally works it is
probably not the best way to do things. ASP.Net and 

Maverick.Net are two different approaches to web
application work flow, ASP.Net being a page controller
and 

Maverick being a front controller, any integration
between the two is therefore going to be slightly
"messy". See 

http://azaclauson.com/Maverick/models/theMavAspQuandary.htm
for a fuller discussion.

Anyway back to the problem of redirecting to another
Maverick controller. From debugging through the code
it looks 

as if the problem is deriving from the way ASP.Net
processes the Server.Execute commands. The first time
Maverick 

sees the command after ASP.Net has finished with it is
in the ControllablePage class and the Render method -
this 

is normally where ASP.Net writes to the Http Output
stream but in this case has been redirected to a
string buffer 

- as shown below.

 protected sealed override void Render(HtmlTextWriter
writer) 
 {
   AspxController controller = new AspxController();
   controller.Render(this, Context);	
 }

Once again this seems fairly innocous. For Maverick
ASP.Net commands it works fine; however when a
Server.Redirect 

 occcurs in a Maverick view the Context - being the
HttpConext object for the whole Http request/response
page 

processing - appears to be from the page calling
Server.Execute and NOT from the page being called. So
the flow is going like this,

Simplified config,

 <commands>
  <command name="Default.aspx">
   <view name="error" path="~/Foo/Default.aspx">
    <transform path="~/Wrapper.aspx"/>
   </view>   
  </command>

  <command name="Foo/Default.aspx">
   <view name="success" type="trivial">
    <transform path="~/Wrapper.aspx"/>
   </view>
  </command>
 </commands>

1. Request for Default.aspx received by ASP.Net
PageHandlerFactory,
2. ASP.Net finishes processing Default.aspx and
invokes the Maverick.Net AspxController object,
3. The AspxController extracts the command name from
the HttpContext and processes the view stage for that
command,
4. View stage calls Server.Execute for
Foo/Default.aspx,
5. Request for Foo/Default.aspx received by ASP.Net
PageHandlerFactory,

Everything is fine to here (although I did get an
error about inserting duplicate models into the
Context.Items that I ahd to get around, don't know why
you didn't get this as well) but now when the
AspxController is invoked the HttpContext for the
original page, Default.aspx, and NOT the current page,
Foo/Default.aspx, is passed across.

6. ASP.Net finishes processing Foo/Default.aspx and
invokes the Maverick.Net AspxController object,

Exception is thrown when the original page,
Default.aspx, attempts to write to the
HttpResponse.OutputStream, I suspect this is because
the second page changed the stream and the original
page has an invalid stream although I am not sure. The
point is though that even if the original page could
write to the output stream it would be incorrect since
Maverick thinks it's processing the first command when
it's actually doing the second one.

I imagine that's all very confusing. Perhaps an easier
way to see this working is to look at the log file.
What you will see is,

Maverick.Ctl.Aspx.AspxController [] - Servicing
command:  Default.aspx
Maverick.Ctl.Aspx.AspxController [] - Servicing
command:  Default.aspx

What you should see is,

Maverick.Ctl.Aspx.AspxController [] - Servicing
command:  Default.aspx
Maverick.Ctl.Aspx.AspxController [] - Servicing
command:  Foo/Default.aspx

Hope that helps more than hinders.

Aaron

__________________________________
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
jim moore | 29 Feb 11:01 2004

RE: redirect (chaining) in maverick.net

The reason the information is lost is because a redirect happens client side
(a redirect tells sends a response to the browser telling it to request the
new page). This is standard http behavior--not a maverick feature (i.e.
redirects work the same in jsp, asp, php, etc as they do in maverick).

The nice thing about redirects is that they update the url in the user's
browser. The bad thing is all parameters from the initial request are lost.
You can use a forward (basically a server side redirect) if you want to keep
the parameters, but be aware, the url will not change for the user.

To do a forward in maverick.net, simply use a document view pointing to the
new command.

		<command name="a">
			<view name="success" path="b.m"/>
			<view name="error" path="error.aspx"/>
		</command>

		<command name="b">
			<view path="welcome.aspx"/>
		</command>

In the future, please send any questions to the mavnet-user list (I'm
forwarding your message and response there).

--jim

> -----Original Message-----
> From: Dawson [mailto:daws <at> users.sourceforge.net] 
> Sent: Saturday, February 28, 2004 10:52 PM
> To: nmrs <at> users.sourceforge.net
> Cc: daws <at> users.sourceforge.net
> Subject: redirect (chaining) in maverick.net
> 
> 
> Hello:
> 
> I am trying to redirect from one action to another in 
> 
> Maverick.NET.  The redirect works, but on the redirected 
> 
> page I need to get information that was submitted to the first 
> 
> page.  I thought there was a way to do this using the 
> 
> maverick context and chaining, but the context doesn't seem 
> 
> to have the original information after it redirects.  Can you 
> 
> explain this?
> 
> Thanks a lot,
> 
> Daws

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
Dawson Mossman | 1 Mar 02:02 2004

Forward Commands in Maverick.NET

Hello:

I wanted to thank Jim for the quick response on my last post about Maverick Command Forwarding.  I tried the suggestion you made about simply have a view path point to another command, and it was very close to working, but when the HttpRequest.Server.Execute(“path”, “outputstream”) gets called I get an error stating with the following stack trace:  Any idea what would be causing this?  I can go to the “role_create.m” action directly without any problems, it’s just when I try to transfer to it from another command.

Thanks, Dawson

 

 “Error executing child request for /controller/role_create.m.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Error executing child request for /controller/role_create.m.

Source Error:

 

Line 83:                                            path = vctx.HttpContext.Request.ApplicationPath + "/" + this.path;

Line 84:

Line 85:                                    vctx.HttpContext.Server.Execute(path, output);

Line 86:                                    output.Flush();

Line 87:                                    next.Go();


Source File: c:\CMSDEV\CMS\Version_1\3_Construction\Iteration_2\ThirdParty\Maverick\View\DispatchedViewFactory.cs    Line: 85

Stack Trace:

 

[HttpException (0x80004005): Error executing child request for /controller/role_create.m.]

   System.Web.HttpServerUtility.ExecuteInternal(String path, TextWriter writer, Boolean preserveForm) +1756

   System.Web.HttpServerUtility.Execute(String path, TextWriter writer) +11

   Maverick.View.DispatchedView.Go(IViewContext vctx) in c:\CMSDEV\CMS\Version_1\3_Construction\Iteration_2\ThirdParty\Maverick\View\DispatchedViewFactory.cs:85

   Maverick.View.DocumentView.Go(IViewContext vctx) in c:\CMSDEV\CMS\Version_1\3_Construction\Iteration_2\ThirdParty\Maverick\View\DocumentView.cs:37

   Maverick.Flow.CommandBase.RunView(String viewName, MaverickContext mctx) in c:\CMSDEV\CMS\Version_1\3_Construction\Iteration_2\ThirdParty\Maverick\Flow\CommandBase.cs:49

   Maverick.Flow.CommandBase.Go(MaverickContext mctx) in c:\CMSDEV\CMS\Version_1\3_Construction\Iteration_2\ThirdParty\Maverick\Flow\CommandBase.cs:27

   Maverick.Dispatcher.ProcessRequest(HttpContext context) in c:\CMSDEV\CMS\Version_1\3_Construction\Iteration_2\ThirdParty\Maverick\Dispatcher.cs:220

   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +179

   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +87

 

 

 

This communication, including any and all attachments, is confidential and intended only for the use of the person or entity to which it is addressed and may contain privileged and/or confidential material.  It is intended only for the recipient[s] to whom it is addressed. Any use, disclosure, review, retransmission, distribution, or printing, does not constitute a waiver of privilege on behalf of the intended recipient and is strictly prohibited.  If you have received this email in error, please contact the sender as above and delete the original and any copy of this email or any printout thereof, immediately.  Your cooperation is appreciated. 

Braswell Paul | 1 Mar 16:28 2004

Re: Forward Commands in Maverick.Net

I get the same error.  To get around the problem, I use redirect and add any values to ControllerContext. i.e:

ControllerContext.SetParam("errorMessage", errorMessage);

Not sure if it's the right way to do it, but it did allow me to move on.  Anyone have a better solution?

 

 

From: Dawson Mossman <dawson <at> en...>
Forward Commands in Maverick.NET  
2004-02-29 17:14
Hello: I wanted to thank Jim for the quick response on my last post about Maverick Command Forwarding. I tried the suggestion you made about simply have a view path point to another command, and it was very close to working, but when the HttpRequest.Server.Execute("path", "outputstream") gets called I get an error stating with the following stack trace: Any idea what would be causing this? I can go to the "role_create.m" action directly without any problems, it's just when I try to transfer to it from another command. Thanks, Dawson "Error executing child request for /controller/role_create.m. " Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Web.HttpException: Error executing child request for /controller/role_create.m. Source Error: Line 83: path = vctx.HttpContext.Request.ApplicationPath + "/" + this.path; Line 84: Line 85: vctx.HttpContext.Server.Execute(path, output); Line 86: output.Flush(); Line 87: next.Go(); Source File: c:\CMSDEV\CMS\Version_1\3_Construction\Iteration_2\ThirdParty\Maverick\V iew\DispatchedViewFactory.cs Line: 85 Stack Trace: [HttpException (0x80004005): Error executing child request for /controller/role_create.m.] System.Web.HttpServerUtility.ExecuteInternal(String path, TextWriter writer, Boolean preserveForm) +1756 System.Web.HttpServerUtility.Execute(String path, TextWriter writer) +11 Maverick.View.DispatchedView.Go(IViewContext vctx) in c:\CMSDEV\CMS\Version_1\3_Construction\Iteration_2\ThirdParty\Maverick\V iew\DispatchedViewFactory.cs:85 Maverick.View.DocumentView.Go(IViewContext vctx) in c:\CMSDEV\CMS\Version_1\3_Construction\Iteration_2\ThirdParty\Maverick\V iew\DocumentView.cs:37 Maverick.Flow.CommandBase.RunView(String viewName, MaverickContext mctx) in c:\CMSDEV\CMS\Version_1\3_Construction\Iteration_2\ThirdParty\Maverick\F low\CommandBase.cs:49 Maverick.Flow.CommandBase.Go(MaverickContext mctx) in c:\CMSDEV\CMS\Version_1\3_Construction\Iteration_2\ThirdParty\Maverick\F low\CommandBase.cs:27 Maverick.Dispatcher.ProcessRequest(HttpContext context) in c:\CMSDEV\CMS\Version_1\3_Construction\Iteration_2\ThirdParty\Maverick\D ispatcher.cs:220 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutio nStep.Execute() +179 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +87


Gmane