Package org.zanata.rest.dto.resource

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


        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

        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

        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

        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

        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

        return sr;
    }

    public Resource getPotEntryHeaderComment() {
        Resource sr = getTextFlowTest();
        TextFlow stf = sr.getTextFlows().get(0);
        SimpleComment simpleComment = new SimpleComment("textflow comment");

        PotEntryHeader potEntryHeader = new PotEntryHeader();
        potEntryHeader.setContext("potentrycontext");

        // /no place for flag and reference
        stf.getExtensions(true).add(simpleComment);
        stf.getExtensions(true).add(potEntryHeader);
        return sr;
    }
View Full Code Here

        em.flush();
    }

    private static void addSampleTextFlow(Resource from, LocaleId localeId,
            int index) {
        from.getTextFlows().add(new TextFlow("res" + index, localeId, "hello world " + index));
    }
View Full Code Here

TOP

Related Classes of org.zanata.rest.dto.resource.TextFlow

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.