Package org.zanata.rest.dto.extensions.comment

Examples of org.zanata.rest.dto.extensions.comment.SimpleComment


                        transferFromPotEntryHeader(entryHeader, hEntryHeader,
                                from);
            }
        }
        if (enabledExtensions.contains(SimpleComment.ID)) {
            SimpleComment comment = extensions.findByType(SimpleComment.class);
            if (comment != null) {
                HSimpleComment hComment = to.getComment();

                if (hComment == null) {
                    hComment = new HSimpleComment();
                }
                if (!equals(comment.getValue(), hComment.getComment())) {
                    changed = true;
                    hComment.setComment(comment.getValue());
                    to.setComment(hComment);
                    log.debug("set comment:{}", comment.getValue());
                }
            }
        }

        return changed;
View Full Code Here


        }

        if (enabledExtensions.contains(SimpleComment.ID)
                && from.getComment() != null) {
            SimpleComment comment =
                    new SimpleComment(from.getComment().getComment());
            log.debug("set comment:{}", from.getComment().getComment());
            to.add(comment);
        }

    }
View Full Code Here

    public void transferToTextFlowTargetExtensions(HTextFlowTarget from,
            ExtensionSet<TextFlowTargetExtension> to,
            Set<String> enabledExtensions) {
        if (enabledExtensions.contains(SimpleComment.ID)
                && from.getComment() != null) {
            SimpleComment comment =
                    new SimpleComment(from.getComment().getComment());
            to.add(comment);
        }
    }
View Full Code Here

    private boolean transferFromTextFlowTargetExtensions(
            ExtensionSet<TextFlowTargetExtension> extensions,
            HTextFlowTarget hTarget) {
        boolean changed = false;
        if (enabledExtension.contains(SimpleComment.ID)) {
            SimpleComment comment = extensions.findByType(SimpleComment.class);
            if (comment != null) {
                changed = targetCommentTransformer.transform(comment, hTarget);
            }
        }
View Full Code Here

    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

    }

    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
View Full Code Here

    public TranslationsResource getTextFlowTargetCommentTest() {
        TranslationsResource sr = getTestObject();
        TextFlowTarget stf = sr.getTextFlowTargets().get(0);

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

        stf.getExtensions(true).add(simpleComment);
        return sr;
    }
View Full Code Here

    public TranslationsResource getAllExtension() {
        TranslationsResource sr = getPoTargetHeaderTextFlowTargetTest();
        TextFlowTarget stf = sr.getTextFlowTargets().get(0);

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

        stf.getExtensions(true).add(simpleComment);
        return sr;
    }
View Full Code Here

TOP

Related Classes of org.zanata.rest.dto.extensions.comment.SimpleComment

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.