I created a JIRA(https://issues.apache.org/jira/browse/TUSCANY-1140) to implement the DAS Lite Command classes that I described here: http://cwiki.apache.org/confluence/pages/viewpage.action?pageId=45093
Hey guys, I read this article https://issues.apache.org/jira/browse/TUSCANY-1140 and I think you will like that, it tells a lot about how c++ sdo works ; ) Adriano Crestani On 2/27/07, Adriano Crestani <[EMAIL PROTECTED]> wrote:
I looked at the maven for netbeans page and it seems interesting, but I didn't have time to test it yet. Sorry Luciano, but what is a webApp skeleton? Could you give an example? On 2/17/07, Luciano Resende <[EMAIL PROTECTED]> wrote: > > Except for the instructions related to NetBeans, most of these steps are > defined on the following two links: > http://incubator.apache.org/tuscany/java-projects.html > or > http://incubator.apache.org/tuscany/java_das_overview.html > > Probably would be better for you to review these links and suggest > enhancements, as most new users will probably have the same issues as > you > guys are having. > > The netBeans steps could probably also be appended to the > java-projects.htmllink, together with the instructions on how to use > Eclipse or IDEA. BTW, > have you seen this : > > http://maven.apache.org/guides/mini/guide-ide-netbeans/guide-ide-netbeans.html > > > Looks like there is a plugin that does the creation of the netBeans > project > files from the pom > > mvn netbeans-freeform:generate-netbeans-project > > > Then, for the webAPP, maybe it's easy if you provide a webApp > skeleton, then people could only import the war file. > > Toughts ? Does the link help ? > > > -- > Luciano Resende > http://people.apache.org/~lresende<http://people.apache.org/%7Elresende> > > On 2/16/07, Adriano Crestani <[EMAIL PROTECTED]> wrote: > > > > As me and Dannyel had some trouble on building and debugging this > simple > > read app using das java, I created this short howTo to help anyone > else > > that > > is also having difficult to create a project on netbeans IDE to debbug > the > > code. > > > > 1 - download subversion(http://subversion.tigris.org/project_packages.html > > ) > > and unpack it > > > > 2 - download maven 2.0.4 (http://maven.apache.org/download.html ) and > > unpack > > it > > > > 3 - set maven/bin and subversion/bin in your SO path > > > > 4 - create a folder called, i. e. Tuscany, and download the java > source > > executing the following commands: > > > > cd tuscany > > > > svn co https://svn.apache.org/repos/asf/incubator/tuscany/java > > > > It will probably ask you if you accept the secure connection, than > allow > > it. > > > > 5 - Now, download the dependencies: > > > > cd java/das > > > > mvn > > > > The dependencies should be downloaded. Let us know if you get any > build > > error on this part. > > > > 6 - Run Netbeans and select File >> New Project.... Select "General" > on > > categories and then "Java Project with Existing Sources" then click on > > next > > > > 7 - Give a name to your project, i.e. "DAS", select its folder and > click > > on > > next. > > > > 8 - Click on the first button "Add Folder..." and select the following > > folders: > > > > Tuscany\java\das\rdb\src\main\java > > > > Tuscany\java\das\rdb\target\sdo-source > > > > Click on "Finish" > > > > 9 - Unpack the file Tuscany\java\das\distribution\binary\target\das- > > 1.0-incubator-SNAPSHOT-bin.zip in a folder, i.e. Lib. > > > > 10 - Right click on DAS project and select properties. Then select > > libraries > > and click on "Add JAR/Folder". Select all the files the folder > > Lib\tuscany- > > das-1.0-incubator-SNAPSHOT\lib contains and click on "Open". > > > > 11 - Again select File >> New Project... select "Web" on categories > and > > "Web > > Application" then click on next. > > > > 12 - Give a name to your project, i.e. SimpleReadApp, select its > folder > > and > > click on finish. > > > > 13 - Right click on you SimpleReadApp project and select New >> > Servlet. > > Give a name to your servlet, i.e. CommandServlet and click on finish. > A > > new > > .java file will be created in SimpleReadApp's Source Packages, open it > and > > copy the CommandServlet class code in it. > > > > 14 - Right click on you SimpleReadApp project and select properties. > Then > > select libraries and click on "Add JAR/Folder". Select the file > > sdo-api-r2.1-1.0-incubator-20061220.211548-2.jar that resides inside > the > > Libs\tuscany-das-1.0-incubator-SNAPSHOT\lib folder and click on > "Open". > > > > 15 - On the same window click on "Add Project...", select the DAS > project > > folder and click on open. > > > > Now you already have what is necessary to run and debug the code. > Don't > > forget to do the adjustments for your dbms: > > > > - set the jdbc jar file > > > > - modify the sql statement according to your dbms pl/sql > > > > - modify the in getConnection method the jdbc driver class path, > the > > database path, user and password > > > > - create in your database having an table called "ITEM" that has an > > integer attribute called "ID". You must also insert at least an row in > > this > > table. > > > > I expect you to debug this simple read app and see for yourselves > which > > classes and methods are needed to implement the simple read app. Then > pick > > the classes you want to implement and create a JIRA for it ; ) > > > > Adriano Crestani > > > > > > On 2/9/07, Douglas Leite < [EMAIL PROTECTED]> wrote: > > > > > > Good ideia.... I´ll do it. > > > > > > On 2/9/07, Adriano Crestani < [EMAIL PROTECTED]> wrote: > > > > > > > > I have an idea to make it more independent. Each one that wants to > > > help > > > to > > > > implement this simple app, evaluate which class is intended to > > implement > > > > and > > > > create a new JIRA for it. In this new JIRA should be described the > > > > classes > > > > and their methods that will be implemented. This way if someone > finish > > > to > > > > implement certain classes, he will be able to choose another > classes > > to > > > > implement, instead of waiting for others to finish their classes. > I > > > think > > > > this way we may speed up the das c++ coding. > > > > > > > > Please, if a new JIRA is created report it here in this thread. > > > > > > > > Adriano Crestani > > > > > > > > On 2/8/07, Douglas Leite < [EMAIL PROTECTED]> wrote: > > > > > > > > > > Okay Adriano.... I will try to understand the simple application > > > that > > > > > you´ve > > > > > posted, step by step, and after that I will choose some useful > > classes > > > > as > > > > > well as their essentials methods to run that application in C++. > > > > > > > > > > > Douglas S. Leite > > > > > > > > > > On 2/8/07, Adriano Crestani < [EMAIL PROTECTED]> wrote: > > > > > > > > > > > > Yes Luciano, but I wasn't sure if there would be any problem > if > > the > > > > > config > > > > > > classes wouldn't be included. We will try to run it without > the > > > config > > > > > > classes though. > > > > > > > > > > > > Douglas, as I had assigned the config classes to you just pick > > some > > > > > > classes > > > > > > from those I've assigned to the others. Or if you have another > > > > > suggestion > > > > > > in > > > > > > what you could be useful just let us know. > > > > > > > > > > > > Adriano Crestani > > > > > > > > > > > > On 2/8/07, Luciano Resende < [EMAIL PROTECTED] > wrote: > > > > > > > > > > > > > > I'd agree with Kevin's suggestion, for a simple C++ sample > > > > application > > > > > > > that > > > > > > > only performs a simple read, you shouldn't need the config > > > classes, > > > > > try > > > > > > to > > > > > > > do in C++ something simple as the java sample you just > posted > > > here. > > > > > > > > > > > > > > As for downloads, you only need to download the DAS > > distribution, > > > > that > > > > > > > will > > > > > > > contain all the SDO and other dependencies inside the zip. > For > > the > > > > new > > > > > > > people, I'd recommend using the stable M2 distributions, > > although > > > I > > > > > > think > > > > > > > SDO and DAS trunk code are stable and compiling fine. > > > > > > > > > > > > > > -- > > > > > > > Luciano Resende > > > > > > > http://people.apache.org/~lresende > <http://people.apache.org/%7Elresende> > > > > > > > > > > > > > > On 2/8/07, Adriano Crestani <[EMAIL PROTECTED] > > wrote: > > > > > > > > > > > > > > > > A correction, there is need to download the das also, not > only > > > the > > > > > sdo > > > > > > > > .jar: > > > > > > > > http://incubator.apache.org/tuscany/das_downloads.html > > > > > > > > > > > > > > > > On 2/8/07, Adriano Crestani < [EMAIL PROTECTED]> > wrote: > > > > > > > > > > > > > > > > > > Anyway, it simplified a lot the ap ; ) > > > > > > > > > > > > > > > > > > On 2/8/07, Adriano Crestani <[EMAIL PROTECTED]> > > wrote: > > > > > > > > > > > > > > > > > > > > Thanks a lot kevin ; ). But I think it look likes the > > first > > > > code > > > > > I > > > > > > > > > > posted, except by the assert you added. > > > > > > > > > > > > > > > > > > > > Adriano Crestani > > > > > > > > > > > > > > > > > > > > On 2/8/07, Kevin Williams < [EMAIL PROTECTED]> wrote: > > > > > > > > > > > > > > > > > > > > > > Your focus should probably be on the APIs your DAS > will > > > > > provide > > > > > > > the > > > > > > > > > > > user > > > > > > > > > > > whether that is from a servlet or some other > > caller. Here > > > > are > > > > > > the > > > > > > > > > > > Java > > > > > > > > > > > DAS apis from the simplest possible read in the test > > > suite: > > > > > > > > > > > > > > > > > > > > > > /** > > > > > > > > > > > * Read a specific customer > > > > > > > > > > > */ > > > > > > > > > > > public void testReadSingle() throws > Exception { > > > > > > > > > > > > > > > > > > > > > > // Create and initialize command to read > > > > customers > > > > > > > > > > > DAS das = DAS.FACTORY.createDAS > > > > (getConnection()); > > > > > > > > > > > Command readCustomers = > das.createCommand > > > > ("select > > > > > * > > > > > > > from > > > > > > > > > > > CUSTOMER where ID = 1"); > > > > > > > > > > > > > > > > > > > > > > // Read > > > > > > > > > > > DataObject root = > readCustomers.executeQuery > > > (); > > > > > > > > > > > > > > > > > > > > > > // Verify > > > > > > > > > > > assertEquals(1, root.getInt > > > ("CUSTOMER[1]/ID")); > > > > > > > > > > > } > > > > > > > > > > > > > > > > > > > > > > Notice that this example also does not allow > > parameterized > > > > > > > > queries. I > > > > > > > > > > > > > > > > > > > > > > would make this simplifying assumption to get > something > > up > > > > and > > > > > > > > > > > running. > > > > > > > > > > > > > > > > > > > > > > I cannot help with the C++ equivalent of JDBC > Connection > > > but > > > > I > > > > > > am > > > > > > > > sure > > > > > > > > > > > there is something similar available. > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > > > > Kevin > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Adriano Crestani wrote: > > > > > > > > > > > > > > > > > > > > > > > Good idea kelvin, but I'm begginer in servlet and > I > > > don't > > > > > know > > > > > > > > what > > > > > > > > > > > > would be > > > > > > > > > > > > the best way for the user to provide the > connection > > and > > > > sql. > > > > > > > > Though > > > > > > > > > > > I > > > > > > > > > > > > tried > > > > > > > > > > > > this: > > > > > > > > > > > > > > > > > > > > > > > > import java.io.IOException; > > > > > > > > > > > > import java.sql.DriverManager ; > > > > > > > > > > > > > > > > > > > > > > > > import javax.servlet.ServletException; > > > > > > > > > > > > import javax.servlet.http.HttpServlet; > > > > > > > > > > > > import javax.servlet.http.HttpServletRequest ; > > > > > > > > > > > > import javax.servlet.http.HttpServletResponse ; > > > > > > > > > > > > > > > > > > > > > > > > import org.apache.tuscany.das.rdb.Command; > > > > > > > > > > > > import org.apache.tuscany.das.rdb.DAS; > > > > > > > > > > > > > > > > > > > > > > > > import commonj.sdo.DataObject; > > > > > > > > > > > > > > > > > > > > > > > > public class CommandServlet extends HttpServlet { > > > > > > > > > > > > > > > > > > > > > > > > private static final long serialVersionUID = > > > > > > > > > > > 1922159305255311505L; > > > > > > > > > > > > > > > > > > > > > > > > public CommandServlet() {} > > > > > > > > > > > > > > > > > > > > > > > > protected void doGet(HttpServletRequest arg0, > > > > > > > > HttpServletResponse > > > > > > > > > > > > > > > > > > > > > > > arg1) > > > > > > > > > > > > throws ServletException, IOException { > > > > > > > > > > > > DataObject items = test(getConnection(), > > "SELECT > > > id > > > > > > FROM > > > > > > > > item > > > > > > > > > > > > WHERE > > > > > > > > > > > > id = 1;"); > > > > > > > > > > > > System.out.println("id = " + items.getInt > > > > > > ("ITEM[1]/ID")); > > > > > > > > > > > > > > > > > > > > > > > > } > > > > > > > > > > > > > > > > > > > > > > > > public DataObject test(java.sql.Connectionconn, > > > String > > > > > > > > readSql) > > > > > > > > > > > { > > > > > > > > > > > > DAS das = DAS.FACTORY.createDAS (conn); > > > > > > > > > > > > > > > > > > > > > > > > Command command = das.createCommand(); > > > > > > > > > > > > DataObject allItems = command.executeQuery > (); > > > > > > > > > > > > > > > > > > > > > > > > return allItems; > > > > > > > > > > > > > > > > > > > > > > > > } > > > > > > > > > > > > > > > > > > > > > > > > } > > > > > > > > > > > > > > > > > > > > > > > > } > > > > > > > > > > > > > > > > > > > > > > > > Adriano Crestani > > > > > > > > > > > > > > > > > > > > > > > > On 2/8/07, Kevin Williams <[EMAIL PROTECTED]> > wrote: > > > > > > > > > > > > > > > > > > > > > > > >> > > > > > > > > > > > >> You could actually start significantly simpler by > > > making > > > > > the > > > > > > > > > > > following > > > > > > > > > > > >> assumptions: > > > > > > > > > > > >> > > > > > > > > > > > >> 1. Read of a single table > > > > > > > > > > > >> 2. User provides SQL programatically > > > > > > > > > > > >> 3. User provides Connection programatically > > > > > > > > > > > >> > > > > > > > > > > > >> With these restrictions you can get something > useful > > > > > working > > > > > > > > > > > without the > > > > > > > > > > > >> classes required for config-file support. > > > > > > > > > > > >> > > > > > > > > > > > >> -- > > > > > > > > > > > >> Kevin > > > > > > > > > > > >> > > > > > > > > > > > >> > > > > > > > > > > > >> Adriano Crestani wrote: > > > > > > > > > > > >> > > > > > > > > > > > >> > Luciano suggested to implement at first, the > > > necessary > > > > > > > classes > > > > > > > > to > > > > > > > > > > > > > > > > > > > > > > >> > create a > > > > > > > > > > > >> > simple app that only reads from a database > using > > the > > > > das > > > > > > c++. > > > > > > > I > > > > > > > > > > > was > > > > > > > > > > > >> > checking > > > > > > > > > > > >> > on the das java that these classes below are > > > essential > > > > to > > > > > > > > create > > > > > > > > > > > this > > > > > > > > > > > >> > app. > > > > > > > > > > > >> > > > > > > > > > > > > >> > DAS > > > > > > > > > > > >> > DASFactory > > > > > > > > > > > >> > DASImpl > > > > > > > > > > > >> > ConfigFactory > > > > > > > > > > > >> > ConfigFactoryImpl > > > > > > > > > > > >> > Config > > > > > > > > > > > >> > MappingWrapper > > > > > > > > > > > >> > config.Command > > > > > > > > > > > >> > ReadCommandImpl > > > > > > > > > > > >> > Command > > > > > > > > > > > >> > CommandImpl > > > > > > > > > > > >> > ConnectionInfo > > > > > > > > > > > >> > > > > > > > > > > > > >> > > > > > > > > > > > > >> > All these classes may be found in das java. I'm > > > > needing > > > > > > some > > > > > > > > > > > >> > volunteers to > > > > > > > > > > > >> > help implement these classes in c++. Actually, > > these > > > > > > classes > > > > > > > > are > > > > > > > > > > > >> > implemented, but are not compiling yet. So we > need > > > > these > > > > > > > > classes > > > > > > > > > > > >> > compiling > > > > > > > > > > > >> > and implement a simple read app with these > classes. > > > > > > > > > > > >> > > > > > > > > > > > > >> > Any suggestion will be appreciated. > > > > > > > > > > > >> > > > > > > > > > > > > >> > Adriano Crestani > > > > > > > > > > > >> > > > > > > > > > > > > >> > > > > > > > > > > > >> > > > > > > > > > > > >> > > > > > > > > > > > >> > > > > > > > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > > > > > > > > >> To unsubscribe, e-mail: > > > > > [EMAIL PROTECTED] > > > > > > > > > > > >> For additional commands, e-mail: > > > > > > [EMAIL PROTECTED] > > > > > > > > > > > >> > > > > > > > > > > > >> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > > > > > > > > To unsubscribe, e-mail: > > > > [EMAIL PROTECTED] > > > > > > > > > > > For additional commands, e-mail: > > > > > [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
