Package org.zanata.rest.dto

Examples of org.zanata.rest.dto.CopyTransStatus


        if (processHandle == null) {
            throw new NoSuchEntityException(
                    "There are no current or recently finished Copy Trans processes for this document.");
        }

        CopyTransStatus status = new CopyTransStatus();
        status.setInProgress(!processHandle.isDone());
        float percent =
                ((float) processHandle.getCurrentProgress() / processHandle
                        .getMaxProgress()) * 100;
        status.setPercentageComplete((int) percent);
        return status;
    }
View Full Code Here


    public void runCopyTrans(String projectSlug, String iterationSlug,
            String docId) {
        ICopyTransResource resource =
                zanataProxyFactory.getCopyTransResource();
        CopyTransStatus copyTransStatus =
                resource.startCopyTrans(projectSlug,
                        iterationSlug, docId);
        log.info("copyTrans started: {}-{}-{}", projectSlug, iterationSlug, docId);
        while (copyTransStatus.isInProgress()) {
            try {
                Thread.sleep(1000);
                log.debug("copyTrans completion: {}", copyTransStatus.getPercentageComplete());
                copyTransStatus = resource.getCopyTransStatus(projectSlug, iterationSlug, docId);
            }
            catch (InterruptedException e) {
                throw Throwables.propagate(e);
            }
View Full Code Here

                iterationSlug, processStatus.getStatusCode());
        if (copyTrans) {
            log.info("start copyTrans for {} - {}", projectSlug, iterationSlug);
            ICopyTransResource copyTransResource =
                    zanataProxyFactory.getCopyTransResource();
            CopyTransStatus copyTransStatus =
                    copyTransResource
                            .startCopyTrans(projectSlug, iterationSlug,
                                    sourceResource.getName());
            while (copyTransStatus.isInProgress()) {
                try {
                    Thread.sleep(1000);
                }
                catch (InterruptedException e) {
                    throw Throwables.propagate(e);
View Full Code Here

                getClientRequestFactory().createProxy(ICopyTransResource.class);

        copyTransResource.startCopyTrans("sample-project", "1.0",
                "my/path/document.txt");

        CopyTransStatus status =
                copyTransResource.getCopyTransStatus("sample-project", "1.0",
                        "my/path/document.txt");
        assertThat(status, notNullValue());
        verify(mockIdentity, atLeastOnce()).checkPermission(eq("copy-trans"),
                anyVararg());
View Full Code Here

TOP

Related Classes of org.zanata.rest.dto.CopyTransStatus

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.