Send messages to that groovy status window

Any template questions or comments or suggestions

Send messages to that groovy status window

Postby TampaDeveloper on Thu Dec 15, 2005 4:01 pm

Hi,

I've got my template working fairly well... But now I want to put a little feedback in the output window. How do I do it?
TampaDeveloper
Lurker
 
Posts: 2
Joined: Thu Dec 15, 2005 3:59 pm

Postby mike.griffin on Thu Dec 15, 2005 4:58 pm

I'm confused, are you talking about the output table on your template?

If so you should write everything to the output tab then save it with something like this?

Code: Select all
private void SaveFile(string suffix)
{
   // Save the output file for this Table/View
   string filename = input[\"txtPath\"].ToString();
   if (!filename.EndsWith(\"\\\\\") )
      filename += \"\\\\\";
   filename += \"es\" + SourceName + suffix;      
   
   output.save(filename, false);
   outputBuffer += output.text;
   output.clear();   
}


Maybe I misunderstood you?
User avatar
mike.griffin
Site Admin
 
Posts: 3290
Joined: Sat Apr 03, 2004 6:10 am
Location: Indianapolis, IN

Postby mike.griffin on Thu Dec 15, 2005 4:59 pm

User avatar
mike.griffin
Site Admin
 
Posts: 3290
Joined: Sat Apr 03, 2004 6:10 am
Location: Indianapolis, IN

Postby dnparsons on Thu Dec 15, 2005 7:49 pm

I don't know if this relates to what TampaDeveloper is asking, but now my curiousity is piqued. If you run a template from the template browser, a dialog box pops up announcing its completion. Is there any way for a developer to pop up his own dialog box after the run icon is clicked? Perhaps containing a progress bar for long running templates.
David Neal Parsons
EntitySpaces
User avatar
dnparsons
Lieutenant General
 
Posts: 292
Joined: Sun Jan 09, 2005 2:10 pm
Location: Miami, Florida

Postby mike.griffin on Thu Dec 15, 2005 9:16 pm

You should be able to do this, this is from a C# template.

Code: Select all
context.Log.Write(\"Groovy Log\");

However, it doesn't seem to print out anything, Justin will take a look at this.
User avatar
mike.griffin
Site Admin
 
Posts: 3290
Joined: Sat Apr 03, 2004 6:10 am
Location: Indianapolis, IN

Re:

Postby mgnoonan on Thu Dec 15, 2005 9:29 pm

dnparsons wrote:I don't know if this relates to what TampaDeveloper is asking, but now my curiousity is piqued. If you run a template from the template browser, a dialog box pops up announcing its completion. Is there any way for a developer to pop up his own dialog box after the run icon is clicked? Perhaps containing a progress bar for long running templates.

Hmm. I know you can do it for the UI portion of the template (see the ASP.NET inlide grid templates for dOOdads and EasyObjects for an example).

I don't see why you wouldn't be able to for the template code portion. It would probably have to be a C# or VB.NET based template (not VBScript, which has no concept of a form).

But Mike or Justin would probably have a more definitive answer.
Matt Noonan
EasyObjects.NET - The O/RM for the Enterprise Library
http://www.easyobjects.net
User avatar
mgnoonan
Expert
 
Posts: 1019
Joined: Tue Sep 14, 2004 3:17 am
Location: Springboro, OH

Re: Send messages to that groovy status window

Postby dnparsons on Thu Dec 15, 2005 11:11 pm

TampaDeveloper wrote:But now I want to put a little feedback in the output window.

mike.griffin wrote:context.Log.Write("Groovy Log");

Ahhh... :idea: the console-like pane you can display at the bottom of an open template. I forgot about that. Sorry, TampaDeveloper... didn't mean to hi-jack your post. :oops:

mike.griffin wrote:However, it doesn't seem to print out anything

Yes, I can confirm that.

mgnoonan wrote:see the ASP.NET inlide grid templates for dOOdads and EasyObjects for an example

Thanks, Matt. I'll take a closer look at that.
David Neal Parsons
EntitySpaces
User avatar
dnparsons
Lieutenant General
 
Posts: 292
Joined: Sun Jan 09, 2005 2:10 pm
Location: Miami, Florida

Postby TampaDeveloper on Fri Dec 16, 2005 3:37 pm

Ok... Just so we're talking about the same console window...

I mean THIS ONE:

Image


Thanks all for the good suggestions. I will probably just log the output information into a file and pop up a MessageBox. But it seems silly to have this status window and yet not be able to use it. The reason I want it is because I rewrote one of the NHibernate templates to create an abstract class and an implementation class... The implementation class is designed to hold custom code. The generator checks for the existance of the implementation first before writing it... If its there, it will not overwrite it. This way, I can keep my objects up to date with the database, and yet have custom code for certain things that can be done easier/faster outside of NHibernate.
TampaDeveloper
Lurker
 
Posts: 2
Joined: Thu Dec 15, 2005 3:59 pm

Postby mike.griffin on Wed Dec 21, 2005 4:32 am

Justin just fixed this in our 1.1.5 beta

Download it and test it
http://www.mygenerationsoftware.com/php ... php?t=1679

Code: Select all
context.Log.Write(\"Thankyou Justin\")


A day or so from releasing now ...
User avatar
mike.griffin
Site Admin
 
Posts: 3290
Joined: Sat Apr 03, 2004 6:10 am
Location: Indianapolis, IN


Return to General Template Questions/Comments

Who is online

Users browsing this forum: No registered users and 2 guests

cron