Examples of TextFlowTarget


Examples of org.zanata.rest.dto.resource.TextFlowTarget

        Resource doc1 = putDoc1(false);
        doc1.setRevision(1);
        TextFlow tf1 = doc1.getTextFlows().get(0);
        tf1.setRevision(1);
        TranslationsResource target1 = putTarget1();
        TextFlowTarget tft1 = target1.getTextFlowTargets().get(0);
        tft1.setTextFlowRevision(1);
        tft1.setRevision(1);
        expectDocs(true, false, doc1);
        expectTarget1(target1);
        putDoc1(false); // docRev still 1
        doc1.setRevision(1);
        tf1.setRevision(1);
        tft1.setTextFlowRevision(1);
        expectDocs(true, false, doc1);
        expectTarget1(target1);
    }
View Full Code Here

Examples of org.zanata.rest.dto.resource.TextFlowTarget

        Resource doc1 = putDoc1(false);
        doc1.setRevision(1);
        TextFlow tf1 = doc1.getTextFlows().get(0);
        tf1.setRevision(1);
        TranslationsResource target1 = putTarget1();
        TextFlowTarget tft1 = target1.getTextFlowTargets().get(0);
        tft1.setTextFlowRevision(1);
        expectDocs(true, false, doc1);
        tft1.setRevision(1);
        expectTarget1(target1);
        deleteDoc1(); // doc1 becomes obsolete
        getZero();
        dontExpectTarget1();
        Resource doc1a = putDoc1a(false); // doc1 resurrected, rev 2
        doc1a.setRevision(2);
        TextFlow tf1a = doc1a.getTextFlows().get(0);
        tf1a.setRevision(doc1a.getRevision());
        TranslationsResource target1a = putTarget1a();
        TextFlowTarget tft1a = target1a.getTextFlowTargets().get(0);
        tft1a.setTextFlowRevision(tf1a.getRevision());
        tft1a.setRevision(1);
        expectDocs(true, false, doc1a);
        dontExpectTarget1();
        expectTarget1a(target1a);
    }
View Full Code Here

Examples of org.zanata.rest.dto.resource.TextFlowTarget

        Resource doc1 = putDoc1(false);
        doc1.setRevision(1);
        TextFlow tf1 = doc1.getTextFlows().get(0);
        tf1.setRevision(1);
        TranslationsResource target1 = putTarget1();
        TextFlowTarget tft1 = target1.getTextFlowTargets().get(0);
        tft1.setTextFlowRevision(1);
        tft1.setRevision(1);
        expectDocs(true, false, doc1);
        expectTarget1(target1);
        // this should completely replace doc1's textflow FOOD with HELLO
        Resource doc1a = putDoc1a(false);
        doc1a.setRevision(2);
        TextFlow tf1a = doc1a.getTextFlows().get(0);
        tf1a.setRevision(2);
        TranslationsResource target1a = putTarget1a();
        TextFlowTarget tft1a = target1a.getTextFlowTargets().get(0);
        tft1a.setTextFlowRevision(2);
        tft1a.setRevision(1);
        expectDocs(true, false, doc1a);
        dontExpectTarget1();
        expectTarget1a(target1a);
        // use dao to check that the HTextFlow FOOD (from doc1) is marked
        // obsolete
View Full Code Here

Examples of org.zanata.rest.dto.resource.TextFlowTarget

        // Push a document and its translations
        createResourceWithContentUsingPut();

        TranslationsResource entity = new TranslationsResource();
        TextFlowTarget target = new TextFlowTarget();
        target.setResId("tf1");
        target.setContents("hello world");
        target.setState(ContentState.Approved);
        target.setTranslator(new Person("root@localhost", "Admin user"));
        entity.getTextFlowTargets().add(target);

        // Future Date for the PO Revision Date Header
        Calendar poRevDate = Calendar.getInstance();
        poRevDate.add(Calendar.YEAR, 1); // 1 year in the future
View Full Code Here

Examples of org.zanata.rest.dto.resource.TextFlowTarget

        // Push a document and its translations
        createResourceWithContentUsingPut();

        TranslationsResource entity = new TranslationsResource();
        TextFlowTarget target = new TextFlowTarget();
        target.setResId("tf1");
        target.setContents("hello world");
        target.setState(ContentState.Approved);
        target.setTranslator(new Person("root@localhost", "Admin user"));
        entity.getTextFlowTargets().add(target);

        ClientResponse<String> putResponse =
                transResource.putTranslations("my.txt", de_DE, entity, null);
        assertThat(putResponse.getResponseStatus(), is(Status.OK));
View Full Code Here

Examples of org.zanata.rest.dto.resource.TextFlowTarget

        return resource;
    }

    private TranslationsResource createTargetDoc() {
        TranslationsResource trans = new TranslationsResource();
        TextFlowTarget target = new TextFlowTarget();
        target.setContents("hei verden");
        target.setDescription("translation of hello world");
        target.setResId("tf1");
        target.setState(ContentState.Approved);
        Person person = new Person("email@example.com", "Translator Name");
        target.setTranslator(person);
        trans.getTextFlowTargets().add(target);
        return trans;
    }
View Full Code Here

Examples of org.zanata.rest.dto.resource.TextFlowTarget

        return textFlow;
    }

    private TextFlowTarget newTextFlowTarget(String id, String targetContent,
            String targetComment) {
        TextFlowTarget target = new TextFlowTarget();
        target.setResId(id);
        target.setState(ContentState.Approved);
        target.setContents(targetContent);
        if (targetComment != null)
            getOrAddComment(target).setValue(targetComment);
        return target;
    }
View Full Code Here

Examples of org.zanata.rest.dto.resource.TextFlowTarget

    }

    private TranslationsResource putPoTarget1() {
        String id = "foo.pot";
        TranslationsResource tr = new TranslationsResource();
        TextFlowTarget target =
                newTextFlowTarget("FOOD", "Sauerkraut", "translator comment");
        tr.getTextFlowTargets().add(target);

        PoTargetHeader targetHeader = new PoTargetHeader();
        targetHeader.setComment("target comment");
View Full Code Here

Examples of org.zanata.rest.dto.resource.TextFlowTarget

    }

    protected TranslationsResource putTarget1() {
        String id = DOC1_NAME;
        TranslationsResource tr = new TranslationsResource();
        TextFlowTarget target = newTextFlowTarget("FOOD", "Sauerkraut", null);
        tr.getTextFlowTargets().add(target);
        transResource.putTranslations(id, DE, tr, extGettextComment);
        return tr;
    }
View Full Code Here

Examples of org.zanata.rest.dto.resource.TextFlowTarget

    }

    protected TranslationsResource putTarget1a() {
        String id = DOC1_NAME;
        TranslationsResource tr = new TranslationsResource();
        TextFlowTarget target =
                newTextFlowTarget("HELLO", "Bonjour le Monde",
                        "bon jour comment");
        tr.getTextFlowTargets().add(target);
        transResource.putTranslations(id, FR, tr, extGettextComment);
        return tr;
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.