Search in sources :

Example 1 with UploadFileDialogController

use of edu.stanford.bmir.protege.web.client.upload.UploadFileDialogController in project webprotege by protegeproject.

the class UploadAndMergeProjectWorkflow method uploadProject.

private void uploadProject(final ProjectId projectId) {
    UploadFileDialogController uploadFileDialogController = new UploadFileDialogController("Upload ontologies", new UploadFileResultHandler() {

        @Override
        public void handleFileUploaded(DocumentId fileDocumentId) {
            startMergeWorkflow(projectId, fileDocumentId);
        }

        @Override
        public void handleFileUploadFailed(String errorMessage) {
            GWT.log("Upload failed");
        }
    });
    WebProtegeDialog.showDialog(uploadFileDialogController);
}
Also used : UploadFileResultHandler(edu.stanford.bmir.protege.web.client.upload.UploadFileResultHandler) DocumentId(edu.stanford.bmir.protege.web.shared.csv.DocumentId) UploadFileDialogController(edu.stanford.bmir.protege.web.client.upload.UploadFileDialogController)

Example 2 with UploadFileDialogController

use of edu.stanford.bmir.protege.web.client.upload.UploadFileDialogController in project webprotege by protegeproject.

the class CsvImportPresenter method startImport.

public void startImport() {
    UploadFileResultHandler uploadResultHandler = new UploadFileResultHandler() {

        @Override
        public void handleFileUploaded(final DocumentId fileDocumentId) {
            WebProtegeDialog<CSVImportDescriptor> csvImportDialog = new WebProtegeDialog<>(new CSVImportDialogController(projectId, fileDocumentId, baseClass, dispatchServiceManager, new CSVImportViewImpl(primitiveDataEditorProvider)));
            csvImportDialog.setVisible(true);
        }

        @Override
        public void handleFileUploadFailed(String errorMessage) {
            ProgressMonitor.get().hideProgressMonitor();
            MessageBox.showAlert("Error uploading CSV file", errorMessage);
        }
    };
    UploadFileDialogController controller = new UploadFileDialogController("Upload CSV", uploadResultHandler);
    WebProtegeDialog.showDialog(controller);
}
Also used : CSVImportViewImpl(edu.stanford.bmir.protege.web.client.csv.CSVImportViewImpl) UploadFileResultHandler(edu.stanford.bmir.protege.web.client.upload.UploadFileResultHandler) WebProtegeDialog(edu.stanford.bmir.protege.web.client.library.dlg.WebProtegeDialog) DocumentId(edu.stanford.bmir.protege.web.shared.csv.DocumentId) CSVImportDialogController(edu.stanford.bmir.protege.web.client.csv.CSVImportDialogController) UploadFileDialogController(edu.stanford.bmir.protege.web.client.upload.UploadFileDialogController) CSVImportDescriptor(edu.stanford.bmir.protege.web.shared.csv.CSVImportDescriptor)

Aggregations

UploadFileDialogController (edu.stanford.bmir.protege.web.client.upload.UploadFileDialogController)2 UploadFileResultHandler (edu.stanford.bmir.protege.web.client.upload.UploadFileResultHandler)2 DocumentId (edu.stanford.bmir.protege.web.shared.csv.DocumentId)2 CSVImportDialogController (edu.stanford.bmir.protege.web.client.csv.CSVImportDialogController)1 CSVImportViewImpl (edu.stanford.bmir.protege.web.client.csv.CSVImportViewImpl)1 WebProtegeDialog (edu.stanford.bmir.protege.web.client.library.dlg.WebProtegeDialog)1 CSVImportDescriptor (edu.stanford.bmir.protege.web.shared.csv.CSVImportDescriptor)1