Examples of IFixedTranslationResources


Examples of org.zanata.rest.client.IFixedTranslationResources

    try
    {
      final ZanataDetails details = new ZanataDetails();
      final String URI = details.getUrl();

      final IFixedTranslationResources client = ProxyFactory.create(IFixedTranslationResources.class, URI);
      final ClientResponse<Resource> response = client.getResource(id);

      final Status status = Response.Status.fromStatusCode(response.getStatus());
     
      return status == Response.Status.OK;
View Full Code Here

Examples of org.zanata.rest.client.IFixedTranslationResources

    try
    {
      final ZanataDetails details = new ZanataDetails();
      final String URI = details.getUrl();

      final IFixedTranslationResources client = ProxyFactory.create(IFixedTranslationResources.class, URI);
      final ClientResponse<Resource> response = client.getResource(id);

      final Status status = Response.Status.fromStatusCode(response.getStatus());
     
      if (status == Response.Status.OK)
      {
View Full Code Here

Examples of org.zanata.rest.client.IFixedTranslationResources

    try
    {
      final ZanataDetails details = new ZanataDetails();
      final String URI = details.getUrl();

      final IFixedTranslationResources client = ProxyFactory.create(IFixedTranslationResources.class, URI);
      final ClientResponse<String> response = client.createResource(details.getUsername(), details.getToken(), resource);
     
      final Status status = Response.Status.fromStatusCode(response.getStatus());
     
      if (status == Response.Status.CREATED)
      {
View Full Code Here

Examples of org.zanata.rest.client.IFixedTranslationResources

    try
    {
      final ZanataDetails details = new ZanataDetails();
      final String URI = details.getUrl();

      final IFixedTranslationResources client = ProxyFactory.create(IFixedTranslationResources.class, URI);
      final ClientResponse<TranslationsResource> response = client.getTranslations(id, locale);

      if (Response.Status.fromStatusCode(response.getStatus()) == Response.Status.OK)
      {
        final TranslationsResource retValue = response.getEntity();
        return retValue;
View Full Code Here

Examples of org.zanata.rest.client.IFixedTranslationResources

    try
    {
      final ZanataDetails details = new ZanataDetails();
      final String URI = details.getUrl();

      final IFixedTranslationResources client = ProxyFactory.create(IFixedTranslationResources.class, URI);
      final ClientResponse<String> response = client.deleteResource(details.getUsername(), details.getToken(), id);
     
      final Status status = Response.Status.fromStatusCode(response.getStatus());
     
      if (status == Response.Status.OK)
      {
View Full Code Here

Examples of org.zanata.rest.client.IFixedTranslationResources

    final String server = "http://zanata-fortitude.lab.eng.bne.redhat.com:8080";
    final String project = "demo";
    final String version = "1.0";
    final String URI = server + "/seam/resource/restv1/projects/p/" + project + "/iterations/i/" + version + "/r";

    final IFixedTranslationResources client = ProxyFactory.create(IFixedTranslationResources.class, URI);
    final ClientResponse<TranslationsResource> response = client.getTranslations("test", LocaleId.DE);

    if (response.getStatus() == 200)
    {

      final TranslationsResource entity = response.getEntity();
View Full Code Here

Examples of org.zanata.rest.client.IFixedTranslationResources

    final String server = "http://zanata-fortitude.lab.eng.bne.redhat.com:8080";
    final String project = "skynet";
    final String version = "1";
    final String URI = server + "/seam/resource/restv1/projects/p/" + project + "/iterations/i/" + version + "/r";

    final IFixedTranslationResources client = ProxyFactory.create(IFixedTranslationResources.class, URI);
    final ClientResponse<List<ResourceMeta>> response = client.getResourceList();
    final List<ResourceMeta> entity = response.getEntity();

    for (final ResourceMeta meta : entity)
    {
      final String name = meta.getName();
     
      System.out.println(meta.getName());
      System.out.println(meta.getType().toString());
     
      if (name.endsWith("null"))
      {
        System.out.println("Deleting " + name);
        final ClientResponse<String> deleteResponse = client.deleteResource("admin", "b6d7044e9ee3b2447c28fb7c50d86d98", name);
        final String deleteEntity = deleteResponse.getEntity();
        System.out.println(deleteEntity);
       
      }
    }
View Full Code Here

Examples of org.zanata.rest.client.IFixedTranslationResources

      final String server = "http://zanata-fortitude.lab.eng.bne.redhat.com:8080";
      final String project = "demo";
      final String version = "1.0";
      final String URI = server + "/seam/resource/restv1/projects/p/" + project + "/iterations/i/" + version + "/r";

      final IFixedTranslationResources client = ProxyFactory.create(IFixedTranslationResources.class, URI);
      final ClientResponse<Resource> response = client.getResource("test");

      if (response.getStatus() == 200)
      {
        final Resource entity = response.getEntity();
        System.out.println(entity.getName());
View Full Code Here

Examples of org.zanata.rest.client.IFixedTranslationResources

          request.header("X-Auth-Token", "b6d7044e9ee3b2447c28fb7c50d86d98");
          return super.execute(request);
        }
      };

      final IFixedTranslationResources client = ProxyFactory.create(IFixedTranslationResources.class, URI);
      final ClientResponse<String> response = client.createResource("admin", "b6d7044e9ee3b2447c28fb7c50d86d98", resource);
      final String entity = response.getEntity();

      System.out.println(entity);
    }
    catch (final Exception ex)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.