Package org.zanata.model

Examples of org.zanata.model.HTextFlowTarget


        }

        @Override
        public DocumentStatus load(DocumentLocaleKey key) throws Exception {
            DocumentDAO documentDAO = getDocumentDAO();
            HTextFlowTarget target =
                    documentDAO.getLastTranslatedTarget(key.getDocumentId(),
                            key.getLocaleId());
            DocumentStatus documentStatus = new DocumentStatus();

            return updateDocumentStatus(documentDAO, documentStatus,
View Full Code Here


                textFlowDAO
                        .findByIdList(Lists.newArrayList(requestMap.keySet()));

        List<TransUnitUpdateRequest> updateRequests = Lists.newArrayList();
        for (HTextFlow hTextFlow : hTextFlows) {
            HTextFlowTarget hTextFlowTarget =
                    hTextFlow.getTargets().get(targetLocale.getId());

            // TODO rhbz953734 - TM getUpdateRequests won't override Translated
            // to Approved
            // yet. May or may not want this feature.
            if (hTextFlowTarget != null
                    && hTextFlowTarget.getState().isTranslated()) {
                log.warn("Text flow id {} is translated. Ignored.",
                        hTextFlow.getId());
                continue;
            }
View Full Code Here

    }

    @Override
    public HTextFlowTarget copyTextFlowTarget(HTextFlow newTf,
            HTextFlowTarget tft) throws Exception {
        HTextFlowTarget copy =
                JPACopier.<HTextFlowTarget> copyBean(tft, "textFlow",
                        "reviewComments", "history");
        copy.setTextFlow(newTf);
        copy.setTextFlowRevision(newTf.getRevision());

        // copy review comment
        copy.setReviewComments(Lists
                .<HTextFlowTargetReviewComment> newArrayList());
        for (HTextFlowTargetReviewComment comment : tft.getReviewComments()) {
            copy.addReviewComment(comment.getComment(), comment.getCommenter());
        }

        // copy history
        for (HTextFlowTargetHistory history : tft.getHistory().values()) {
            HTextFlowTargetHistory newHistory =
                    JPACopier.<HTextFlowTargetHistory> copyBean(history,
                            "textFlowTarget");
            newHistory.setTextFlowTarget(copy);
            copy.getHistory().put(newHistory.getVersionNum(), newHistory);
        }
        return copy;
    }
View Full Code Here

TOP

Related Classes of org.zanata.model.HTextFlowTarget

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.