Example #1
0
 public HiveRelationCacheKey(RepositoryTypes repositoryType, HiveId entityId, Direction direction, RelationType relationType)
 {
     RepositoryType = repositoryType;
     EntityId       = entityId;
     Direction      = direction;
     RelationType   = relationType;
 }
 public HiveRelationCacheKey(RepositoryTypes repositoryType, HiveId entityId, Direction direction, RelationType relationType)
 {
     RepositoryType = repositoryType;
     EntityId = entityId;
     Direction = direction;
     RelationType = relationType;
 }
Example #3
0
    public static IRepositoryComputers GetComputers(RepositoryTypes repositoryType)
    {
        if (repositoryType.Equals(RepositoryTypes.SQL))
        {
            return(new RepositoryComputersSQL());
        }

        return(new RepositoryComputersXML());
    }
Example #4
0
 /// <summary>
 /// Gets the repositories belonging to an Organization
 /// 
 /// /orgs/:org/repos
 /// </summary>
 /// <returns>The repositories belonging to an Organization</returns>
 async public Task<IEnumerable<Repository>> GetRepositories(string organization, RepositoryTypes? type = null)
 {
     var request = CreateRequest(string.Format("/orgs/{0}/repos", organization),
         new Dictionary<string, string>
             {
                 {"type", type.ToParameterValue()}
             });
     var response = await Complete<IEnumerable<Repository>>(request);
     return response.Result;
 }
Example #5
0
 /// <summary>
 /// Add a new repository to the <see cref="PluginLoader"/>.
 /// </summary>
 /// <param name="type">The type of the repository that has to be added.</param>
 /// <param name="settings">The data needed to initialize the repository.</param>
 public static void AddRepository(RepositoryTypes type, DataStore settings)
 {
     //check if a repository for the same path already exists
     if (!s_Repositories.Any(r => r.EqualsTo(settings)))
     {
         RepositoryBase newRepo = Activator.CreateInstance(type) as RepositoryBase;
         newRepo.Initialize(settings);
         newRepo.Inspect();
         s_Repositories.Add(newRepo);
     }
 }
        public void RegisterRepositoryType <R>() where R : IsRepository, new()
        {
            var repository = new R();

            foreach (var type in repository.GetTypes())
            {
                DataTypes.Add(type, typeof(R));
            }

            RepositoryTypes.Add(typeof(R));
        }
        public virtual void Configure(IWindsorContainer container)
        {
            Assembly assembly = Assembly.Load(assemblyName);

            container.Register(
                Component.For(serviceType)
                .Named(KEY_GENERIC)
                .ImplementedBy(defaultImplimentationType)
                );

            container.Register(
                RepositoryTypes.FromAssembly(assembly)
                .IsAppropriate(serviceType, @namespace, endsWith)
                );
        }
Example #8
0
        /// <summary>
        /// Creates a repository with the OS filesystem as the backend.
        /// </summary>
        /// <param name="repositoryName">The name of the desired new repository.</param>
        /// <returns>Whether or not this operation was successful.</returns>
        public bool CreateFSFSRepository(string repositoryName)
        {
            _createRepoType = RepositoryTypes.FileSystem;

            bool retval = CreateRepository(repositoryName);

            if (Equals(null, _repositoryConfiguration))
            {
                if (_repositoryConfiguration != null)
                {
                    _repositoryConfiguration.RepositoryType = "fsfs";
                }
            }

            return(retval);
        }
Example #9
0
        /// <summary>
        /// Creates a repository with a Berkeley database backend.
        /// </summary>
        /// <param name="repositoryName">The name of the desired new repository.</param>
        /// <returns>Whether or not this operation was successful.</returns>
        public bool CreateBerkeleyDbRepository(string repositoryName)
        {
            _createRepoType = RepositoryTypes.BerkeleyDatabase;

            bool retval = CreateRepository(repositoryName);

            if (Equals(null, _repositoryConfiguration))
            {
                if (_repositoryConfiguration != null)
                {
                    _repositoryConfiguration.RepositoryType = "bdb";
                }
            }

            return(retval);
        }
Example #10
0
 public void AddData(XElement xmlData, RepositoryTypes repositoryType)
 {
     switch (repositoryType)
     {
         case RepositoryTypes.Artists:
             AddArtists(xmlData);
             break;
         case RepositoryTypes.Albums:
             AddAlbums(xmlData);
             break;
         case RepositoryTypes.Tracks:
             AddTracks(xmlData);
             break;
         case RepositoryTypes.TopTags:
             AddTopTags(xmlData);
             break;
         default: break;
     }
 }
Example #11
0
 public GenericRepository <T> GetRepository <T>(RepositoryTypes type) where T : class
 {
     return(_repositories.ContainsKey(type) ? _repositories[type].CastAs <GenericRepository <T> >() : null);
 }
Example #12
0
        ///<remarks>
        ///   <name>BPDocumento.UploadFile</name>
        ///   <create>09-Septiembre-2014</create>
        ///   <author>Ruben.Cobos</author>
        ///</remarks>
        ///<summary>Sube un archivo al servidor, regresando la ruta en donde se guardó físicamente</summary>
        ///<param name="PostedFile">Archivo a subir</param>
        ///<param name="Seed">Semilla el directorio. ID de Expediente o Solicitud</param>
        ///<param name="RepositoryType">Tipo de repositorio (Expediente o Solicitud)</param>
        ///<returns>La ruta completa del directorio creado</returns>
        public String UploadFile( HttpPostedFile PostedFile,  String Seed, RepositoryTypes RepositoryType)
        {
            String Path;
            String FileName;

            try{

                // Nombre del archivo físico
                FileName = PostedFile.FileName;

                // Armar el path
                switch(RepositoryType){
                    case RepositoryTypes.Expediente:
                        Path = ConfigurationManager.AppSettings["Application.Repository"].ToString() + "E" + Seed + Convert.ToChar(92);
                        break;

                    case RepositoryTypes.Solicitud:
                        Path = ConfigurationManager.AppSettings["Application.Repository"].ToString() + "S" + Seed + Convert.ToChar(92);
                        break;

                    case RepositoryTypes.Recomendacion:
                        Path = ConfigurationManager.AppSettings["Application.Repository"].ToString() + "R" + Seed + Convert.ToChar(92);
                        break;

                    default:
                        throw( new Exception("Tipo de repositorio inválido"));
                }

                // Validar existencia de la ruta
                if (!Directory.Exists(Path)) { Directory.CreateDirectory(Path); }

                // Validar la existencia del archivo
                if (File.Exists(Path + FileName)) { throw( new Exception("Ya existe éste archivo asociado al expediente")); }

                // Cargar el archivo
                PostedFile.SaveAs(Path + FileName);

            }catch (IOException ioEx){

                throw(ioEx);

            } catch (Exception ex){

                throw(ex);

            }

            // Directorio con nombre de archivo
            return Path + FileName;
        }