Package org.zanata.rest.editor.dto

Examples of org.zanata.rest.editor.dto.TransUnit


        for (HTextFlow htf : hTextFlows) {
            LocaleId localeId = htf.getDocument().getLocale().getLocaleId();
            EditorTextFlow tf = new EditorTextFlow(htf.getResId(), localeId);
            transUnitUtils.transferToTextFlow(htf, tf);
            transUnits.put(htf.getId().toString(), new TransUnit(tf));
        }
        return Response.ok(transUnits).build();
    }
View Full Code Here


    }

    public TransUnit buildTransUnitFull(@Nonnull HTextFlow hTf,
            HTextFlowTarget hTft, LocaleId localeId) {

        TransUnit tu = new TransUnit();

        // build source
        tu.putAll(buildSourceTransUnit(hTf, localeId));

        // build target
        tu.putAll(buildTargetTransUnit(hTf, hTft, localeId));

        return tu;
    }
View Full Code Here

        return tu;
    }

    public TransUnit buildSourceTransUnit(HTextFlow hTf, LocaleId localeId) {
        TransUnit tu = new TransUnit();
        EditorTextFlow tf =
                new EditorTextFlow(hTf.getResId(), localeId);
        transferToTextFlow(hTf, tf);
        tu.put(TransUnit.SOURCE, tf);
        return tu;
    }
View Full Code Here

        return tu;
    }

    public TransUnit buildTargetTransUnit(HTextFlow hTf, HTextFlowTarget hTft,
            LocaleId localeId) {
        TransUnit tu = new TransUnit();

        if (hTft != null) {
            TextFlowTarget target = new TextFlowTarget(hTf.getResId());
            resourceUtils.transferToTextFlowTarget(hTft, target,
                    Optional.of("Editor"));
            tu.put(hTft.getLocaleId().toString(), target);
        } else {
            tu.put(localeId.toString(),
                    new TextFlowTarget(hTf.getResId()));
        }
        return tu;
    }
View Full Code Here

        List<Object[]> results =
                textFlowDAO.getTextFlowAndTarget(idList, locale.getId());

        for (Object[] result : results) {
            HTextFlow textFlow = (HTextFlow) result[0];
            TransUnit tu;

            if (result.length < 2 || result[1] == null) {
                tu = transUnitUtils.buildTransUnitFull(textFlow, null,
                        locale.getLocaleId());
            }
View Full Code Here

        List<Object[]> results =
                textFlowDAO.getTextFlowAndTarget(idList, locale.getId());

        for (Object[] result : results) {
            HTextFlow hTextFlow = (HTextFlow) result[0];
            TransUnit tu;
            if (result.length < 2 || result[1] == null) {
                tu = transUnitUtils.buildTargetTransUnit(
                        hTextFlow, null, locale.getLocaleId());
            } else {
                HTextFlowTarget hTarget = (HTextFlowTarget) result[1];
View Full Code Here

TOP

Related Classes of org.zanata.rest.editor.dto.TransUnit

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.