Examples of HCopyTransOptions


Examples of org.zanata.model.HCopyTransOptions

            conversationScopeMessages.setMessage(FacesMessage.SEVERITY_INFO,
                    msgs.get("jsf.iteration.CopyTrans.NoDocuments"));
            return;
        }

        HCopyTransOptions options = copyTransOptionsModel.getInstance();

        copyTransManager.startCopyTrans(getProjectIteration(), options);
        conversationScopeMessages.setMessage(FacesMessage.SEVERITY_INFO,
                msgs.get("jsf.iteration.CopyTrans.Started"));
    }
View Full Code Here

Examples of org.zanata.model.HCopyTransOptions

    private static HCopyTransOptions getOptions(
            HCopyTransOptions.ConditionRuleAction contextAction,
            HCopyTransOptions.ConditionRuleAction docIdAction,
            HCopyTransOptions.ConditionRuleAction projectAction) {

        HCopyTransOptions instance = new HCopyTransOptions();
        instance.setContextMismatchAction(contextAction);
        instance.setDocIdMismatchAction(docIdAction);
        instance.setProjectMismatchAction(projectAction);

        return instance;
    }
View Full Code Here

Examples of org.zanata.model.HCopyTransOptions

                                            .getId(), false)
                            .getDefaultCopyTransOpts();
        }
        // use the global default options
        if (copyTransOpts == null) {
            copyTransOpts = new HCopyTransOptions();
        }

        log.info("copyTrans start: document \"{}\"", document.getDocId());
        List<HLocale> localeList =
                localeServiceImpl.getSupportedLanguageByProjectIteration(
View Full Code Here

Examples of org.zanata.model.HCopyTransOptions

        doc.getTextFlows().add(textFlow);

        projectIteration = iterationDAO.makePersistent(projectIteration);
        getEm().flush(); // So the rest of the test sees the results

        HCopyTransOptions options =
                new HCopyTransOptions(execution.getContextMismatchAction(),
                        execution.getDocumentMismatchAction(),
                        execution.getProjectMismatchAction());
        CopyTransService copyTransService =
                seam.autowire(CopyTransServiceImpl.class);
        copyTransService.copyTransForIteration(projectIteration, options,
View Full Code Here

Examples of org.zanata.model.HCopyTransOptions

    @Test
    @Ignore
    @SlowTest
    @PerformanceProfiling
    public void testCopyTransForDocument() throws Exception {
        HCopyTransOptions options =
                new HCopyTransOptions(
                        HCopyTransOptions.ConditionRuleAction.DOWNGRADE_TO_FUZZY,
                        HCopyTransOptions.ConditionRuleAction.DOWNGRADE_TO_FUZZY,
                        HCopyTransOptions.ConditionRuleAction.DOWNGRADE_TO_FUZZY);
        copyTransService
                .copyTransForDocument(copyTransTargetDoc, options, null);
View Full Code Here

Examples of org.zanata.model.HCopyTransOptions

                new CopyTransServiceImpl(
                        localeServiceImpl, projectDAO, documentDAO,
                        copyTransWorkFactory, textFlowTargetDAO,
                        translationStateCacheImpl, textFlowDAO);

        HCopyTransOptions projOptions = new HCopyTransOptions(IGNORE, IGNORE, IGNORE);

        String projSlug = "projslug";
        long projId = 123L;
        HProject proj = createProject(projSlug, projId, projOptions);
        when(projectDAO.findById(projId, false)).thenReturn(proj);


        String iterSlug = "iterslug";
        boolean requireReview = true;
        HProjectIteration iter = createIter(iterSlug, proj, requireReview);

        List<HTextFlow> textFlows = Arrays.asList(new HTextFlow());
        HDocument doc = createDoc(iter, textFlows);

        when(documentDAO.findById(doc.getId())).thenReturn(doc);

        HLocale de = new HLocale(LocaleId.DE);
        List<HLocale> localeList = Arrays.asList(de);
        when(localeServiceImpl.getSupportedLanguageByProjectIteration(projSlug, iterSlug)).thenReturn(localeList);

        when(copyTransWorkFactory
                .createCopyTransWork(any(HLocale.class),
                        any(HCopyTransOptions.class), any(HDocument.class),
                        anyBoolean(), anyListOf(HTextFlow.class)))
                .thenReturn(
                        copyTransWork);

        HCopyTransOptions optionsIn, optionsOut;
        if (useProjectOpts) {
            optionsIn = null;
            optionsOut = projOptions;
        } else {
            optionsIn = new HCopyTransOptions(DOWNGRADE_TO_FUZZY, DOWNGRADE_TO_FUZZY, DOWNGRADE_TO_FUZZY);
            optionsOut = optionsIn;
        }

        ctService.copyTransForDocument(doc, optionsIn, null);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.