receiving complex objects from server in ExtJS - extjs

I saw that ExtGWT has RPC which transfers objects between server and client easily. How can this be achieved in ExtJS? Is there any way to have js classes that get loaded automatically from server's response like ExtGWT does?
The server is Java-based and it uses Jersey REST-based framework.
Thanks.

I'm not familiar with Ext GWT, nor do I work with Java often, but I think you can modify your web service to send you JSON data that describes your objects (using a JSON Serializer).
On the client side, if you want to display your objects into a grid (for example), you can configure your Ext.data.Record to look into your object and pull out the information in a flat form that can be loaded into a store.

Related

Client-accessible noSql database?

Im building a simple angular application and there is a small administrator panel for updating the content (a .json document). I'm looking for a way to edit the json document from the administrator panel.
I can manipulate the memory-loaded json but I can't save it. Is there a way to put the json file in some kind of cloud database and connect to it without setting up a server or backend for my application?
I want my application to be easily deployable on any ftp so I can't setup a nodeserver or install something like couchdb.
Any ideas are appreciated.
You could use a provider like Parse. It's free (up to a limit of requests/month), has a nice JavaScript SDK that would get you up and running quickly. https://parse.com/
Also, check out this query builder to aid in retrieving your data from Parse. It's built as an Angular service for easy integration. https://github.com/dpollot/parse-query
EDIT
Parse also offers hosting, for free.

How to wire SailsJS to BreezeJS

I'm looking at using Sailsjs for server side processing and validation and angular on the client side. Apparently BreezeJS supports Odata and WebApi for its interaction with the datasource. I know that Sails provides a REST Api out of the box.
How would I go about setting up Sails to provide either OData or WebApi to connectivity for Breeze?
Also, is there any other well known way of connecting Sails to Angular that provides the ability to generate queries on the client side that then get executed on the server? (My use case is filtering large datasets and manipulating the result on the client before batch updating the datasource)
Thanks!
What database and/or ORM are you using? That affects the answer, because the OData query must be turned into the appropriate query for your ORM/database. One of the following might work for you:
The breeze.server.node repo includes an OData parser that turns OData URLs into expression trees. Then there are adapters that turn these expression trees into MongoDB queries or Sequelize queries. If you are using MongoDB or Sequelize, this might be what you need. You can write your own adapter for Waterline if none exists yet.
The breeze.js.labs repo includes breeze.ajaxrestinterceptor.js which converts Breeze's OData URLs into REST-style resource URLs. It only supports a subset of the possible URLs, and will need to be adapted to your own API conventions.
An upcoming Breeze release will offer an alternative to OData: an all-JSON query language, inspired by the MongoDB and Sequelize query languages. This will make it easier to write your own backend, and to support Sails/Waterline in the future.

backbone.js and the need of a back-end engine

reading this days about backbone.js (documentation, examples, etc), and as far as i have understood, this framework lets you code directly on the front-end, almost all the back-end engine, since you can structure a MVC architecture. You can create your data model, controllers, etc.
My question is: if you already have the MVC architecture built on the Front-End (engine), you just need a DataBase (SQL) in the cloud from where you can fetch or store data, why do you need a back-end engine (RoR3,Java,etc) to persist document data?
thanks in advance
You are confusing two different meanings of front end, the model in the backbone framework is not able to connect to a database directly, this model are designed to connect to an API (that would be your backend) that is connected to a database
Things you still need to do on the server:
authentication
authorization
data sanitation and filtering
Possiby
interact to third parties
business logic that involves modules other than UI
etc.
Front-End MVC frameworks (Backbone, Angular, etc) all rely on a backend service to provide the data that, say Backbone, would then use as its model.
You could have an entire MVC pattern on the backend that accepts requests and spits out some JSON for a frontend MVC framework to use.
If you just want a database without creating a server, I would recommend using Google FusionTables - but you need OAuth and maybe even ClientLogin (depending) on top of that.
Because as far as I know Backbone works with RESTful services and it needs a server to handle the requests:
get: to list data from the db
post: to add new stuff to the db
put: to update current data
delete: to remove data from the db.
.. and also perform all sorts of server related stuff if you like
For instance I'm using Restful server based on Code Igniter to handle that stuff. From there you can choose the DB you want to work with. I already tried using MySQL and MongoDB

Silverlight: discover and invoke webservice dynamically

I have a Silverlight application and I would need to be able to get data from practically any webservice. I'd like to provide the functionality for the user to specify an URL of a webservice during runtime, then my app would discover the service and offer some UI to select the webmethod and fill the necessary parameters. Then the user could call the webservice and the app would display the data on the UI.
How can I achieve this?
I assume you mean a SOAP web service? There are many components in .NET that you would normally want to use for this (e.g. WCF's metadata download and client proxy generation functionality, based on CodeDOM, as well as various classes for dealing with WSDL and XSD schema). Unfortunately, these are not present in Silverlight. So, I can think of two approaches:
1) Manually implement a general-purpose SOAP client in Silverlight (i.e. manually implement metadata download, WSDL parsing, XSD parsing, etc) - this will be very difficult unless you can find some existing code for this that you can adapt to Silverlight (and even then it's probably still very difficult)
2) Do it through the server. The server will do all the difficult parts, and Silverlight will just display the UI. Still not an easy task, but possible; You can start by reverse-engineering how the WCF Test Client application works by using Reflector and go from there.

SharePoint 2010 Silverlight application server object model?

I am currently getting myself up to speed with SharePoint 2010 and I am working my way through the different way SharePoint can expose silverlight applications.
As I understand it, the client object model is more restricted, and is for other applications to interact with SharePoint via WCF for example. An example would be a custom build system that retrieves reference data from SharePoint lists.
The server object model provides more functionality in SharePoint. One example is code written for a web part.
I have been told to deploy a silverlight application, you create the xap, make it accessible by SharePoint web front end, create a silverlight web part and point to it.
So, my question is, assuming what I have previously mentioned is more-or-less the case, can SharePoint access the server object model or is it the same as an external system for example, and uses the client object model?
I am learning all of this so happy to receive feedback on anything I may have not understood correctly.
You would access the client object model from Silverlight. Silverlight is a client. It runs in the user's browser, so it is not on the server, and therefore cannot access the server's features except via service calls. The client object model will provide you direct integration with various lists and functions, and makes it very easy to integrate.
Check out this video for more:
http://channel9.msdn.com/learn/courses/SharePoint2010Developer/ClientObjectModel/SilverlightClientObjectModel/

Resources