Copy over configuration needed for gadgets.
Make changes to copied-over configuration.

* Remove references of OAuth which is not moved yet.
* Change RAILS_ENV to Rails.env for Rails 4.
More one-time config needed for gadgets.
Fix the Gemfile. Enable gadgets gem.
Fix routes for gadgets.

* Remove temporary routes.
* Remove 'catch all' route which was overriding the engine's routes
  which were added later by Rails (meaning, after the 'catch all').
* Fix resources route in gadgets. It is now more similar to its original form.
Set site URLs properly.

They need to be set on to the current thread so that they can be used by the gadgets gem.
Fix 'SSL not configured' error view.

* This is used in the most bizzare way, in plugin_ssl_helper.rb
Fix view: List and add new gadget client view form.
Fix validations.
Make delete provider work.

* The issue mentioned here was affecting it:
  http://martinciu.com/2011/07/difference-between-class_inheritable_attribute-and-class_attribute.html
Fix 'Card Activity' page.

* Streaming in Rails 4 is no longer done using: render :text => proc {}
  It is done using response_body or using Live streaming (response.stream).

* Had to change makeRequest call to be a POST.

* Had to use java_stream_to_string instead of copy_java_stream_to_io. Not
  ideal, since it will not work well for binary data. In this case, it
  is alright.
Use admin layout for OAutH provider pages.
Merge remote-tracking branch 'origin/master' into gadgets
Move catch_all route from routes.rb to application.rb.

* Otherwise, the catch_all route will show up before the gadget routes.
  So, none of the gadget routes work.
Fixing failing rspec because of oauth2_provider engine

Because of the inclusion of oauth2_provider engine, all navigation routes had to be prepended with either 'main_app' or 'oauth_engine'. This caused few specs to fail because of the way urls were stubbed before. Changed it by including a EngineUrlHelper which stubs all header links and oauth2_provider links.
Fixing ApplicationHelper spec with proper routes stubbing on main_app
Fixing application_nav spec with correct ids because PIPELINES now use rails routes instead of the previous hardcoding of URL
Merge pull request #431 from sachinsudheendra/rspec-fix-after-oauth2-provider

Rspec fix after oauth2 provider merge into master
Merge pull request #398 from RikTyer/hib04

Move ArtifactPropertiesGenerator persistence to Hibernate.
Merge remote-tracking branch 'origin/master' into gadgets

Conflicts:
	server/webapp/WEB-INF/rails.new/Gemfile
	server/webapp/WEB-INF/rails.new/Gemfile.lock
	server/webapp/WEB-INF/rails.new/config/application.rb
	server/webapp/WEB-INF/rails.new/vendor/bundle/bundler/setup.rb
	server/webapp/WEB-INF/rails.new/vendor/engines/gadgets/config/routes.rb