Yes

The Expresso controller can be called from the command line.
The DBTool program is an example of such a program.
The program's path is com/jcorporate/expresso/core/utility/DBTool.java
Look in the source code for the 'public static void main()' method
starting around line number 1391.


Expresso requires initialisation of the ConfigManager object.
Afterwards you need to initialise the database pool manager
singleton and then the grab a database  connection from the pool.


            // set up ConfigManager first
            ConfigManager.setWebAppDir((String) commandArgs.get("webAppDir"));
            ConfigManager.load((String) commandArgs.get("configDir"));
            setupLog();
            //initialize the db pool
            ConfigManager.dbInitialize();
                        //Load DBOtherMaps
                        ConfigManager.mapOtherDBs();

     ...

            DBConnectionPool myPool = DBConnectionPool.getInstance(dbName);

            if (poolTest != null) {
                System.out.println("Database Connection Pool Test Mode");
                poolTest();
                System.out.println("Connection pool tests completed.");
                System.exit(1);
            }

     ...

            DBConnection myConnection = myPool.getConnection("DBTool");
     ...

The point is that you put this generic code inside your Struts Action.
But I would have thought that you allow the ExpressoActionServlet to
do the initialisation of the `ConfigManager' and then all you
have to do in a pure Struts Action is grab database connections
from the pool manager. This would allow you to use DBObjects
with the pure Struts Actions.

This is a theory I have not tested it.

=================== MOVE DISCUSSION OFF LIST =====================
I have CC-MAIL 'ed  to you directly, because the discussion like this one,
should take place under expresso mailing list.
I dont wanna swamp other people with mail.
=================== MOVE DISCUSSION OFF LIST =====================

--
Peter Pilgrim                 ++44 (0)207-545-9923

............................................ Swamped under electionic mails


---------------------------------------- Message History 
----------------------------------------


From: "Francisco Hernandez" <[EMAIL PROTECTED]> on 10/01/2002 11:43 PST

Please respond to "Struts Users Mailing List" <[EMAIL PROTECTED]>

To:   "Struts Users Mailing List" <[EMAIL PROTECTED]>
cc:
Subject:  Re: Advice needed on Stuts versus Struts/Expresso


is it possible to use DBObjects and not use other parts of expresso such as
Jobs, Controllers, etc?







--

This e-mail may contain confidential and/or privileged information. If you are not the 
intended recipient (or have received this e-mail in error) please notify the sender 
immediately and destroy this e-mail. Any unauthorized copying, disclosure or 
distribution of the material in this e-mail is strictly forbidden.



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to