Package org.zanata.file

Examples of org.zanata.file.GlobalDocumentId


         *
         * @return JSON summary of outcome of the attempt.
         */
        private JSONObject processFileItem(FileItem item) {
            String docId = translationFileServiceImpl.generateDocId(path, item.getName());
            GlobalDocumentId id = new GlobalDocumentId(projectSlug, versionSlug, docId);

            Optional<String> errorMessage;
            Optional<String> successMessage = Optional.absent();

            Optional<String> concurrentUploadError = Optional.of("failed: someone else is already uploading this file");
View Full Code Here


                + translationFileServiceImpl.getFileExtension(projectSlug,
                        versionSlug, docPath, docName);
    }

    public boolean hasOriginal(String docPath, String docName) {
        GlobalDocumentId id =
                new GlobalDocumentId(projectSlug, versionSlug, docPath
                        + docName);
        return filePersistService.hasPersistedDocument(id);
    }
View Full Code Here

                downloadExtensions.put(".po", "po?docId=" + hDoc.getDocId());
            } else {
                downloadExtensions.put("offline .po",
                        "offlinepo?docId=" + hDoc.getDocId());
            }
            GlobalDocumentId id =
                    new GlobalDocumentId(iterationId.getProjectSlug(),
                            iterationId.getIterationSlug(), hDoc.getDocId());
            if (filePersistService.hasPersistedDocument(id)) {
                String extension =
                        "."
                                + translationFileServiceImpl.getFileExtension(
View Full Code Here

    }

    @Override
    public Response uploadSourceFile(String projectSlug, String iterationSlug,
            String docId, DocumentFileUploadForm uploadForm) {
        GlobalDocumentId id =
                new GlobalDocumentId(projectSlug, iterationSlug, docId);
        return sourceUploader.tryUploadSourceFile(id, uploadForm);
    }
View Full Code Here

    @Override
    public Response uploadTranslationFile(String projectSlug,
            String iterationSlug, String localeId, String docId, String merge,
            DocumentFileUploadForm uploadForm) {
        GlobalDocumentId id =
                new GlobalDocumentId(projectSlug, iterationSlug, docId);
        return translationUploader.tryUploadTranslationFile(id, localeId,
                merge, uploadForm);
    }
View Full Code Here

    }

    @Override
    public Response downloadTranslationFile(String projectSlug,
            String iterationSlug, String locale, String fileType, String docId) {
        GlobalDocumentId id =
                new GlobalDocumentId(projectSlug, iterationSlug, docId);
        // TODO scan (again) for virus
        final Response response;
        HDocument document =
                this.documentDAO.getByProjectIterationAndDocId(projectSlug,
                        iterationSlug, docId);
View Full Code Here

                .use("translationDocumentUploader", transUploader)
                .allowCycles();

        fileService = seam.autowire(FileService.class);

        id = new GlobalDocumentId(PROJ_SLUG, VER_SLUG, DOC_ID);
        form = new DocumentFileUploadForm();
        okResponse = Response.ok().build();
    }
View Full Code Here

TOP

Related Classes of org.zanata.file.GlobalDocumentId

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.