You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by "Goyal, Ritu (Ritu)" <ri...@avaya.com> on 2004/07/01 19:17:36 UTC

RE: Progress pages between screens

Hi David,

Thanks for the info. I read the thread, and tried to implement it. I
couldn't get it to work right.

My screen class is in the modules/screens directory. I can't click on a
link to redirect to the class, I do a redirect internally in my code to
go to this page. Also, I will be handling text data only, not binary
data.


Here is what I do in my screen class.


//***************************************************************
//* Package
//***************************************************************
package com.prototype.modules.screens.DHCP;


//***************************************************************
//* Imports
//***************************************************************

import java.io.*;
import java.util.Vector;
import org.apache.turbine.util.RunData;

//Logging
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

// Velocity
import org.apache.velocity.context.Context;
import org.apache.turbine.modules.screens.RawScreen;
import java.io.OutputStream;

public class DhcpProgress extends RawScreen
{
	private static Log log = LogFactory.getLog(DhcpProgress.class);
	
    protected String getContentType(RunData data)
    {
        return "text/plain";
    }

    protected void doOutput(RunData data) throws Exception
    {
        log.info("In doOutput");
    }

}

I still get class not found error. I tried getting to this class by
clicking on a link as well with the same result. Am I missing something
here? I don't have any .vm file associated with this screen class.

Thanks,
Ritu..


-----Original Message-----
From: David Demner [mailto:turbine@demner.com] 
Sent: Tuesday, June 29, 2004 4:42 PM
To: 'Turbine Users List'
Subject: RE: Progress pages between screens

Hi Ritu,

Yes you can do this without involving Velocity.  See the thread
http://www.mail-archive.com/turbine-user@jakarta.apache.org/msg14416.htm
l
for some pointers.  Basically, you create a screen class that doesn't
extend
VelocityScreen and put your code in there.  When you click a link to
your
.vm file, this class will get processed, and rewrite the response so the
.vm
doesn't get displayed.  That thread has pretty much all the information
you
will need.

Good luck,

David

-----Original Message-----
From: Goyal, Ritu (Ritu) [mailto:ritu@avaya.com] 
Sent: Tuesday June 29, 2004 3:32 PM
To: turbine-user@jakarta.apache.org
Subject: Progress pages between screens


Hello,

 

In the application we are designing, we need a way to write output to a
screen directly. We have what we call a progress page after every screen
where we expect a user to wait and see dynamic output messages showing a
system being configured. After all the messages are displayed, we
redirect the user to another screen.

 

We have done something similar outside of Turbine before. We did not
need to use a velocity template, and we created a dynamic page by
associating a PrintWriter to the HTTP response.

 

My question is:

Could I do the same thing in Turbine without using a velocity template
as a screen file?

 

Thanks,

Ritu..



---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: Progress pages between screens

Posted by David Demner <tu...@demner.com>.
Hi Ritu,

The screen class is in the modules/screens directory, but the package is
modules.screens.DHCP - when you compile the class it will be put in the
modules/screens/DHCP directory.  So I think your link to the class will need
to look like: $link.setPage("DHCP,DhcpProgress.vm").  Then it should find
the class, hopefully.

Maybe this is the problem?

Good luck,

David

-----Original Message-----
From: Goyal, Ritu (Ritu) [mailto:ritu@avaya.com] 
Sent: Thursday July 1, 2004 10:18 AM
To: Turbine Users List
Subject: RE: Progress pages between screens


Hi David,

Thanks for the info. I read the thread, and tried to implement it. I
couldn't get it to work right.

My screen class is in the modules/screens directory. I can't click on a
link to redirect to the class, I do a redirect internally in my code to
go to this page. Also, I will be handling text data only, not binary
data.


Here is what I do in my screen class.


//***************************************************************
//* Package
//***************************************************************
package com.prototype.modules.screens.DHCP;


//***************************************************************
//* Imports
//***************************************************************

import java.io.*;
import java.util.Vector;
import org.apache.turbine.util.RunData;

//Logging
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

// Velocity
import org.apache.velocity.context.Context;
import org.apache.turbine.modules.screens.RawScreen;
import java.io.OutputStream;

public class DhcpProgress extends RawScreen
{
	private static Log log = LogFactory.getLog(DhcpProgress.class);
	
    protected String getContentType(RunData data)
    {
        return "text/plain";
    }

    protected void doOutput(RunData data) throws Exception
    {
        log.info("In doOutput");
    }

}

I still get class not found error. I tried getting to this class by
clicking on a link as well with the same result. Am I missing something
here? I don't have any .vm file associated with this screen class.

Thanks,
Ritu..


-----Original Message-----
From: David Demner [mailto:turbine@demner.com] 
Sent: Tuesday, June 29, 2004 4:42 PM
To: 'Turbine Users List'
Subject: RE: Progress pages between screens

Hi Ritu,

Yes you can do this without involving Velocity.  See the thread
http://www.mail-archive.com/turbine-user@jakarta.apache.org/msg14416.htm
l
for some pointers.  Basically, you create a screen class that doesn't
extend
VelocityScreen and put your code in there.  When you click a link to
your
.vm file, this class will get processed, and rewrite the response so the
.vm
doesn't get displayed.  That thread has pretty much all the information
you
will need.

Good luck,

David

-----Original Message-----
From: Goyal, Ritu (Ritu) [mailto:ritu@avaya.com] 
Sent: Tuesday June 29, 2004 3:32 PM
To: turbine-user@jakarta.apache.org
Subject: Progress pages between screens


Hello,

 

In the application we are designing, we need a way to write output to a
screen directly. We have what we call a progress page after every screen
where we expect a user to wait and see dynamic output messages showing a
system being configured. After all the messages are displayed, we
redirect the user to another screen.

 

We have done something similar outside of Turbine before. We did not
need to use a velocity template, and we created a dynamic page by
associating a PrintWriter to the HTTP response.

 

My question is:

Could I do the same thing in Turbine without using a velocity template
as a screen file?

 

Thanks,

Ritu..



---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org