Generic method for adding a repository.

def add_repository(self, name, repository_type, repository_class,
                       aggregate_class, make_default, configuration):
        """
        Generic method for adding a repository.
        """
        repo_mgr = self.get_registered_utility(IRepositoryManager)
        if name is None:
            # If no name was given, this is assumed to be the ROOT repository
            # for the given repository type.
            name = REPOSITORY_DOMAINS.ROOT
        repo = repo_mgr.new(repository_type, name=name,
                            make_default=make_default,
                            repository_class=repository_class,
                            aggregate_class=aggregate_class,
                            configuration=configuration)
        repo_mgr.set(repo)