Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            var token = GroupShareClient.GetRequestToken(
                "",
                "",
                new Uri("http://gs2017dev.sdl.com"),
                GroupShareClient.AllScopes).Result;

            var groupShareClient = GroupShareClient.AuthenticateClient(
                token,
                "",
                "",
                new Uri("http://gs2017dev.sdl.com"),
                GroupShareClient.AllScopes).Result;

            for (var i = 0; i < 200; i++)
            {
                var organization = new Organization
                {
                    UniqueId             = Guid.NewGuid(),
                    Name                 = $"NewCreatedOrg{i}",
                    IsLibrary            = true,
                    Description          = null,
                    Path                 = null,
                    ParentOrganizationId = new Guid("5bdb10b8-e3a9-41ae-9e66-c154347b8d17"),
                    ChildOrganizations   = null,
                    Tags                 = new List <string> {
                        "tagTest"
                    }
                };

                var organizationId = groupShareClient.Organization.Create(organization).Result;
                groupShareClient.Organization.DeleteOrganization(organizationId);
            }
        }
Ejemplo n.º 2
0
        public async Task <GroupShareClient> Login(string userName, string password, string uri)
        {
            var client = await GroupShareClient.AuthenticateClient(userName,
                                                                   password,
                                                                   new Uri(uri),
                                                                   GroupShareClient.AllScopes);

            return(client);
        }
Ejemplo n.º 3
0
        public async Task <ServerBasedTranslationMemoryGSKit> InitializeAsync(string userName, string password, string uri)
        {
            var token = await GroupShareClient.GetRequestToken(userName, password, new Uri(uri), GroupShareClient.AllScopes);

            var groupShareClient = await GroupShareClient.AuthenticateClient(token, userName, password, new Uri(uri),
                                                                             GroupShareClient.AllScopes);

            var tmClient = await groupShareClient.TranslationMemories.GetTms();

            this.GroupShareClient     = groupShareClient;
            this.ServerBasedTMDetails = new BindingList <TranslationMemoryDetails> (tmClient.Items);
            return(this);
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            var token = GroupShareClient.GetRequestToken(
                "username",
                "pass",
                new Uri("url"),
                GroupShareClient.AllScopes).Result;

            var gsClient = GroupShareClient.AuthenticateClient(
                token,
                "username",
                "pass",
                new Uri("url"),
                GroupShareClient.AllScopes).Result;
            var termbases = gsClient.Terminology.GetTermbaseById("GermanCharacters").Result;
        }
Ejemplo n.º 5
0
        public static async Task <IGroupShareClient> GetGroupShareClient()
        {
            var groupShareUser     = Helper.GetVariable("GROUPSHAREKIT_USERNAME");
            var groupSharePassword = Helper.GetVariable("GROUPSHAREKIT_PASSWORD");

            var token =
                await
                GroupShareClient.GetRequestToken(groupShareUser, groupSharePassword, BaseUri,
                                                 GroupShareClient.AllScopes);

            var gsClient =
                await
                GroupShareClient.AuthenticateClient(token, groupShareUser, groupSharePassword, BaseUri,
                                                    GroupShareClient.AllScopes);

            return(gsClient);
        }
Ejemplo n.º 6
0
        static void Main(string[] args)
        {
            var token = GroupShareClient.GetRequestToken(
                "",
                "",
                new Uri("http://gs2017dev.sdl.com"),
                GroupShareClient.AllScopes).Result;

            var gsClient = GroupShareClient.AuthenticateClient(
                token,
                "",
                "",
                new Uri("http://gs2017dev.sdl.com"),
                GroupShareClient.AllScopes).Result;
            var contepts = gsClient.Terminology.GetConcept(new ConceptResponse("GermanCharacters", "1")).Result;
            //var projectRequest = new ProjectsRequest("/Test API",true, 1) { Filter = { ProjectName = "a" } };
            //var result =  gsClient.Project.GetProject(projectRequest).Result;
        }
Ejemplo n.º 7
0
        static Helper()
        {
            var token = GroupShareClient.GetRequestToken(
                GsUser,
                GsPassword,
                BaseUri,
                GroupShareClient.AllScopes).Result;

            GsClient = GroupShareClient.AuthenticateClient(
                token,
                GsUser,
                GsPassword,
                "",
                BaseUri,
                GroupShareClient.AllScopes).Result;

            GsUserId = GsClient.User.Get(new UserRequest(GsUser)).Result.UniqueId;

            var sanitizedOrganizationName = Organization.Trim('/');
            var organization = GsClient
                               .Organization
                               .GetAll(new OrganizationRequest(true)).Result
                               .FirstOrDefault(o => o.Name == sanitizedOrganizationName);

            if (organization != null)
            {
                OrganizationId  = organization.UniqueId.ToString();
                OrganizationTag = organization.Tags.FirstOrDefault();
            }

            var role = GsClient
                       .Role
                       .GetAllRoles().Result
                       .FirstOrDefault(r => r.Name == "Power User");

            if (role != null)
            {
                PowerUserRoleId = role.UniqueId.ToString();
            }
        }