add onboarding of ui vendor files

Change-Id: Ia1989b7ff66102503e17e3f9a8f1b9236394fa7b
diff --git a/xos/core/models/service.py b/xos/core/models/service.py
index a6ee7a8..ff3287e 100644
--- a/xos/core/models/service.py
+++ b/xos/core/models/service.py
@@ -161,13 +161,15 @@
                     ('tosca_custom_types', 'Tosca Custom Types'),
                     ('tosca_resource', 'Tosca Resource'),
                     ('private_key', 'Private Key'),
-                    ('public_key', 'Public Key'))
+                    ('public_key', 'Public Key'),
+                    ('vendor_js', 'Vendor Javascript'))
 
     FORMAT_CHOICES = (('python', 'Python'),
                       ('manifest', 'Manifest'),
                       ('docker', 'Docker Container'),
                       ('yaml', 'YAML'),
-                      ('raw', 'raw'))
+                      ('raw', 'raw'),
+                      ('javascript', 'Javascript'))
 
     loadable_module = models.ForeignKey(LoadableModule, related_name='loadable_module_resources',
                                 help_text="The Loadable Module this resource is associated with")
diff --git a/xos/synchronizers/onboarding/xosbuilder.py b/xos/synchronizers/onboarding/xosbuilder.py
index 9793b02..38e2def 100644
--- a/xos/synchronizers/onboarding/xosbuilder.py
+++ b/xos/synchronizers/onboarding/xosbuilder.py
@@ -20,7 +20,7 @@
        list.append(item)
 
 class XOSBuilder(object):
-    UI_KINDS=["models", "admin", "admin_template", "django_library", "rest_service", "rest_tenant", "tosca_custom_types", "tosca_resource","public_key"]
+    UI_KINDS=["models", "admin", "admin_template", "django_library", "rest_service", "rest_tenant", "tosca_custom_types", "tosca_resource","public_key","vendor_js"]
     SYNC_CONTROLLER_KINDS=["synchronizer", "private_key", "public_key"]
     SYNC_ALLCONTROLLER_KINDS=["models", "django_library"]
 
@@ -44,7 +44,8 @@
                      "rest_service": "%s/api/service/" % (xos_base),
                      "rest_tenant": "%s/api/tenant/" % (xos_base),
                      "private_key": "%s/services/%s/keys/" % (xos_base, service_name),
-                     "public_key": "%s/services/%s/keys/" % (xos_base, service_name)}
+                     "public_key": "%s/services/%s/keys/" % (xos_base, service_name),
+                     "vendor_js": "%s/core/xoslib/static/vendor/" % (xos_base)}
         dest_dir = base_dirs[scr.kind]
 
         return dest_dir
diff --git a/xos/tosca/custom_types/xos.m4 b/xos/tosca/custom_types/xos.m4
index c60901e..cafc3cb 100644
--- a/xos/tosca/custom_types/xos.m4
+++ b/xos/tosca/custom_types/xos.m4
@@ -144,6 +144,10 @@
                 type: string
                 required: false
                 description: public key
+            vendor_js:
+                type: string
+                required: false
+                description: third-party javascript files
 
     tosca.nodes.ServiceControllerResource:
         derived_from: tosca.nodes.Root
@@ -226,6 +230,10 @@
                 type: string
                 required: false
                 description: public key
+            vendor_js:
+                type: string
+                required: false
+                description: third-party javascript files
 
     tosca.nodes.Tenant:
         derived_from: tosca.nodes.Root
diff --git a/xos/tosca/custom_types/xos.yaml b/xos/tosca/custom_types/xos.yaml
index ede5dd9..8c9e15b 100644
--- a/xos/tosca/custom_types/xos.yaml
+++ b/xos/tosca/custom_types/xos.yaml
@@ -252,6 +252,10 @@
                 type: string
                 required: false
                 description: public key
+            vendor_js:
+                type: string
+                required: false
+                description: third-party javascript files
 
     tosca.nodes.ServiceControllerResource:
         derived_from: tosca.nodes.Root
@@ -364,6 +368,10 @@
                 type: string
                 required: false
                 description: public key
+            vendor_js:
+                type: string
+                required: false
+                description: third-party javascript files
 
     tosca.nodes.Tenant:
         derived_from: tosca.nodes.Root
diff --git a/xos/tosca/resources/loadablemodule.py b/xos/tosca/resources/loadablemodule.py
index 92e3ebb..ad1147e 100644
--- a/xos/tosca/resources/loadablemodule.py
+++ b/xos/tosca/resources/loadablemodule.py
@@ -56,6 +56,7 @@
         self.postprocess_resource_prop(obj, "public_key", "raw")
         self.postprocess_resource_prop(obj, "rest_service", "python")
         self.postprocess_resource_prop(obj, "rest_tenant", "python")
+        self.postprocess_resource_prop(obj, "vendor_js", "javascript")
 
     def save_created_obj(self, xos_obj):
         if xos_obj.requires and xos_obj.requires.strip():