Package edu.stanford.bmir.protege.web.server.owlapi

Examples of edu.stanford.bmir.protege.web.server.owlapi.OWLAPIProjectDocumentStore


    }

    @Override
    public RequestValidationResult validateAction(A action, RequestContext requestContext) {
        ProjectId projectId = action.getProjectId();
        OWLAPIProjectDocumentStore ds = OWLAPIProjectDocumentStore.getProjectDocumentStore(projectId);
        if(ds.exists()) {
            return RequestValidationResult.getValid();
        }
        else {
            return RequestValidationResult.getInvalid("Project does not exist");
        }
View Full Code Here


        this.publishInfo = publishInfo;
        ontologyDocument = getOntologyDocumentFromProjectAndRevision(projectId, revisionNumber);
    }
   
    private File getOntologyDocumentFromProjectAndRevision(ProjectId projectId, RevisionNumber revisionNumber) throws IOException, OWLOntologyStorageException {
        OWLAPIProjectDocumentStore store = OWLAPIProjectDocumentStore.getProjectDocumentStore(projectId);
        File ontologyDocument = File.createTempFile("BioPortalOntology", ".zip");
        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(ontologyDocument));
        store.exportProjectRevision(revisionNumber, bos, DownloadFormat.getDefaultFormat());
        bos.close();
        return ontologyDocument;
    }
View Full Code Here

        return new BufferedOutputStream(new FileOutputStream(configurationFile));
    }


    private static File getProjectConfigurationDirectory(ProjectId projectId) {
        final OWLAPIProjectDocumentStore projectDocumentStore = OWLAPIProjectDocumentStore.getProjectDocumentStore(projectId);
        return projectDocumentStore.getConfigurationsDirectory();
    }
View Full Code Here

        this.format = format;
    }
   
    public void writeProject(HttpServletResponse response, OutputStream outputStream) throws IOException {
        try {
            OWLAPIProjectDocumentStore documentStore = OWLAPIProjectDocumentStore.getProjectDocumentStore(projectId);
            setFileType(response);
            setFileName(response);
            if(revision.isHead()) {
                documentStore.exportProject(outputStream, format);
            }
            else {
                documentStore.exportProjectRevision(revision, outputStream, format);
            }

        }
        catch (OWLOntologyStorageException e) {
            e.printStackTrace();
View Full Code Here

    private File notesOntologyDocument;


    public NoteStoreNotesAPIImpl(OWLAPIProject project) {
        try {
            OWLAPIProjectDocumentStore documentStore = OWLAPIProjectDocumentStore.getProjectDocumentStore(project.getProjectId());
            File notesDataDirectory = documentStore.getNotesDataDirectory();
            notesOntologyDocument = new File(notesDataDirectory, NOTES_ONTOLOGY_DOCUMENT_NAME);
            if(!notesOntologyDocument.exists()) {
                createEmptyNotesOntology();
            }
            else {
View Full Code Here

    public OWLAPINotesManagerNotesAPIImpl(OWLAPIProject project) {
        this.project = project;
        try {
            long t0 = System.currentTimeMillis();
            OWLAPIProjectDocumentStore documentStore = OWLAPIProjectDocumentStore.getProjectDocumentStore(project.getProjectId());
            File notesDataDirectory = documentStore.getNotesDataDirectory();
            notesOntologyDocument = new File(notesDataDirectory, NOTES_ONTOLOGY_DOCUMENT_NAME);
            if(!notesOntologyDocument.exists()) {
                createEmptyNotesOntology();
            }
            else {
View Full Code Here

        }
    }

    private void importLegacyNotesIfNecessary() {
        // Junk to import notes
        OWLAPIProjectDocumentStore documentStore = OWLAPIProjectDocumentStore.getProjectDocumentStore(project.getProjectId());
        File notesDataDirectory = documentStore.getNotesDataDirectory();
        File legacy = new File(notesDataDirectory, "notes-data.legacy");
        if(legacy.exists()) {
            LOGGER.info(project.getProjectId(), "Importing legacy notes data");
            try {
                final BufferedInputStream inputStream = new BufferedInputStream(new FileInputStream(legacy));
View Full Code Here

        for (ProjectInstance projectInstance : metaproject.getProjects()) {
            final String name = projectInstance.getName();
            if (name != null && ProjectId.isWelFormedProjectId(name)) {
                final ProjectId projectId = ProjectId.get(name);
                if (isAuthorisedToReadAndList(policy, user, projectInstance)) {
                    OWLAPIProjectDocumentStore ds = OWLAPIProjectDocumentStore.getProjectDocumentStore(projectId);
                    if (ds.exists()) {
                        final ProjectDetails projectDetails = createProjectDetailsFromProjectInstance(projectInstance);
                        result.add(projectDetails);
                    }
                }
            }
View Full Code Here

        }
    }


    private File getChangeHistoryFile() {
        OWLAPIProjectDocumentStore documentStore = OWLAPIProjectDocumentStore.getProjectDocumentStore(project.getProjectId());
        File file = documentStore.getChangeDataFile();
        if (!file.exists()) {
            file.getParentFile().mkdirs();
        }
        return file;
    }
View Full Code Here

TOP

Related Classes of edu.stanford.bmir.protege.web.server.owlapi.OWLAPIProjectDocumentStore

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.