sqoop.framework.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // Licensed to Cloudera, Inc. under one
  2. // or more contributor license agreements. See the NOTICE file
  3. // distributed with this work for additional information
  4. // regarding copyright ownership. Cloudera, Inc. licenses this file
  5. // to you under the Apache License, Version 2.0 (the
  6. // "License"); you may not use this file except in compliance
  7. // with the License. You may obtain a copy of the License at
  8. //
  9. // http://www.apache.org/licenses/LICENSE-2.0
  10. //
  11. // Unless required by applicable law or agreed to in writing, software
  12. // distributed under the License is distributed on an "AS IS" BASIS,
  13. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. // See the License for the specific language governing permissions and
  15. // limitations under the License.
  16. var framework = (function($) {
  17. var FrameworkModel = koify.Model.extend({
  18. 'id': 1,
  19. 'job_forms': {
  20. 'IMPORT': [],
  21. 'EXPORT': []
  22. },
  23. 'con_forms': [],
  24. 'resources': {},
  25. 'initialize': function(attrs) {
  26. var self = this;
  27. var attrs = $.extend(true, attrs, {});
  28. attrs = transform_keys(attrs, {
  29. 'job-forms': 'job_forms',
  30. 'con-forms': 'con_forms'
  31. });
  32. attrs = transform_values(attrs, {
  33. 'con_forms': to_forms,
  34. 'job_forms': function(key, value) {
  35. transform_values(value, {
  36. 'IMPORT': to_forms,
  37. 'EXPORT': to_forms
  38. });
  39. return value;
  40. }
  41. });
  42. return attrs;
  43. }
  44. });
  45. var Framework = koify.Node.extend({
  46. 'identifier': 'framework',
  47. 'persists': false,
  48. 'modelClass': FrameworkModel,
  49. 'base_url': '/sqoop/api/framework/',
  50. 'initialize': function() {
  51. var self = this;
  52. self.parent.initialize.apply(self, arguments);
  53. }
  54. });
  55. return {
  56. 'FrameworkModel': FrameworkModel,
  57. 'Framework': Framework
  58. }
  59. })($);