Example #1
0
 def create(self, user):
     create_workspace(user,
                      mashup="CoNWeT/bae-marketplace/0.1.1",
                      new_name=self._options['name'],
                      preferences={'server_url': self._options['url']},
                      searchable=False,
                      public=self._options['public'])
Example #2
0
 def create(self, user):
     create_workspace(
         user,
         mashup="CoNWeT/bae-marketplace/0.1.1",
         new_name=self._options['name'],
         preferences={'server_url': self._options['url']},
         searchable=False,
         public=self._options['public']
     )
Example #3
0
        def wrapper(self, *args, **kwargs):

            owner_user = User.objects.get(username=owner)

            if shared:
                base = self.shared_test_data_dir
            else:
                base = self.test_data_dir

            with open(os.path.join(base, file_name), 'rb') as f:
                create_workspace(owner_user, f)

            return test_func(self, *args, **kwargs)
Example #4
0
        def wrapper(self, *args, **kwargs):

            owner_user = User.objects.get(username=owner)

            if shared:
                base = self.shared_test_data_dir
            else:
                base = self.test_data_dir

            with open(os.path.join(base, file_name), 'rb') as f:
                create_workspace(owner_user, f)

            return test_func(self, *args, **kwargs)
Example #5
0
    def populate(self, wirecloud_user, log):
        updated = False

        updated |= self.populate_component(wirecloud_user, log, "WireCloud",
                                           "workspace-browser", "0.1.3",
                                           WORKSPACE_BROWSER_FILE)

        if not Workspace.objects.filter(creator__username="******",
                                        name="home").exists():
            updated = True
            log('Creating a initial version of the wirecloud/home workspace... ',
                1,
                ending='')
            with open(INITIAL_HOME_DASHBOARD_FILE, 'rb') as f:
                create_workspace(wirecloud_user,
                                 f,
                                 public=True,
                                 searchable=False)
            log('DONE', 1)

        updated |= self.populate_component(wirecloud_user, log, "CoNWeT",
                                           "markdown-viewer", "0.1.1",
                                           MARKDOWN_VIEWER_FILE)
        updated |= self.populate_component(wirecloud_user, log, "CoNWeT",
                                           "markdown-editor", "0.1.0",
                                           MARKDOWN_EDITOR_FILE)

        if not Workspace.objects.filter(creator__username="******",
                                        name="landing").exists():
            updated = True
            log('Creating a initial version of the wirecloud/landing workspace... ',
                1,
                ending='')
            with open(LANDING_DASHBOARD_FILE, 'rb') as f:
                create_workspace(wirecloud_user,
                                 f,
                                 public=True,
                                 searchable=False)
            log('DONE', 1)

        return updated
Example #6
0
    def _handle(self, *args, **options):
        if len(args) > 0:
            raise CommandError(_('Wrong number of arguments'))

        self.verbosity = int(options.get('verbosity', 1))

        with atomic():
            wirecloud_user, created = User.objects.get_or_create(username='******', defaults={'password': '******'})

            if not Workspace.objects.filter(creator__username="******", name="home").exists():
                with open(INITIAL_HOME_DASHBOARD_FILE, 'rb') as f:
                    workspace = create_workspace(wirecloud_user, f)
                    workspace.public = True
                    workspace.save()
Example #7
0
    def _handle(self, *args, **options):

        updated = False
        self.verbosity = int(options.get('verbosity', 1))

        with atomic():
            wirecloud_user, created = User.objects.get_or_create(
                username='******', defaults={'password': '******'})
            if created:
                updated = True
                self.log('Creating a wirecloud user... DONE', 1)

            if not CatalogueResource.objects.filter(
                    vendor="WireCloud",
                    short_name="workspace-browser",
                    version="0.1.1").exists():
                updated = True
                self.log('Installing the workspace-browser widget... ',
                         1,
                         ending='')
                install_resource_to_user(
                    wirecloud_user, file_contents=WgtFile(WORKSPACE_BROWSER))
                self.log('DONE', 1)

            if not Workspace.objects.filter(creator__username="******",
                                            name="home").exists():
                updated = True
                self.log(
                    'Creating a initial version of the wirecloud/home workspace... ',
                    1,
                    ending='')
                with open(INITIAL_HOME_DASHBOARD_FILE, 'rb') as f:
                    workspace = create_workspace(wirecloud_user, f)
                    workspace.public = True
                    workspace.save()
                self.log('DONE', 1)

        if not updated:
            self.log('Already up-to-date.', 1)