Exemplo n.º 1
0
Arquivo: Cmis.cs Projeto: vfh/CmisSync
        public Cmis(string path, SparkleConfig config)
        {
            databaseFilename = path + ".s3db";

            // Set local root folder.
            //string localPath = config.GetFolderOptionalAttribute(Path.GetFileName(path), "name");
            localRootFolder = path; //Path.Combine(SparkleFolder.ROOT_FOLDER, localPath);

            // Get path on remote repository.
            remoteFolderPath = config.GetFolderOptionalAttribute(Path.GetFileName(path), "remoteFolder");

            cmisParameters = new Dictionary<string, string>();
            cmisParameters[SessionParameter.BindingType] = BindingType.AtomPub;
            cmisParameters[SessionParameter.AtomPubUrl] = config.GetUrlForFolder(Path.GetFileName(path));
            cmisParameters[SessionParameter.User] = config.GetFolderOptionalAttribute(Path.GetFileName(path), "user");
            cmisParameters[SessionParameter.Password] = config.GetFolderOptionalAttribute(Path.GetFileName(path), "password");
            cmisParameters[SessionParameter.RepositoryId] = config.GetFolderOptionalAttribute(Path.GetFileName(path), "repository");

            syncing = false;
        }
Exemplo n.º 2
0
        /**
         * Constructor for SparkleRepo (at every launch of CmisSync)
         */
        public CmisDirectory(string localPath, SparkleConfig config,
            ActivityListener activityListener)
        {
            this.activityListener = activityListener;

            // Set local root folder.
            this.localRootFolder = Path.Combine(SparkleFolder.ROOT_FOLDER, localPath);

            database = new CmisDatabase(localRootFolder);

            // Get path on remote repository.
            remoteFolderPath = config.GetFolderOptionalAttribute(Path.GetFileName(localRootFolder), "remoteFolder");

            cmisParameters = new Dictionary<string, string>();
            cmisParameters[SessionParameter.BindingType] = BindingType.AtomPub;
            cmisParameters[SessionParameter.AtomPubUrl] = config.GetUrlForFolder(Path.GetFileName(localRootFolder));
            cmisParameters[SessionParameter.User] = config.GetFolderOptionalAttribute(Path.GetFileName(localRootFolder), "user");
            cmisParameters[SessionParameter.Password] = config.GetFolderOptionalAttribute(Path.GetFileName(localRootFolder), "password");
            cmisParameters[SessionParameter.RepositoryId] = config.GetFolderOptionalAttribute(Path.GetFileName(localRootFolder), "repository");

            syncing = false;
        }