Re: SDO in Eclipse Plug-in

2008-05-12 Thread Adriano Crestani
Hi Tomasz,

What is the SDO version you are using?

Have you tried to debug in the SDO source code to check where exactly it
stops?

Regards,
Adriano Crestani

On Mon, May 12, 2008 at 1:01 PM, Tomasz Klukowski 
[EMAIL PROTECTED] wrote:

 I want to make an Eclipse Plug-in that uses Apache Tuscany SDO library.
 Unfortunatelly I've come into a severe problem that I can't overcome. I've
 tried many different things but nothing has worked and I'm very desperete
 for any help.
 Here's a description of my problem:

 At the moment of calling SDOUtil.createHelperContex() the execution of the
 calling method stops. Nothing happens and no exception is thrown.
 For example calling of this method causes nothing more than writing
 look! on the console:

 void exmp() {
  System.out.println(look!);
  SDOUtil.createHelperContext();
  System.out.println(I'm on TV!);
 }

 A similar problem is with HelperProvider.getDefaultContext().

 I suppose the problem is that not all needed libraries are
 loaded\initialized as I run the project as the Eclipse Plug-in.
 When I used the SDO-Tuscany in application compiled as the SWT Application
 everything worked fine!

 Is there any way to make the SDO-Tuscany library work in an Eclipse
 Plug-in?




Re: loading composite from url

2008-04-21 Thread Adriano Crestani
Hi Marian,

Shouldn`t be

SCADomain.newInstance(http://localhost:7001/some-web-app/Test.composite;);

instead of

SCADomain.newInstance(http://localhost:7001/some-web-app/Test.composite
http://localhost:7001/some-web-app/Test.composite );

?

On Mon, Apr 21, 2008 at 3:03 PM, Marian, Radu [EMAIL PROTECTED]
wrote:

 Hello,

 How do I achieve the following:
 scaDomain =
 SCADomain.newInstance(http://localhost:7001/some-web-app/Test.composite
 http://localhost:7001/some-web-app/Test.composite );

 I am getting the following error:

 org.osoa.sca.ServiceRuntimeException:
 org.osoa.sca.ServiceRuntimeException:
 java.lang.IllegalArgumentException: Composite not found:
 http://localhost:7001/crms-domain/metadata/transformation.service/consum
 er.facade/v001/ConsumerFacade.composite
 http://localhost:7001/crms-domain/metadata/transformation.service/consu
 mer.facade/v001/ConsumerFacade.composite
  at
 org.apache.tuscany.sca.host.embedded.SCADomain.createNewInstance(SCADoma
 in.java:264)
  at
 org.apache.tuscany.sca.host.embedded.SCADomain.newInstance(SCADomain.jav
 a:69)
  at DomainTestCase.setUp(DomainTestCase.java:41)
 ...
 Caused by: org.osoa.sca.ServiceRuntimeException:
 java.lang.IllegalArgumentException: Composite not found:
 http://localhost:7001/crms-domain/metadata/transformation.service/consum
 er.facade/v001/ConsumerFacade.composite
 http://localhost:7001/crms-domain/metadata/transformation.service/consu
 mer.facade/v001/ConsumerFacade.composite
  at
 org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.init(Defaul
 tSCADomain.java:117)
  at
 org.apache.tuscany.sca.host.embedded.SCADomain.createNewInstance(SCADoma
 in.java:230)
  ... 16 more
 Caused by: java.lang.IllegalArgumentException: Composite not found:
 http://localhost:7001/crms-domain/metadata/transformation.service/consum
 er.facade/v001/ConsumerFacade.composite
 http://localhost:7001/crms-domain/metadata/transformation.service/consu
 mer.facade/v001/ConsumerFacade.composite
  at
 org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.getContributi
 onLocation(DefaultSCADomain.java:299)
  at
 org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain.init(Defaul
 tSCADomain.java:111)
  ... 17 more

 Regards,
 Radu Marian
 CRM Services Architecture Team
 Bank of America, Charlotte NC
 (980) 387-6233
 [EMAIL PROTECTED]




Re: Running Tuscany/SCA in Google Android mobile platform

2008-03-20 Thread Adriano Crestani
I have started to change the SCA code.

Initially, the objects instantiated dynamically were not being instantiated,
because info about which class to instantiate is extract from some text
files contained in SCA modules' jars. Unfortunately, when Android converter
converts the SCA modules' jars to .dex files, it ignores the non-class
files, and they are not included. It happens because Android has a very
specific way to store the app resources, which is completely different from
Java.

Though, as Luciano suggested, I started to modify these dynamic
instantiation for static. It's working for now : ). All these modifications
were made only on host-embedded module code, which I have copied into [1]
and renamed to host-android.

Also, one of those static instantiated classes was trying to access the
javax.naming.InitialContext in its constructor, but it's not supported by
Android and I commented the code. As this class belonged to SCA core module,
I also copied this module into the mobile-android sandbox and renamed the
module to core-android.

So, all the modifications made so far are in the [2].

Now, as I was expecting, I got some ClassNotFoundExceptions on SCA code when
it tries to use the Java XML API. It happens because Android implements only
a small part of this API. So, next step is try to adapt the SCA XML access
into Android way to access XML. Does anybody know some other XML API that is
javax.xml independent I could use instead of Android one?

Suggestions? : )

Adriano Crestani

[1]
https://svn.apache.org/repos/asf/incubator/tuscany/sandbox/mobile-android/host-android/
[2]
https://svn.apache.org/repos/asf/incubator/tuscany/sandbox/mobile-android/https://svn.apache.org/repos/asf/incubator/tuscany/sandbox/mobile-android/host-android/



On Mon, Mar 17, 2008 at 1:41 PM, Luciano Resende [EMAIL PROTECTED]
wrote:

 I'd probably categorize the experiment we are doing now, as a learning
 experience to familiarize with the Mobile environment available in
 Google Android. For this, we have choosen to try running one of the
 simplest samples we had (calculator) in the Android JVM
 environment In the long run, the idea is to have a more
 light-weight sca mobile core/runtime available, similar to what we
 did for Web 2.0 (implementation-widget) and described by Mike below.

 But it's indeed good to discuss these items with the community, would
 be also good to have the community contributing requirements/scenarios
 for a Tuscany mobile story. And we are all open and welcoming any
 help.


 On Mon, Mar 17, 2008 at 8:22 AM, Mike Edwards
 [EMAIL PROTECTED] wrote:
  Brandon Werner wrote:
Can you explain the benefit of moving SCA/SDO over to the Android
 platform?
I can understand wanting to have the ability to consume simple XML
 services
and perhaps consume disconnected datagraphs, but I don't understand
 why the
world wouldn't want a more light-weight way of doing that than
 ripping out
something that was meant for the JEE / JSE.
   
snip
   Brandon,
 
   So you think that a device using the Andriod platform is likely to want
   to use services and a service-oriented approach to building
   applications.  But you think that SCA is too heavyweight?  Is that
   simply a question of the size of the code involved (I note that the
 core
   of Tuscany is quite small) or is the SCA approach too heavyweight in
   some other sense?
 
   I wonder if you've taken a look a the implementation.widget exemplified
   in the Tutorial demo code?  This applies SCA principles to AJAX widgets
   running in the browser - simplifying the connectivity a great deal (in
   my opinion) and yet adding little overhead.
 
   In the longer run, we may want to look to do something similar for the
   Android platforms, perhaps with Java rather than the more limited
   JavaScript components.  Starting with the current SCA package seems
   reasonable to me - once we have experience with how that works, we will
   have a better idea what needs to be changed and tailored for the
 Android
   platform.
 
 
   Yours,  Mike.
 
 
 
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
 
 



 --
 Luciano Resende
 Apache Tuscany Committer
 http://people.apache.org/~lresende http://people.apache.org/%7Elresende
 http://lresende.blogspot.com/

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




Re: CppCalculator debug error

2008-03-17 Thread Adriano Crestani
OK, so it's probably a SCA bug or an env not correctly configured.
Unfortunately I'm not the right person to anwser this, my knowledge on SCA
C++ is short.

Lets expect someone else from C++ is able to answer you : )

Regards,
Adriano Crestani

On Mon, Mar 17, 2008 at 9:53 PM, Prashanth Rao [EMAIL PROTECTED]
wrote:

 Hi Adriano

 Thanks a lot for the reply.. I am running the binary version of Tuscany
 SCA
 CPP and SDO (M3 release)

 Even if i use the release mode, when i run the client.. the application
 just
 crashes with this message.
 calculator_client.exe has encountered a problem and needs to close.


 Regards
 Prashanth



Running Tuscany/SCA in Google Android mobile platform

2008-03-14 Thread Adriano Crestani
Hi,

Luciano and me have been trying to run the SCA calculator sample on the
Google Android platform, that is a platform for mobile devices. As the
Android platform apps are written in Java language, we tried to run the Java
SCA calculator sample on it.

Although the apps for Android are coded in Java, it's only coded in Java
language. When it's compiled, it generates not .class files, but a file
called .dex, that is equivalent to .jar files. The .dex files are not
compound of Java standard bytecode, but a special bytecode that is intended
to run only on Android VM: Dalvik.

So, in our first try to compile the calculator sample, only importing the
needed SCA jars were not successful, because the SCA jars are compiled using
JDK compiler and do not have the Android special bytecode format.

Fortunately, when you import the SCA jars into an eclipse Android project,
it automatically tries to convert the JDK bytecode to Android bytecode
before execute it. But something was not going correctly yet, cause when it
tries to execute the service I get this exception:

Application Error: com.android.hello An error in com.android.hello. Unnable
to start activity
ComponentInfo{com.android.hello/com.android.hello.HelloAndroid]:
org.osoa.sca.ServiceRuntimeException: java.lang.NullPointerException.

I wasn't sure about what was happening, and then I tried another approach:
not import the SCA jars, but place the SCA source code needed by the
calculator sample into the Android app src folder. This way the SCA would be
compiled directly to Android bytecode.

Unfortunately, the Android is not Java and does not have the entire set of
classes that J2SE provides. It provides only some java classes as java.langand
java.util classes which Android developers kept with the same package/class
names and method signature for easy portability of Java app codes. So, the
common Java classes used on Java SCA were compatible. But, the Java SCA uses
a lot the javax.xml package and Android implements only part of this package
on its platform, so I was getting a lot of errors because the missing
classes that should be contained in this package. I solved it downloading
the StAX source code and JDK javax.xml API source code, and placing it
directly on my Android app project. Finally I got it compiled.

Then, I got another error. I found out that the Android compiler fist
compile the Java code to .class files and then compile the .class files to a
.dex file. The first process everything goes fine, meaning the package
dependencies and code syntax are OK. But on the second process, when it
tries convert the .class files to .dex, I get 4 warnings and 1 error that
are lightly described:

*[2008-03-14 14:25:27 - HelloAndroid]
trouble processing:
[2008-03-14 14:25:27 - HelloAndroid] truncated annotation attribute
...while parsing RuntimeVisibleAnnotations attribute at offset 0175
...while parsing attributes[1]
...while parsing javax/xml/bind/annotation/XmlNs.class
...while processing javax/xml/bind/annotation/XmlNs.class
[2008-03-14 14:25:27 - HelloAndroid]
trouble processing:
[2008-03-14 14:25:27 - HelloAndroid] truncated annotation attribute
...while parsing AnnotationDefault attribute at offset 02b8
...while parsing attributes[0]
...while parsing methods[0]
...while parsing javax/xml/bind/annotation/XmlSchema.class
...while processing javax/xml/bind/annotation/XmlSchema.class
[2008-03-14 14:25:28 - HelloAndroid]
trouble processing:
[2008-03-14 14:25:28 - HelloAndroid] truncated annotation attribute
...while parsing AnnotationDefault attribute at offset 0204
...while parsing attributes[0]
...while parsing methods[2]
...while parsing javax/xml/ws/Action.class
...while processing javax/xml/ws/Action.class
[2008-03-14 14:25:29 - HelloAndroid]
trouble processing:
[2008-03-14 14:25:29 - HelloAndroid] truncated annotation attribute
...while parsing AnnotationDefault attribute at offset 020b
...while parsing attributes[1]
...while parsing methods[0]
...while parsing org/osoa/sca/annotations/Service.class
...while processing org/osoa/sca/annotations/Service.class
[2008-03-14 14:25:30 - HelloAndroid] 4 warnings
[2008-03-14 14:25:30 - HelloAndroid]
trouble writing output: not found
[2008-03-14 14:25:30 - HelloAndroid] Conversion to Dalvik format failed with
error 2

*
So, I got nothing running so far : ( . Is there anyone with some Android
knowledge that could help us with it?

I will probably send this doubts to Android community and see if they can
help us : )

Thanks in advance ; )

Adriano Crestani


Re: 2 Questions - WSDL deployment and SDO_DAS_XML error

2008-03-10 Thread Adriano Crestani
Hi Prashanth,

Thanks for your interest in the Native(C++) projects.

Sorry, but the SCA is really out of date and its samples weren't updated
when DAS for XML was removed.

This sample could be fixed using another solution intead of using the
php_sdo_das_xml.dll to access data. But I'm not sure which solution, since
I'm not used to with PHP.

Could you please open a JIRA for it? Maybe you also have already thought
about a solution for this problem and submit a patch : ). Tuscany is really
needing help with C++ projects.

Regards,
Adriano Crestani

On Fri, Mar 7, 2008 at 5:28 AM, Prashanth Rao [EMAIL PROTECTED]
wrote:

 Hi

 1] I am trying SCA C++ implementation on a windows XP platform. I was
 trying
 some of the samples and was able to execute the C++ clients for bigBank
 and
 the cppCalculator samples..

 However, when i try to run the PHP client for bigBank (followed the
 guidelines in the doc..) First, I could not find
 php_sdo_das_xml.dllhttp://pecl4win.php.net/ext.php/php_sdo_das_xml.dll
 for download (also on the php site, i read tat it has been obsoleted and
 is
 removed?)  Hence when i try to run the PHP based webclient for bigBank
 sample, I get following error

  Class 'SDO_DAS_XML' not found .. Is there any solution for this?


 2] Also, if I manually create a WSDL interface for a C++ component, what
 are
 the steps needed to deploy the WSDL onto a server (say AXIS2/C or apache
 server?)


 Look forward to your reply..


 Thanks
 Prashanth



Re: Applying SDO to databases?

2007-10-30 Thread Adriano Crestani
Hi Jason,

Give a look at Tuscany DAS:
http://incubator.apache.org/tuscany/das-overview.html

There are versions for Java and C++. You can load data from rdb into SDO
Graph and vice-versa.

Adriano Crestani

On 10/30/07, Jason Clark [EMAIL PROTECTED] wrote:





 I've been reviewing all the SDO information I can find in my continued
 quest
 to learn about SCA and complemenatry technologies to enhance the project I
 am currently working on.



 To be specific, I have a database of people's contact information in the
 event of an emergency.



 I've seen lots of SDO information regarding dealing with XML and such, but
 what would the strategy be for dealing with the same information but
 gathered from a database? In this case, SQL Server using their JDBC
 driver.
 Maybe that's to specific, but generally, how do you approach this problem?
 I
 see XML Helper classes but not much in the way of dealing with database
 persistence in any of the samples I could find.



 Thanks,



 -Jason Clark









Re: Tuscany SDO C++ under Windows with MinGW?

2007-10-22 Thread Adriano Crestani
Hi Eike,

I'm not used to MinGW, but there is a new way to build the SDO C++ using
Apache Ant. You may be able to configure it to compile with the compiler you
want to ; )

Adriano Crestani

On 10/8/07, Eike Thaden [EMAIL PROTECTED] wrote:

 Hi,

 is there a way to use Tuscany SDO C++ under Windows with MinGW? We are
 using MinGW frequently in our projects (and Visual Studio not at all)
 and cannot link the SDO dll compiled with the VS compiler because of the
 different ABI.

 Best regards,
 Eike Thaden

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




SDO CPP - Help with retrieving the new DataObject set on a Property

2007-09-29 Thread Adriano Crestani
Hi,

I need to do the following:

I have a settingList of a modified dataObject, there is a setting on it that
isSet=true or isNull=true, meaning that there was no previous DataObject set
on that property, and I want to retrieve the new DataObject set on it. I can
do it invoking dataObject-getDataObject(setting.getProperty()), but if the
setting.getProperty() is many=true, I need to use dataObject-getList(
setting.getProperty()), however a list of DataObject is returned and not
only one, so how can I know which DataObject was inserted on this list?

Adriano Crestani


[SDO C++] Setting::getDataObjectValue question

2007-09-18 Thread Adriano Crestani
I have the following code:

const commonj::sdo::SettingList settings =
summary-getOldValues(dataObject);

for (int i = 0 ; i  settings.size() ; i++) {

if (!settings[i].getProperty().getType().isDataType()) {

commonj::sdo::DataObjectPtr value =
setting[i].getDataObjectValue();

}

}


Shold the value variable always be a valid pointer? Cause it's returning
NULL for me.

Adriano Crestani


off on vacation

2007-08-25 Thread Adriano Crestani
I'm off on vacation for a week. Back on 09/02 ; )

Adriano Crestani


DAS C++ First Sample

2007-06-27 Thread Adriano Crestani

Actually, there is being implemented a version of Tuscany DAS in C++. There
is no release of this version yet, and all the code can only be downloaded
from the trunk on [1].

DAS C++ development status are being commented on thread [2].

Under revision 550697 was added the new DAS C++ sample: SimpleRead. This
sample demonstrates how to use DAS C++ to load data from a data source into
a SDO graph.

To get start on compiling and installing DAS C++, see page [3].

Any feedback will be helpful ; )

[1] https://svn.apache.org/repos/asf/incubator/tuscany/cpp/das/
[2] http://www.mail-archive.com/[EMAIL PROTECTED]/msg18032.html
[3]
https://svn.apache.org/repos/asf/incubator/tuscany/cpp/das/GettingStarted.html

Adriano Crestani


Re: DAS Beta1 distros

2007-06-26 Thread Adriano Crestani

Everything seems OK for me ; )

Adriano Crestani

On 6/26/07, litaojian [EMAIL PROTECTED] wrote:


very good ,
I hope the release could done ASAP .




litaojian
2007-06-27



发件人: Luciano Resende
发送时间: 2007-06-27 01:08:19
收件人: tuscany-dev; Tuscany Users
抄送:
主题: DAS Beta1 distros

I have built DAS distros that are intend to be the DAS beta1 RC and
they are available for a quick review at :

   http://people.apache.org/~lresende/tuscany/das-beta1-distribution/

I still need to make a final review to the distros and provide an
updated release notes.

Please let me know if you find any problems, I'll give it a day for
people to comment on these distros, and will then cut a release
candidate based on the das-beta1 branch.

--
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/

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



Re: [DAS] Status of DAS Release

2007-06-21 Thread Adriano Crestani

Amita, I have reviewed the RDB DAS Architecture Guide:

- It is still missing the design diagram file(
http://incubator.apache.org/tuscany/rdb-das-class-diagram.html). It seems
you've uploaded it as attachment, but I don't know why it is not loading on
the page.

- On ResultSetProcessor description the word GrapbBuilderMetadata is
incorrect written.

- On Configuration Schema I think it should be made explicit that the order
ResultDescriptor are declared are the order they appear on ResultSet. Am I
wrong?

- What SingleTableRegistry is used for? On its description it says it has
now functionality.

PS: I could fix some of these issues I`ve pointed, but I don't know why I'm
not being able to edit it : (

Regards,
Adriano Crestani

On 6/15/07, Amita Vadhavkar [EMAIL PROTECTED] wrote:

   Hi Luciano,
   I tested latest from trunk and the issues discussed here seemed to be
fixed
   now. Thank you very much.

   Regards,
   Amita


   On 6/15/07, Luciano Resende [EMAIL PROTECTED] wrote:
   
Thanks Amita for looking into this...
I have fixed the distribution issue as in TUSCANY-1348, and the
logging issue as in TUSCANY-1349. I also noticed an issue with logging
in dbConfig, where we were not checking if logging was enabled and
always calling log, and I have also fixed that.
   
Please let me know if things are looking better now.
   
On 6/14/07, Amita Vadhavkar [EMAIL PROTECTED] wrote:
 Small update, tried to build and test with empty repos and it went
through
 with no issues.

 Regards,
 Amita

 On 6/13/07, Amita Vadhavkar [EMAIL PROTECTED] wrote:
 
  Things tested to be working -
  all UT as part of mvn build
  all samples in different browsers.
 
  Apart from das\distribution\binary\pom.xml - change and
documentation
  changes in JIRA 1335, I have a doubt in logging mechanism in web
samples.
 
  In DBConfig utility , the code uses Logger.getLogger(className) -
to
get
  logger from log4j.
 
  Whereas in all RDB DAS code, it is
  LoggerFactory.INSTANCE.getLogger(className) - to get logger from
RDB
DAS
  util.
  In this, the level is OFF - hardcoded in the code.
 
  So, when the log4j.properties file is used in tomcat to switch on
logging,
  the logging works for DBConfig (as it is using direct log4j), but
logging
  does not switch on for RDB DAS classes, as it is hardcoded OFF in
the
RDB
  DAS jar.
 
  Is this the desired behavior? Will there be any need to switch on
logging
  in web samples for RDB DAS code and how to do it without touching
  tuscany-das-rdb-1.0-incubating.jar?
 
  Regards,
  Amita
 
  On 6/11/07, Amita Vadhavkar [EMAIL PROTECTED] wrote:
  
   Hi All,
  
   When tried mvn -Pdistribution on das:-
   das\distribution\binary\pom.xml - does not list ajax web sample
under
   dependency and thus does not package same
  
   As now, non-committer does not have access to edit wiki, I have
created
   JIRA-TUSCANY-1335 for all the pending updates for DAS I was
doing.
Please
   see how these can be completed using attached zipped files.
  
   Architecture Guide -
   
http://cwiki.apache.org/confluence/display/TUSCANY/RDB+DAS+architecture+guide
  
   images to upload - ClassDiag.jpg, rdbDAS.gif
  
   User Guide -
  
   
http://cwiki.apache.org/confluence/display/TUSCANY/RDB+DAS+-+User+Guide
   Under Samples(See Capabilities in use)
   Put links for:-
   Web Sample -
  
   
https://svn.apache.org/repos/asf/incubator/tuscany/java/das/samples/companyweb/readme.htm
   J2SE Sample -
  
   
https://svn.apache.org/repos/asf/incubator/tuscany/java/das/samples/customer/readme.htm
   Advanced Web Sample -
   
https://svn.apache.org/repos/asf/incubator/tuscany/java/das/samples/sample-ajax-das/readme.htm
  
  
   Development Guide - DAS_Java_Development_Guide.txt - need to add
to
wiki
  
   need to checkin under
   
https://svn.apache.org/repos/asf/incubator/tuscany/java/das/distribution/src/main/release/RELEASE
   NOTES
   RELEASE_NOTES.txt
  
   About to complete CHANGES.txt , will add by eod to JIRA 1335..
  
   Regards,
   Amita
  
   On 6/10/07, Adriano Crestani [EMAIL PROTECTED] 
wrote:
   
I went through all das samples and they seem to be working
fine on
Windows
XP Home Edition SP 2 environment. I also corrected some links
on
readmes
that were pointing to old tuscany website.
   
I ran the rat on java/das directory and added Apache Licence
header to
files
that were missing it.
   
Regards,
Adriano Crestani
   
On 6/8/07, Luciano Resende  [EMAIL PROTECTED] wrote:

 First of all, let me thank you all for helping

Re: SDO C++ loading data from XML

2007-06-05 Thread Adriano Crestani
=true/
  /xsd:complexType

  xsd:complexType name=Table
 xsd:all
xsd:element maxOccurs=unbounded minOccurs=0 name=Column
type=config:Column/
 /xsd:all
 xsd:attribute name=tableName type=xsd:string use=required/
 xsd:attribute name=typeName type=xsd:string/
  /xsd:complexType

  xsd:complexType name=KeyPair
 xsd:attribute name=primaryKeyColumn type=xsd:string
use=required/
 xsd:attribute name=foreignKeyColumn type=xsd:string
use=required/
  /xsd:complexType

  xsd:complexType name=Column
 xsd:attribute name=columnName type=xsd:string use=required/
   xsd:attribute name=sqlType type=xsd:string use=required/
 xsd:attribute name=propertyName type=xsd:string/
 xsd:attribute name=primaryKey type=xsd:boolean default=false/
  /xsd:complexType

/xsd:schema

config.xml:

Config xmlns=http:///org.apache.tuscany.das.rdb/config.xsd;

   Table tableName=department
 Column sqlType=integer columnName=id primaryKey=true/
   Column sqlType=varchar columnName=name primaryKey=true/
   /Table

   Relationship primaryKeyTable=department foreignKeyTable=employee
many=true
 KeyPair primaryKeyColumn=id foreignKeyColumn=department_id/
   KeyPair primaryKeyColumn=name
foreignKeyColumn=department_name/
   /Relationship

/Config

Thanks,
Adriano Crestani

On 6/5/07, Pete Robbins [EMAIL PROTECTED]  wrote:


You should be able to define the Types and Properties manually if you want

to. I would ask WHY you want to do this as using a schema is a lot
simpler!

Could you post your config.xsd and config.xml?

If you add a line

cout  dataFactory  endl;

That should print the Types and Properties you have defined and you can
compare that to the Types/Properties defined by loading the schema.

Cheers,



On 04/06/07, Adriano Crestani [EMAIL PROTECTED] wrote:

 Is there a way to load data from a XML file without a XML schema file,
 only
 defining the graph type and properties manually on code?

 The code bellow works:

 DataFactoryPtr dataFactory = DataFactory::getDataFactory();
 XSDHelperPtr xsdh = HelperProvider::getXSDHelper(dataFactory);
 xsdh-defineFile(config.xsd);

 XMLHelperPtr xmlh = HelperProvider::getXMLHelper(dataFactory);
 XMLDocumentPtr doc = xmlh-loadFile( config.xml);
 DataObjectPtr root = doc-getRootDataObject();

 But when I defining manually the graph struct it does not:

 DataFactoryPtr dataFactory = DataFactory::getDataFactory();
 dataFactory-addType(DAS_NAMESPACE, Table);
 const Type table = dataFactory-getType(DAS_NAMESPACE, Table);
 dataFactory-addPropertyToType(table, tableName, SDO_NAMESPACE,
 String,
 false, false, true);
 dataFactory-addPropertyToType(table, typeName, SDO_NAMESPACE,
String,
 false, false, true);

 dataFactory-resolve();


This method is not intended to be called by a client. I don't think it
should even be on the DataFactory interface.

XMLHelperPtr xmlh = HelperProvider::getXMLHelper(dataFactory);
 XMLDocumentPtr doc = xmlh-loadFile( config.xml, DAS_NAMESPACE);
 DataObjectPtr root = doc-getRootDataObject(); // the root data object
 returned is NULL

 Adriano Crestani


Cheers,

--
Pete



Re: SDO C++ loading data from XML

2007-06-05 Thread Adriano Crestani

Defining via a schema will have created a Type DAS_NAMESPACE#RootType and
properties will have been added to this for e.g. Config from the
xsd:element name=Config type=config:Config/. Your manual version does
not do this.

So, when you mean to create a RootType and adding Config as a property, you
mean this?:

dataFactory-create(DAS_NAMESPACE, RootType);
dataFactory-create(DAS_NAMESPACE, Config);
dataFactory-addPropertyToType(DAS_NAMESPACE, RootType, Config,
DAS_NAMESPACE, Config);


I don't quite understand that... I would assume a das user would need the
das library! ... but I haven't looked into das a lot so I don't know what
the api is or what the user is trying to do here!!

DAS framework must be configured before usage, it can be done via code or
via xml. Anyway, the DAS needs to read the xml config file to set up the
framework. I'm trying to use SDO feature that loads data from xml to
retrieve the config info from xml file. The problem is if the DAS to depend
on a xsd file to generate the sdo graph structure every time it is executed,
so the user will need both, the xsd file and das_runtime.lib :s

Adriano Crestani

On 6/5/07, Pete Robbins [EMAIL PROTECTED] wrote:


On 05/06/07, Adriano Crestani [EMAIL PROTECTED] wrote:

 Hi Pete,

 Well, I didn't know about DataFactory  operator, but I did it
manually,
 LoL, and it looked like the same when I define using xsd and manually.


Defining via a schema will have created a Type DAS_NAMESPACE#RootType and
properties will have been added to this for e.g. Config from the
xsd:element name=Config type=config:Config/. Your manual version
does
not do this.

The reason to avoid using xsd definition is that the das user would need
the
 das_runtime.lib and also config.xsd, however it is not a good practice
for
 a
 library.


I don't quite understand that... I would assume a das user would need the
das library! ... but I haven't looked into das a lot so I don't know what
the api is or what the user is trying to do here!!

I debugged the sdo and look like it defines a DASValue when load using xsd
 and also sets the rootElementName on DataFactoryImpl. When I define
 manually
 I set only the rootElementName, but not the DASValue. I think when the
 XMLHelper reads the xml it uses this DASValue object set when the xsd is
 loaded, and that is why I'm saying the xml load NEEDS xsd definition.


The DASValue is a way of appending the schema information to the Types and
Properties. This should not be necessary in your case but is again a
reason
to use schema.

I will need to look into the SDO code to see what the rootElementName is.
I'm not sure what it does but I AM 100% sure you shouldn't set it from a
client. You should not need to use any API on DataFactoryImpl (or
any.Impl class). The user API is defined in DataFactory.h


Above the both methods, manually and using xsd, now complete:

 Manually:
 commonj::sdo::DataFactoryPtr dataFactory =
 commonj::sdo::DataFactory::getDataFactory();
((commonj::sdo::DataFactoryImpl)
 *dataFactory).setRootElementName(Config);
dataFactory-addType(DAS_NAMESPACE, Table);
dataFactory-addType(DAS_NAMESPACE, Relationship);
dataFactory-addType(DAS_NAMESPACE, KeyPair);
dataFactory-addType(DAS_NAMESPACE, Column);
dataFactory-addType(DAS_NAMESPACE, Config);

const commonj::sdo::Type table = dataFactory-getType(DAS_NAMESPACE,
 Table);
const commonj::sdo::Type relationship =
 dataFactory-getType(DAS_NAMESPACE, Relationship);
const commonj::sdo::Type keyPair =
dataFactory-getType(DAS_NAMESPACE,
 KeyPair);
const commonj::sdo::Type column =
dataFactory-getType(DAS_NAMESPACE,
 Column);
const commonj::sdo::Type config =
dataFactory-getType(DAS_NAMESPACE,
 Config);

dataFactory-addPropertyToType(table, Column, column, true, false,
 true);
dataFactory-addPropertyToType(table, tableName, SDO_NAMESPACE,
 String, false, false, true);
dataFactory-addPropertyToType(table, typeName, SDO_NAMESPACE,
 String, false, false, true);

dataFactory-addPropertyToType(config, Table, table, true, false,
 true);
dataFactory-addPropertyToType(config, Relationship, relationship,
 true, false, true);
dataFactory-addPropertyToType(config, uri, SDO_NAMESPACE,
String,
 false, false, true);

dataFactory-addPropertyToType(relationship, KeyPair, keyPair,
true,
 false, true);
dataFactory-addPropertyToType(relationship, name, SDO_NAMESPACE,
 String, false, false, true);
dataFactory-addPropertyToType(relationship, primaryKeyTable,
 SDO_NAMESPACE, String, false, false, true);
dataFactory-addPropertyToType(relationship, foreignKeyTable,
 SDO_NAMESPACE, String, false, false, true);
dataFactory-addPropertyToType(relationship, many, SDO_NAMESPACE,
 Boolean, false, false, true);
dataFactory-setDefault(relationship, many, true);

dataFactory-addPropertyToType(keyPair, primaryKeyColumn,
 SDO_NAMESPACE, String, false, false, true);
dataFactory-addPropertyToType(keyPair, foreignKeyColumn

Re: DAS M3 Release

2007-04-17 Thread Adriano Crestani

Hi,

I've listed the opened JIRAs for Java DAS on [1]. I need a feedback of which
JIRA should be resolved before the Java DAS M3 release and which postponed
for next one. I will be helping Amita on this research too ; ).

I also listed on [1] the JIRAs for Java DAS that were resolved after last
release. This list will probably be made the Java DAS M3 key features. Let
me know if any feature not listed should be included on or some listed
feature should be removed from.

[1]
http://cwiki.apache.org/confluence/display/TUSCANY/Features+for+Java+DAS+M3+Release

Adriano Crestani

On 4/17/07, Amita Vadhavkar [EMAIL PROTECTED] wrote:


Hi All,

I have worked on a couple of jiras, and planning to analyze more JIRAs
soon.So far the JIRAs I have worked on are as below:-

TUSCANY-800 - Ajax DAS - patch available, creating a final patch
TUSCANY-841 - Compound Key Relationship Tests - resolved
TUSCANY-863 - Auto canned DB creation - patch available
TUSCANY-948 - DAS support for standalone/J2SE applications - resolved
TUSCANY-952 - multiple schema support - patch available
TUSCANY-864 - DAS SCA container - may need to be tied to next SCA release,
work-in-progress

Please give your feedback about how these JIRAs can be made part of DAS
Java
M3.

Also, it will really helpful to get your perspective about what all can be
the key
features, any pending JIRAs which can add value to this release, any
must
JIRA which
need to be newly added. I am going to research too on this front.
Appreciate
your
comments.

Regards,
Amita


On 4/16/07, Luciano Resende [EMAIL PROTECTED] wrote:

 Recently we had couple inquires about a DAS Release [1] and [2], so it's
 probably time to start discussing what should be in the next DAS
 release.Wecould start by reviewing the discussion we had right after
 we released DAS
 M2 [3], and also get a list of things we already have done after our
 previous release.

 Couple things I would like to help for our next release:

 - Review MySQL Support

 Sample
   - Automate creation of Canned databases for DAS Samples (TUSCANY-863)

 Documentation
   - Continue to work on DAS User's guide
  - Migrate it to new wiki and investigate the possibility to add to
 the
 release package

 Infrastructure
   - Automate release distribution process

 Once we agree on a set of items for our next release, we then could
start
 tracking the release progress on our wiki.

 Thoughts ?

 [1] -
http://www.mail-archive.com/tuscany-user@ws.apache.org/msg00798.html
 [2] -
 http://www.mail-archive.com/tuscany-user%40ws.apache.org/msg00589.html
 [3] -
http://www.mail-archive.com/[EMAIL PROTECTED]/msg11017.html
 [4] -
 http://cwiki.apache.org/confluence/display/TUSCANY/RDB+DAS+-+Releases

 --
 Luciano Resende
 http://people.apache.org/~lresende




Re: Tuscany DAS can't not return static DataObject???

2007-01-23 Thread Adriano Crestani

I've never tried to use static names for tables, so sorry, I cannot answer
your first question : (

You may return a user DataObject:
 root.getDataObject(User[i]); // where i is a number that defines
the user's position on the users list.

Adriano Crestani

On 1/23/07, Sam Su [EMAIL PROTECTED] wrote:


Hi,  I would like to ask a urgent question:
Does Tuscany DAS support returning static DataObject???

/xml config
file*/

?xml version=1.0 encoding=UTF-8?Config
xsi:noNamespaceSchemaLocation=
http:///org.apache.tuscany.das.rdb/config.xsd;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;

Command name=qryAllUsers SQL=select
USER_ID,PASSWORD,NAME,AVAILABLE
from CCP_USER kind=Select/
Table tableName=CCP_USER typeName=User
Column columnName=USER_ID primaryKey=true/
Column columnName=PASSWORD/
Column columnName=NAME/
Column columnName=AVAILABLE/
/Table
/Config

/***following code can add a new record to database
successfully, 'User' class is static DataObject generated by
XSD2JavaGenerator,  ***/

User user=(User)LibraryFactory.INSTANCE.createUser();
user.setUSER_ID(sdo518);
user.setPASSWORD(8);
user.setNAME(wo);
user.setAVAILABLE(1);
Connection conn=dataSource.getConnection();
conn.setAutoCommit(false);
DAS das=DAS.FACTORY.createDAS(new
ClassPathResource(schemaConfig).getInputStream(),conn);
Command command=das.createCommand(select * from dual);
DataObject root=command.executeQuery();
root.getList(1).add(object);
das.applyChanges(root);

Quesion:  Must I exeucte a query sql first if I want to add a new record
to
database?  any other way to avoid this?
/* following code can fetch record from database
successfully**/

Connection conn=dataSource.getConnection();
conn.setAutoCommit(false);
DAS das=DAS.FACTORY.createDAS(new
ClassPathResource(schemaConfig).getInputStream(),conn);
Command command=das.getCommand(commandName);
if(param!=null) command.setParameter(1,param);
DataObject obj=command.executeQuery();
 List users=root.getList(1);
  for(int i=0;iusers.size();i++){
   DataObject obj=(DataObject)users.get(i);
   System.out.println(obj.get(USER_ID));

  }

Qestion:  if i change  List users=root.getList(1) to  List users=
root.getList(User);  there is not record in the 'users' list,
why?
   furthermore, how can I make it return User dataObject, so I
can use user.getUSER_ID() to get the property's value?

Appreciate your help in advance.