Package org.zanata.rest.dto.extensions.gettext

Examples of org.zanata.rest.dto.extensions.gettext.PotEntryHeader


            TextFlow from, HTextFlow to,
            Set<String> enabledExtensions) {
        boolean changed = false;
        ExtensionSet<TextFlowExtension> extensions = from.getExtensions(true);
        if (enabledExtensions.contains(PotEntryHeader.ID)) {
            PotEntryHeader entryHeader =
                    extensions.findByType(PotEntryHeader.class);
            if (entryHeader != null) {
                HPotEntryData hEntryHeader = to.getPotEntryData();

                if (hEntryHeader == null) {
View Full Code Here


    public void transferToTextFlowExtensions(HTextFlow from,
            ExtensionSet<TextFlowExtension> to, Set<String> enabledExtensions) {
        if (enabledExtensions.contains(PotEntryHeader.ID)
                && from.getPotEntryData() != null) {
            PotEntryHeader header = new PotEntryHeader();
            transferToPotEntryHeader(from.getPotEntryData(), header);
            log.debug("set header:{}", from.getPotEntryData());
            to.add(header);

        }
View Full Code Here

    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

    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

    }

    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");
        List<String> refs = poData.getReferences();
        refs.add("ref1.xml:7");
        refs.add("ref1.xml:21");

        Resource doc = newDoc(id, textflow);
        PoHeader poHeader = new PoHeader();
View Full Code Here

TOP

Related Classes of org.zanata.rest.dto.extensions.gettext.PotEntryHeader

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.