Several questions migrating DA from java to cocoa

Did you lokk at the c:\Users\Public\Documents\RemObjects Samples\RemObjects SDK for Java folder?

“c:\Users\Public\Documents\RemObjects Samples\RemObjects SDK for Java\Oxygene\HTTP Chat\Program.pas”

F.e. the file c:\Users\Public\Documents\RemObjects Samples\RemObjects SDK for Java\Oxygene\Mega Demo\UserInterface.pas:

method DemoWindow.initDemoProxy;
begin
  var lProtocol: String := protocolBox.SelectedItem as String;
  var lHost: String := hostField.Text as String;
  var lPort: String := portSpinner.Text as String;
  var lMessageType: String := '/';
  if binaryRbtn.isSelected then
    lMessageType := '/bin';
  var lURI := new URI(lProtocol + '://' + lHost + ':' + lPort + lMessageType);
  MegaDemoService := new MegaDemoService_Proxy(lURI);
  if useCompession.isSelected then
    (MegaDemoService.ProxyMessage as BinMessage).UseCompression := true
  else
    (MegaDemoService.ProxyMessage as BinMessage).UseCompression := false;
  (MegaDemoService.ProxyClientChannel as HttpClientChannel).Timeout := 1000;
end;

Similar code in the MegaDemo Android sample:

var lURI := new URI("http://10.0.2.2:8099/bin");
fService := new MegaDemoService_Proxy(lURI);
(fService.ProxyMessage as BinMessage).UseCompression := true;
(fService.ProxyClientChannel as HttpClientChannel).Timeout := 1000;

Regards

No, sorry, i dont. I start in the bad path thinking syntaxis for RO and DA are the same on all platforms. I will check every sample for IOS now.

Best regards.

There is a good reason why the syntax differs:
The code you write is compiled directly into platform-native code, without a massive overhead of some runtime library that hides platform-specific stuff.
From one side, it requires you to write more code, from other it gives beter performance more native apps. Also it allows to use platform-specific tutorials to do the things needed (f.e. you want ot use https with self-signed certificate on Android and just found some code on StackOverflow. You can oxidize that code and it will work fo you in your app)

I have to disagree. That forces to wrote all the code two or tree times to do the same. In any case, as i talk with marc, will be better if you offer a common wrapper and let the use to decide if use native code or the common wrappers, and not force to write a lot of code. is a manintenance nigthmare, despite the aditional time to get it working.

Best regards.

As i explained before, DA/.NET and DA/Cocoa were written LONG before there was Elements support for Java and Cocoa. They were design dot fit in well with each respective platform because there WAS no way to share code anyways (Android apps would have been in Java, Cocoa apps in Objective-C).

We ARE looking into a better approach in the future, but for now, thats what it is.

Thank you marc, will be a better approach without any doubt.

Best regards.

Indeed, at least for Elements users.

Keep in mind hat while there’s (a lot) of overlap, not every DA user works in Elements. Many Cocoa users use ObjC and Apple Swift, and they are very happy having an API thats designed for Cocoa, rather than a common ground, the same is true for developers using, say, Android Studio wire DA/Java — they are happy DA has an APIn designed to fit in well with Java.

Im sure they are. I comes from Delphi and that brings too many mental problems, you know. :weary:

1 Like

don’t i know that :stuck_out_tongue_winking_eye:

@antonk, is me again. :weary:

I read your message and see your sample is java related. I dont have any problem with java, that part of the app is already working perfect.
My problem is with cocoa, elements and RO and DA. I check the cocoa RO folders and thers not samples. Zero.

Please, let me know how to calla service method using proxy on elements and cocoa (IOS).

I need simple sample on ELEMENT and IOS for:

  • Loading Briefcase in async mode (passing dynamicwhere options to the datasets fill method).
  • DynamicWhere (i guess will be cover if theres a sample for the previous code).
  • Inserting a record on a DA briefcased remote dataset.
  • Fill a picker with data from a DA briefcased remote dataset.
  • Response to the event of selecting a picker item.
  • Calling a method for a RO server using proxy (as explained at start)

I hope you can point me out to that samples for IOS.

Thanks.

That’s odd. Probably installer didn’t found the Elements for Cocoa installation and decided not to drop samples. They had to be deployed to the folder c:\Users\Public\Documents\RemObjects Samples\Data Abstract for Cocoa

Please drop a mail to support@ and I’ll send you the samples.

@antonk DA have samples , RO dont. The samples for DA dont cover the items i ask for.

Best regards.

You too might wanna check out the sample i linked to here

Thanks Marc, the sample cover the same another samples do.
Was very handy, but still no samples for the cases i ask for:

I need simple sample on ELEMENT and IOS for:

  1. Loading Briefcase in async mode (passing dynamicwhere options to the datasets fill method).
  2. DynamicWhere (i guess will be cover if theres a sample for the previous code).
  3. Inserting a record on a DA briefcased remote dataset.
  4. Fill a picker with data from a DA briefcased remote dataset.
  5. Response to the event of selecting a picker item.
  6. Calling a method for a RO server using proxy (as explained at start)

Android have samples for all that stuff. I try for a few weeks to traslate to Cocoa but have no luck. Im stoped here. I hope somebody using IOS and DA/RO cant help.

Best regards.

You’ll just fetch the data table as you normally would, then add int to the briefcase and save it.

The Sample should cover that (check the commented-out code), but i recommend using DA SQL instead.

no difference than non-briefcased.

really depend son what a “picker” is. at this point, you’re talking basic UIKit GUI, unrelated to DA. You’ll want to read upon Apple’s docs, eg for UIPickerView, ditto for the previous item — binding the data table to show in a picker.

the code generated for you when you do “Connect to Remoting SDK Server” should show that, in particular the ServerAccess file that gets generated. it exposes singleton properties for all of the pixies you may need. If you want to do it manually:

  var service := new RORemoteService withTargetURL(serverURL) serviceName("MyService");
  service.channel.delegate := self;
  var myService := MyService_AsyncProxy withService(service);
  myService.beginSomeMethodCall(params...) startWithBlock( (aRequest) -> begin
    var result := myService.endSomeMethodCall(aRequest);
    // work with result
  end);

for an async call. The ServerAccess wraps the first half of that so you can just go

  ServerAccess.MyService.beginMyCal( ....

I get that message:

DASQL execution is not supported yet!

Is a delphi server. Is only supported for .net servers?

Yes, DA SQL is only supported against .NET Servers and Relativity Server.

Just to know, theres any plan to add suport to other servers?

I have this call and works fine.

DataAdapter.getDataTable(nme_locaciones) &select(aFieldList) &where(whereClause);

But can get how to assign this to a DADataTable.

Best regards.

Aside from .NET and Delphi? no, not at this time. .NET really covers all relevant server platforms, as it an be deployed on Windows, Linux and Mac.