Breezejs SocketIO and jsonResultsAdapter - breeze

I have a REST backend without OData and with SocketIO. Breeze datacontext is configured with a jsonResultsAdapter to create the Entities. When I start my app I call
DataContext.manager.executeQuery(query) and every thing is working as expected... Subsequently the additional data is being pushed to the app by SocketIO. How do I pass the data to Breeze so that the 'visitNode' method in the jsonResultsAdapter is called for all the nodes of the pushed json feed?

Related

Using BreezeJS for internal and external API

I need some advice on how to proceed with this design please:
I use BreezeJS internally on top of my Entity Framework Web API. So
all my data retrievals and saves are done in the Breeze style.
I now need to expose an API for external consumption which has a subset of
the calls I use internally.
Ideally I would like to consume the same API internally.
I do not want to tell the consumers that they have to
use BreezeJS on their client-side to consume my API (I am using
Swagger on top of it)
So, for now I have a separate set of API calls for the External API which go through different validation code and have a structure like:
Get(item)
Get(items)
List item
Post(item)
etc.
My question is: Am I going down the wrong track? Should I either be using BreezeJS on the ExternalAPI or stop using Breeze internally and consume the External API, OR should I perhaps wrap the ExternalAPI methods around Breeze and restrict the saving of the entity graph to the entity type that is being queried at the time only?

Sending data from UI5 to ABAP without gateway?

I have been creating a basic OpenUI5 application, and aiming to implement SAP Gateway very soon.
I currently have a screen that populates an array with simple text-fields and a button. My aim is to send this array/table to a backend ABAP function module or class method. Can this be done? The table has the potential to be quite large.
You need to create a write capable oData service that accepts oData post requests from an UI5 application and writes data to a database table. During implementation of this oData service you may call any ABAP backend class methods of objects that you need to instantiate.
The most important point to realize is that the UI5 application is stateless. The application and all classes are instantiated for processing of the single request and die immediately after the request is processed.
I do not see any problem as long as you do not try to send gigabytes or hundreds of megabytes over the network.
Sending the data to a class method will not be possible as the ABAP methods of classes are not RFC enabled. For this purpose you can use only function modules.

How to use Wcf web service in MVC using C#

I have use wcf web service for data connectivity and all data related operation.
So, In my application, i need to integrate MVC controller pass or get model using the WCF webservice.
Please help how to pass model to WCF webservice from controller and How to get that Model or list of items into Controller ???
It is a bad idea to pass your actual controller to the WCF service. You don't want to couple your view tightly with the data contract of an external service.
Create a separate ViewModel that fulfills the needs of the view. Then implement code in the ViewModel to call the web service to update data and a static factory method on the ViewModel that creates a new ViewModel instance by retrieving data from the web service and populating a ViewModel instance.

Breeze.js audit log

We are using breeze.js on client side for data access layer over entity framework.
We need to maintain the audit log for all the data changes on server.
Can somebody please advise what could be the best way to do that?
The two options that occur to me are either
1) Server side triggers
2) Use the Breeze beforeSaveEntities mechanism to intercept the Breeze saveChanges call and add audit records directly in code on the server.

WCF Data services & EF4 CTP5, how to configure default eager loading schemas for queries?

Project:
Exposing via OData (Wcf Data services) an Entity Framework ObjectContext configured by code-first approach.
Everything works fine for simple queries and CUD operations.
However, I can't see how to configure default schema loading(server side).
IE: If my entity Customer has a collection of Addresses or a one on one relation to an Entity called Manager, how can I configure my ObjectContext so that every queries on Customers would load automatically all the addresses and the manager of the Customers Entities?
I know that on the client-side, the caller can use the query().Expand("path") to eager load data. But, I want to specify it on the server side so that all queries on Customers entities will result as it was the .Include("Addresses") or .Include("Manager") would be configured by default?
Any idea?
The only 'hack' we can think of is an HTTPModule that intercepts GET requests and adds some ?expand=XXX to the URL. This would be my last solution if we cannot find anything better...
Thanks for your help!
You could try using a query interceptor.
http://msdn.microsoft.com/en-us/library/dd744837.aspx

Resources