You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Sisk, Brad" <BS...@ancorinfo.com> on 2008/09/11 18:55:30 UTC

Simple One: Deploying an Ftplet

I am brand new to Apache's Ftplet API, never needed to use it before. I
understand how to use it to write Ftplets-but have been unable to find
any documentation on the web anywhere for how you actually add an Ftplet
to an application server and get it to work.  The FTPServer application,
itself, must also be deployed for Ftplets to work...so how do I add them
both to a project, and configure the deployment descriptors accordingly.

 

I am using SJAS (Glassfish) as the AppServer, with Java6.  Evidently,
Ftplets only build within a Spring framework, so the Spring jarfiles are
already included in the hosting webapp.

 

In which directory of the webapp or enterprise app must FTPServer be
put?  And in which directory must the Ftplets be put. How does the
FTPServer find the Ftplets (i.e. how are they registered)?

 

What additional config steps must I take, such as in XML files, config
files, properties files, to get the whole thing to work?  

 

Because FtpServer is relatively new, from Apache, and FTPServers are not
commonly needed for web or enterprise applications, there is hardly any
documentation, or even a step-by-step list of where to put all of these
classes and how to configure them to work.


Re: Simple One: Deploying an Ftplet

Posted by Niklas Gustavsson <ni...@protocol7.com>.
On Thu, Sep 11, 2008 at 10:01 PM, Sisk, Brad <BS...@ancorinfo.com> wrote:
> Thank you very much, Niklas, I appreciate it.
>
> I can post this solution unless you plan to do so.

Please do!

/niklas

RE: Simple One: Deploying an Ftplet

Posted by "Sisk, Brad" <BS...@ancorinfo.com>.
Thank you very much, Niklas, I appreciate it. 

I can post this solution unless you plan to do so.

-----Original Message-----
From: Niklas Gustavsson [mailto:niklas@protocol7.com] 
Sent: Thursday, September 11, 2008 3:59 PM
To: dev@mina.apache.org
Subject: Re: Simple One: Deploying an Ftplet

Hey

Let's see if I can give you some pointers.

On Thu, Sep 11, 2008 at 6:55 PM, Sisk, Brad <BS...@ancorinfo.com> wrote:
> I am brand new to Apache's Ftplet API, never needed to use it before.
I
> understand how to use it to write Ftplets-but have been unable to find
> any documentation on the web anywhere for how you actually add an
Ftplet
> to an application server and get it to work.  The FTPServer
application,
> itself, must also be deployed for Ftplets to work...so how do I add
them
> both to a project, and configure the deployment descriptors
accordingly.
>
> I am using SJAS (Glassfish) as the AppServer, with Java6.  Evidently,
> Ftplets only build within a Spring framework, so the Spring jarfiles
are
> already included in the hosting webapp.

So, if I understand you want to run FtpServer embedded within your
application, in turn running in SJAS? If so, you don't need Spring at
all, that's only used for our XML config format. In the case where
you're embedding FtpServer, you need the minimal set of JARs
(ftplet-api, ftpserver core, MINA, SLF4J) and your Ftplet. Then you do
something like:

        FtpServer server = new FtpServer();

        FtpletContainer container =
server.getServerContext().getFtpletContainer();
        container.addFtplet("myFtplet", new MyFtplet());

        server.start();

That should be all you need.

> Because FtpServer is relatively new, from Apache, and FTPServers are
not
> commonly needed for web or enterprise applications, there is hardly
any
> documentation, or even a step-by-step list of where to put all of
these
> classes and how to configure them to work.

Yeap, our documentation is certainly limited, an example like this
should probably be added.

/niklas

Re: Simple One: Deploying an Ftplet

Posted by Niklas Gustavsson <ni...@protocol7.com>.
Hey

Let's see if I can give you some pointers.

On Thu, Sep 11, 2008 at 6:55 PM, Sisk, Brad <BS...@ancorinfo.com> wrote:
> I am brand new to Apache's Ftplet API, never needed to use it before. I
> understand how to use it to write Ftplets-but have been unable to find
> any documentation on the web anywhere for how you actually add an Ftplet
> to an application server and get it to work.  The FTPServer application,
> itself, must also be deployed for Ftplets to work...so how do I add them
> both to a project, and configure the deployment descriptors accordingly.
>
> I am using SJAS (Glassfish) as the AppServer, with Java6.  Evidently,
> Ftplets only build within a Spring framework, so the Spring jarfiles are
> already included in the hosting webapp.

So, if I understand you want to run FtpServer embedded within your
application, in turn running in SJAS? If so, you don't need Spring at
all, that's only used for our XML config format. In the case where
you're embedding FtpServer, you need the minimal set of JARs
(ftplet-api, ftpserver core, MINA, SLF4J) and your Ftplet. Then you do
something like:

        FtpServer server = new FtpServer();

        FtpletContainer container =
server.getServerContext().getFtpletContainer();
        container.addFtplet("myFtplet", new MyFtplet());

        server.start();

That should be all you need.

> Because FtpServer is relatively new, from Apache, and FTPServers are not
> commonly needed for web or enterprise applications, there is hardly any
> documentation, or even a step-by-step list of where to put all of these
> classes and how to configure them to work.

Yeap, our documentation is certainly limited, an example like this
should probably be added.

/niklas