Git Product home page Git Product logo

dojoenterpriseapp's Introduction

DojoEnterpriseApp

===================

DojoEnterpriseApp is an abstracted application framework for large web applications that use the [Dojo toolkit] (www.dojotoolkit.org).

The project was inspired by dojoBoilerplate from Rebecca Murphey. Thanks must also go to Craig Barker for putting the first version through its paces, and the guys at Sitepen for their additions of awesomeness.

Please see the wiki for more details on what the scripts and JavaScript objects do.

The main features are:

All kinds of other people's awesome

  • self bootstrapping - pulls in dependencies via setup script (uses wget or curl)
  • pulls in less.js and wire.js
  • depends on node.js (for running less.js), npm and Java (for the dojo build)

Extensible scripts

  • scripts to pull in framework dependencies
  • scripts to create an 'application' (single page web app)
  • scripts to create templated and non-templated widgets (including test pages, less files..)
  • scripts to test widgets in a variety of browsers (chrome, FireFox, Safari and Chromium)
  • scripts to create a compressed, minified build using the dojo builder

JavaScript code to provide an abstracted control layer with:

  • abstracted communications protocols so that 'real' servers can be mocked during unit tests.
  • abstracted server calls (REST and WebServices) to introduce clean separation of concerns so that code is not littered with Urls and thus easier to refactor.
  • provides a central location to perform work on all server calls (such as applying security policies, auditing, url resolution etc).

JavaScript code to provide useful unit testing abilities:

  • mock xhr requests
  • mock server endpoints or 'services'
  • mock dojo data stores

Common set of application widgets:

  • _Widget base class that provides life-cycle management based on Phil Higgins's solution to memory leaks with custom dojo widgets that programatically create widgets.
  • a full-page container widget (with plugins for common 'enterprise' features such as session management - coming soon).

dojoenterpriseapp's People

Contributors

andyle2010 avatar bryanforbes avatar danmcdaid avatar rishson avatar sitependavidwalsh avatar thomsonreuters-accelus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

dojoenterpriseapp's Issues

Handling of HTTP Status Codes

On the rest backend we would like to use the standard Java JSR311 Response Object to deal with the appropriate HTTP status codes to deal with known error conditions e.g. duplicate client created.

For example:

try {
   delegate.doSomething(somethingId);
} catch (IndexException e) {
   Response.ResponseBuilder builder =
   Response.status(Response.Status.CONFLICT);
   builder.type("application/json");
   builder.entity("<error>Could not do something, something already exists</error>");
   throw new WebApplicationException(e, builder.build());
}

This means that the enterprise framework needs to be sensitive to the Status Code of the response message and before it publishes the message back to the topic adapts the Status Code to a set of flags which keeps the subscriber ignorant of the present of HTTP Codes but allows it to respond in an widget specific way depending on what the response was.

Initially the codes needed are:

  • 200 OK
  • 409 CONFLICT

1.7 complaince: redo dojo base refs

Where previously in 1.6 compliant code you would have example usage of dojo base like:

dojo.mixin(...)

this needs to be a reference to the param name of the discreet dojo module that is now used:

dojo.lang.mixin

_Widget TOPIC_NAMESPACE should use this.declaredClass

Currently, you have to create the full path of a topic in a widget.
_Widget should do:

this.TOPIC_NAMESPACE = this.declaredClass - but with . replaces with / and a leading /

Then _Widget could have an addTopic method

this.addTopic(someTopic);

would create an addition to this.pubList in the form [this.TOPIC_NAMESPACE][someTopic]

pubList population is clunky

Should we combine the population of a pubList or subList with the dojo.subscribe?
Currently we do:

this.subList.NEW_TOPIC = '/some/topic/name';
dojo.subscribe(this.subList.NEW_TOPIC, this, this._handleResponseFromSomeNewTopic);

Maybe we do:

var newTopic = {topic: '/some/new/topic', handler: this._handleResponseFromSomeNewTopic, scope: this};
this.subList.NEW_TOPIC = newTopic;

Then in _Widget, we can iterate over the pub and sub lists and create the dojo.subscribes).

support of other HTTP Verbs

At present the framwork only seems to support xhrPost. In order to fullly utilize a rest application backend we need to be able to get, put and delete resources.

setup.sh should be callable from anywhere

Change setup.sh to be passed project path of an existing project that you want to pull in resources for.
This way, people can install dojoEnterpriseApp and use the scripts to create an application and then run setup.sh to pull in the deps for the new application. This would mean that we would offer and option to copy the scripts around to created projects as one centralised copy has its advantages - but versioning might require separate scripts as well.

_ApplicationWidget mixin

It would be useful to have an mixin specifically at the Application widget level.

This would provide specific functionality to alllow an application widget to autowire itself as a subscriber to any topics that are declared as publish topics from any of it's 'child' widgets.

There may be some constraints around declaritive introduction of child widgets that this mixin needs to be able to accomodate, furthermore manual registration to topics should still be possible for adhoc wiring.

Update the create scripts

When you have created an application or widget using the scripts, these can be added to SCC.
However, if you pull a widget or app from SCC, then you need to install around the widget, all the dependencies pulled in by setup.sh.

Enhance LoginResponse to include WebSocket

Add websocket flag to app json in LoginResoponse. By convention, the client should listen on the root of the baseUrl for an application:

{baseUrl: '/someContext/foo/bar', websocket: true}

means that a websocket listener will be created for '/someContext/foo/bar' for the application.
Anything routed to this URL will be broadcast on the topic {application.id/push}.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.