protected override PluginCommandResponseMessage ExecuteOperation(PackageCommandArg commandArg)
        {
            var config = _libraryRepositoryConfigStorage.GetConfigs().FirstOrDefault(c => c.Name == commandArg.RepositoryName);

            if (config == null)
            {
                return(new PluginCommandResponseMessage
                {
                    PluginCommandStatus = PluginCommandStatus.Error,
                    ResponseData = "Unknown repository {0}".Fmt(commandArg.RepositoryName)
                });
            }

            ILibraryRepository           repository = _libraryRepositoryFactory.GetRepository(config);
            Mashup                       mashup     = repository.GetPackageMashup(commandArg.PackageName);
            PluginProfileErrorCollection errors     = _mashupInfoRepository.Add(mashup, true);

            return(errors.Empty()
                                       ? new PluginCommandResponseMessage {
                PluginCommandStatus = PluginCommandStatus.Succeed
            }
                                       : new PluginCommandResponseMessage
            {
                PluginCommandStatus = PluginCommandStatus.Error,
                ResponseData = errors.Aggregate("", (acc, e) => acc + e.Message + "\r\n")
            });
        }
Пример #2
0
 public virtual void Refresh()
 {
     _configStorage.GetConfigs().ForEach(config => _libraryRepositoryFactory.GetRepository(config).Refresh());
 }