Examples of TextFlow


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

    @Test
    public void put1Put1aPut1() throws Exception {
        getZero();
        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);
View Full Code Here

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

        resource.setName(name);
        resource.setType(ResourceType.DOCUMENT);

        if (withTextFlow)
            resource.getTextFlows().add(
                    new TextFlow("tf1", LocaleId.EN_US, "hello world"));
        return resource;
    }
View Full Code Here

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

        return doc;
    }

    private TextFlow newTextFlow(String id, String sourceContent,
            String sourceComment) {
        TextFlow textFlow = new TextFlow(id, LocaleId.EN);
        textFlow.setContents(sourceContent);
        if (sourceComment != null)
            getOrAddComment(textFlow).setValue(sourceComment);
        return textFlow;
    }
View Full Code Here

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

        return tft.getExtensions(true).findOrAddByType(SimpleComment.class);
    }

    private Resource putPo1() {
        String id = "foo.pot";
        TextFlow textflow = newTextFlow("FOOD", "Slime Mould", "POT comment");
        PotEntryHeader poData =
                textflow.getExtensions(true).findOrAddByType(
                        PotEntryHeader.class);
        poData.setContext("context");
        List<String> flags = poData.getFlags();
        flags.add("no-c-format");
        flags.add("flag2");
View Full Code Here

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

    @Test
    public void mergeTextFlowWithOneFromChange() {
        List<TextFlow> from = new ArrayList<TextFlow>();

        TextFlow tf1 = new TextFlow("id", LocaleId.EN, "text1");
        from.add(tf1);

        HDocument to = new HDocument();

        boolean changed =
View Full Code Here

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

        originalTF.getTargets().put(apprLocId, apprTarg);

        to.getAllTextFlows().put("id", originalTF);

        // set up a textflow with the same id and different content
        TextFlow changedTF =
                new TextFlow(originalTF.getResId(), LocaleId.EN, "changed text");
        List<TextFlow> from = new ArrayList<TextFlow>();
        from.add(changedTF);

        int newTFRevision = 2;
View Full Code Here

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

        sr.setLang(LocaleId.EN_US);
        sr.setType(ResourceType.FILE);
        // for the convenience of test only
        sr.getExtensions(true);

        TextFlow stf = new TextFlow("rest1", LocaleId.EN_US, "tf1");
        stf.getExtensions(true);
        sr.getTextFlows().add(stf);
        log.debug(sr.toString());
        return sr;
    }
View Full Code Here

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

        sr.setContentType(ContentType.TextPlain);
        sr.setLang(LocaleId.EN_US);
        sr.setType(ResourceType.FILE);
        sr.getExtensions(true);

        TextFlow stf = new TextFlow("tf1", LocaleId.EN_US, "tf1");
        stf.getExtensions(true);
        TextFlow stf2 = new TextFlow("tf2", LocaleId.EN_US, "testtf2");
        // stf2.getExtensions(true);
        sr.getTextFlows().add(stf);
        sr.getTextFlows().add(stf2);
        return sr;
    }
View Full Code Here

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

        return sr;
    }

    public Resource getPotEntryHeaderTest() {
        Resource sr = getTextFlowTest();
        TextFlow stf = sr.getTextFlows().get(0);

        PotEntryHeader potEntryHeader = new PotEntryHeader();
        potEntryHeader.setContext("potentrycontext");
        // for the convenience of test only
        potEntryHeader.getFlags().add("");
        potEntryHeader.getReferences().add("");
        stf.getExtensions(true).add(potEntryHeader);
        return sr;
    }
View Full Code Here

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

        return sr;
    }

    public Resource getTextFlowCommentTest() {
        Resource sr = getTextFlowTest();
        TextFlow stf = sr.getTextFlows().get(0);

        SimpleComment simpleComment = new SimpleComment("textflow comment");

        stf.getExtensions(true).add(simpleComment);
        return sr;
    }
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.