Package org.zanata.rest

Examples of org.zanata.rest.StringSet


                // translate it
                Set<String> extensions;
                if (params.get("fileName").getString().endsWith(".po")) {
                    extensions =
                            new StringSet(ExtensionType.GetText.toString());
                } else {
                    extensions = Collections.<String> emptySet();
                }
                MergeType mergeType =
                        Boolean.parseBoolean(params.get("merge").getString()) ? MergeType.AUTO
View Full Code Here


            doc.setLang(new LocaleId(sourceFileUpload.getSourceLang()));

            // TODO Copy Trans values
            documentServiceImpl.saveDocument(projectSlug, versionSlug, doc,
                    new StringSet(ExtensionType.GetText.toString()), false);

            showUploadSuccessMessage();
        } catch (ZanataServiceException e) {
            conversationScopeMessages.setMessage(FacesMessage.SEVERITY_ERROR,
                    e.getMessage() + "-" + sourceFileUpload.getFileName());
View Full Code Here

                            versionSlug, translationFileUpload.docId);

            // translate it
            Set<String> extensions;
            if (translationFileUpload.getFileName().endsWith(".po")) {
                extensions = new StringSet(ExtensionType.GetText.toString());
            } else {
                extensions = Collections.<String> emptySet();
            }
            List<String> warnings =
                    translationServiceImpl
View Full Code Here

    @In("filePersistService")
    private FilePersistService filePersistService;

    @Override
    public Response acceptedFileTypes() {
        StringSet acceptedTypes = new StringSet("");
        acceptedTypes.addAll(translationFileServiceImpl
                .getSupportedExtensions());
        return Response.ok(acceptedTypes.toString()).build();
    }
View Full Code Here

    }

    private static Set<String> newExtensions(boolean gettextExtensions) {
        Set<String> extensions;
        if (gettextExtensions) {
            extensions = new StringSet(ExtensionType.GetText.toString());
        } else {
            extensions = Collections.<String> emptySet();
        }
        return extensions;
    }
View Full Code Here

                        useOfflinePo(id));
        doc.setLang(LocaleId.EN_US);
        // TODO Copy Trans values
        documentServiceImpl.saveDocument(id.getProjectSlug(),
                id.getVersionSlug(), doc,
                new StringSet(ExtensionType.GetText.toString()), false);
    }
View Full Code Here

    }

    @Test
    public void testDeleteTranslation() {
        Resource res = resourceTestFactory.getTextFlowTest();
        sourceDocResource.putResource(res.getName(), res, new StringSet(
                "gettext;comment"));
        TranslationsResource sr = transTestFactory.getTestObject();
        translationResource.putTranslations(res.getName(), DE, sr,
                new StringSet("gettext;comment"));
        ClientResponse<String> resourceGetResponse =
                translationResource.deleteTranslations(res.getName(), DE);
        assertThat(resourceGetResponse.getResponseStatus(), is(Status.OK));

        ClientResponse<String> resourceGetResponse2 =
View Full Code Here

    @Test(dataProvider = "TranslationTestData")
    public void testPutGetTranslation(String desc, TranslationsResource sr) {
        sr = cloneDTO(sr);
        Resource res = resourceTestFactory.getTextFlowTest();
        sourceDocResource.putResource(res.getName(), res, new StringSet(
                "gettext;comment"));
        log.debug("successful put resource:" + res.getName());
        translationResource.putTranslations(res.getName(), DE, sr,
                new StringSet("gettext;comment"));
        TranslationsResource get =
                translationResource.getTranslations(res.getName(), DE,
                        new StringSet("gettext;comment")).getEntity();
        log.debug("expect:" + sr.toString());
        log.debug("actual:" + get.toString());
        ResourceTestUtil.clearRevs(sr);
        ResourceTestUtil.clearRevs(get);
        ResourceTestUtil.clearPoTargetHeaders(sr, get);
View Full Code Here

    @Test(dataProvider = "TranslationTestData")
    public void testPutGetTranslationNoExtension(String desc,
            TranslationsResource sr) {
        sr = cloneDTO(sr);
        Resource res = resourceTestFactory.getTextFlowTest();
        sourceDocResource.putResource(res.getName(), res, new StringSet(
                "gettext;comment"));
        log.debug("successful put resource:" + res.getName());
        translationResource.putTranslations(res.getName(), DE, sr, null);
        TranslationsResource get =
                translationResource.getTranslations(res.getName(), DE, null)
View Full Code Here

            dependsOnMethods = { "testPutGetTranslation" })
    public void testPutNoExtensionGetTranslation(String desc,
            TranslationsResource sr) {
        sr = cloneDTO(sr);
        Resource res = resourceTestFactory.getTextFlowTest();
        sourceDocResource.putResource(res.getName(), res, new StringSet(
                "gettext;comment"));
        log.debug("successful put resource:" + res.getName());
        translationResource.putTranslations(res.getName(), DE, sr, null);
        TranslationsResource get =
                translationResource.getTranslations(res.getName(), DE,
                        new StringSet("gettext;comment")).getEntity();
        TranslationsResource base = transTestFactory.getTestObject();
        ResourceTestUtil.clearRevs(base);
        ResourceTestUtil.clearRevs(get);
        log.debug("expect:" + base.toString());
        log.debug("actual:" + get.toString());
View Full Code Here

TOP

Related Classes of org.zanata.rest.StringSet

Copyright © 2018 www.massapicom. 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.