entities);
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/java/edu/stanford/protege/webprotege/shortform/LuceneIndexWriter.java:
--------------------------------------------------------------------------------
1 | package edu.stanford.protege.webprotege.shortform;
2 |
3 | import java.io.IOException;
4 |
5 | /**
6 | * Matthew Horridge
7 | * Stanford Center for Biomedical Informatics Research
8 | * 2020-07-07
9 | */
10 | public interface LuceneIndexWriter {
11 |
12 | void rebuildIndex() throws IOException;
13 |
14 | void writeIndex() throws IOException;
15 | }
16 |
--------------------------------------------------------------------------------
/src/main/java/edu/stanford/protege/webprotege/shortform/LuceneIndexesDirectory.java:
--------------------------------------------------------------------------------
1 | package edu.stanford.protege.webprotege.shortform;
2 |
3 | import org.springframework.beans.factory.annotation.Qualifier;
4 |
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 |
8 | /**
9 | * Matthew Horridge
10 | * Stanford Center for Biomedical Informatics Research
11 | * 2020-08-03
12 | */
13 | @Qualifier
14 | @Retention(RetentionPolicy.RUNTIME)
15 | public @interface LuceneIndexesDirectory {
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/java/edu/stanford/protege/webprotege/shortform/MaxGramSize.java:
--------------------------------------------------------------------------------
1 | package edu.stanford.protege.webprotege.shortform;
2 |
3 | import jakarta.inject.Qualifier;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 |
7 | /**
8 | * Matthew Horridge
9 | * Stanford Center for Biomedical Informatics Research
10 | * 2020-08-07
11 | */
12 | @Qualifier
13 | @Retention(RetentionPolicy.RUNTIME)
14 | public @interface MaxGramSize {
15 | }
16 |
--------------------------------------------------------------------------------
/src/main/java/edu/stanford/protege/webprotege/shortform/MinGramSize.java:
--------------------------------------------------------------------------------
1 | package edu.stanford.protege.webprotege.shortform;
2 |
3 | import jakarta.inject.Qualifier;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 |
7 | /**
8 | * Matthew Horridge
9 | * Stanford Center for Biomedical Informatics Research
10 | * 2020-08-07
11 | */
12 | @Qualifier
13 | @Retention(RetentionPolicy.RUNTIME)
14 | public @interface MinGramSize {
15 | }
16 |
--------------------------------------------------------------------------------
/src/main/java/edu/stanford/protege/webprotege/shortform/MultiLingualDictionary.java:
--------------------------------------------------------------------------------
1 | package edu.stanford.protege.webprotege.shortform;
2 |
3 | import edu.stanford.protege.webprotege.inject.ProjectSingleton;
4 |
5 | /**
6 | * Matthew Horridge
7 | * Stanford Center for Biomedical Informatics Research
8 | * 3 Apr 2018
9 | *
10 | * A dictionary that supports look up for multiple languages
11 | */
12 | @ProjectSingleton
13 | public interface MultiLingualDictionary extends MultiLingualShortFormDictionary, SearchableMultiLingualShortFormDictionary, MultiLingualShortFormIndex {
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/src/main/java/edu/stanford/protege/webprotege/shortform/ShortFormMatchFunction.java:
--------------------------------------------------------------------------------
1 | package edu.stanford.protege.webprotege.shortform;
2 |
3 | import com.google.common.primitives.ImmutableIntArray;
4 | import edu.stanford.protege.webprotege.common.ShortFormMatch;
5 | import org.semanticweb.owlapi.model.OWLEntity;
6 |
7 | import javax.annotation.Nonnull;
8 |
9 | /**
10 | * Matthew Horridge
11 | * Stanford Center for Biomedical Informatics Research
12 | * 6 Apr 2018
13 | */
14 | @FunctionalInterface
15 | public interface ShortFormMatchFunction {
16 |
17 | @Nonnull
18 | ShortFormMatch createMatch(@Nonnull OWLEntity entity,
19 | @Nonnull String shortForm,
20 | int matchCount,
21 | @Nonnull ImmutableIntArray matchPositions);
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/src/main/java/edu/stanford/protege/webprotege/storage/StorageException.java:
--------------------------------------------------------------------------------
1 | package edu.stanford.protege.webprotege.storage;
2 |
3 | /**
4 | * Matthew Horridge
5 | * Stanford Center for Biomedical Informatics Research
6 | * 2024-05-03
7 | */
8 | public class StorageException extends RuntimeException {
9 |
10 | public StorageException(String message, Throwable cause) {
11 | super(message, cause);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/main/java/edu/stanford/protege/webprotege/tag/TagRepository.java:
--------------------------------------------------------------------------------
1 | package edu.stanford.protege.webprotege.tag;
2 |
3 | import edu.stanford.protege.webprotege.common.ProjectId;
4 |
5 | import javax.annotation.Nonnull;
6 | import java.util.List;
7 | import java.util.Optional;
8 |
9 | /**
10 | * Matthew Horridge
11 | * Stanford Center for Biomedical Informatics Research
12 | * 18 Mar 2018
13 | */
14 | public interface TagRepository {
15 |
16 | void saveTag(@Nonnull Tag tag);
17 |
18 | void saveTags(@Nonnull Iterable tags);
19 |
20 | void deleteTag(@Nonnull TagId tagId);
21 |
22 | @Nonnull
23 | List findTags(ProjectId projectId);
24 |
25 | @Nonnull
26 | Optional findTagByTagId(@Nonnull TagId tagId);
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/edu/stanford/protege/webprotege/trigger/TriggerAction.java:
--------------------------------------------------------------------------------
1 | package edu.stanford.protege.webprotege.trigger;
2 |
3 | import org.semanticweb.owlapi.model.OWLEntity;
4 |
5 | import javax.annotation.Nonnull;
6 |
7 | /**
8 | * Matthew Horridge
9 | * Stanford Center for Biomedical Informatics Research
10 | * 7 Jun 2018
11 | */
12 | public interface TriggerAction {
13 |
14 | C begin();
15 |
16 | void execute(@Nonnull OWLEntity entity, C context);
17 |
18 | void end(@Nonnull C context);
19 | }
20 |
--------------------------------------------------------------------------------
/src/main/java/edu/stanford/protege/webprotege/ui/ViewId.java:
--------------------------------------------------------------------------------
1 | package edu.stanford.protege.webprotege.ui;
2 |
3 | import com.fasterxml.jackson.annotation.JsonCreator;
4 | import com.fasterxml.jackson.annotation.JsonValue;
5 |
6 | import javax.annotation.Nonnull;
7 | import java.util.Objects;
8 | import java.util.UUID;
9 |
10 | public record ViewId(@JsonValue String value) {
11 |
12 | public ViewId(String value) {
13 | this.value = Objects.requireNonNull(value, "value cannot be null");
14 | }
15 |
16 | @JsonCreator
17 | public static ViewId valueOf(String id) {
18 | return new ViewId(id);
19 | }
20 |
21 | @Nonnull
22 | public static ViewId generate() {
23 | return new ViewId(UUID.randomUUID().toString());
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/edu/stanford/protege/webprotege/ui/ViewNodeId.java:
--------------------------------------------------------------------------------
1 | package edu.stanford.protege.webprotege.ui;
2 |
3 | import com.fasterxml.jackson.annotation.JsonCreator;
4 | import com.fasterxml.jackson.annotation.JsonValue;
5 |
6 | import java.util.Objects;
7 | import java.util.UUID;
8 |
9 | public record ViewNodeId(@JsonValue String value) {
10 |
11 | public ViewNodeId(String value) {
12 | this.value = Objects.requireNonNull(value, "value cannot be null");
13 | }
14 |
15 | @JsonCreator
16 | public static ViewNodeId valueOf(String value) {
17 | return new ViewNodeId(value);
18 | }
19 |
20 | public static ViewNodeId generate() {
21 | return new ViewNodeId(UUID.randomUUID().toString());
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/main/java/edu/stanford/protege/webprotege/user/UserDetailsManagerConfiguration.java:
--------------------------------------------------------------------------------
1 | package edu.stanford.protege.webprotege.user;
2 |
3 | import edu.stanford.protege.webprotege.ipc.CommandExecutor;
4 | import edu.stanford.protege.webprotege.ipc.impl.CommandExecutorImpl;
5 | import org.springframework.context.annotation.Bean;
6 | import org.springframework.context.annotation.Configuration;
7 |
8 | @Configuration
9 | public class UserDetailsManagerConfiguration {
10 |
11 | @Bean
12 | public CommandExecutor getUserQueryCommandExecutor(){
13 | return new CommandExecutorImpl<>(UsersQueryResponse.class);
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/java/edu/stanford/protege/webprotege/user/UserEmailAlreadyExistsException.java:
--------------------------------------------------------------------------------
1 | package edu.stanford.protege.webprotege.user;
2 |
3 | import java.io.Serializable;
4 |
5 | /**
6 | * Author: Matthew Horridge
7 | * Stanford University
8 | * Bio-Medical Informatics Research Group
9 | * Date: 05/06/2012
10 | */
11 | public class UserEmailAlreadyExistsException extends UserRegistrationException implements Serializable {
12 |
13 | private String emailAddress;
14 |
15 | private UserEmailAlreadyExistsException() {
16 | }
17 |
18 | public UserEmailAlreadyExistsException(String emailAddress) {
19 | super("User email address already exists: " + emailAddress);
20 | this.emailAddress = emailAddress;
21 | }
22 |
23 | public String getEmailAddress() {
24 | return emailAddress;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/edu/stanford/protege/webprotege/user/UserNameAlreadyExistsException.java:
--------------------------------------------------------------------------------
1 | package edu.stanford.protege.webprotege.user;
2 |
3 | import java.io.Serializable;
4 |
5 | /**
6 | * Author: Matthew Horridge
7 | * Stanford University
8 | * Bio-Medical Informatics Research Group
9 | * Date: 05/06/2012
10 | */
11 | public class UserNameAlreadyExistsException extends UserRegistrationException implements Serializable {
12 |
13 | private String username;
14 |
15 | private UserNameAlreadyExistsException() {
16 | }
17 |
18 | public UserNameAlreadyExistsException(String username) {
19 | super("User name already taken: " + username);
20 | this.username = username;
21 | }
22 |
23 | public String getUsername() {
24 | return username;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/edu/stanford/protege/webprotege/user/UserRegistrationException.java:
--------------------------------------------------------------------------------
1 | package edu.stanford.protege.webprotege.user;
2 |
3 | /**
4 | * Author: Matthew Horridge
5 | * Stanford University
6 | * Bio-Medical Informatics Research Group
7 | * Date: 05/06/2012
8 | */
9 | public class UserRegistrationException extends RuntimeException {
10 |
11 | public UserRegistrationException() {
12 | }
13 |
14 | public UserRegistrationException(String message) {
15 | super(message);
16 | }
17 |
18 | public UserRegistrationException(String message, Throwable cause) {
19 | super(message, cause);
20 | }
21 |
22 | public UserRegistrationException(Throwable cause) {
23 | super(cause);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/edu/stanford/protege/webprotege/user/UsersQueryRequest.java:
--------------------------------------------------------------------------------
1 | package edu.stanford.protege.webprotege.user;
2 |
3 | import edu.stanford.protege.webprotege.common.Request;
4 |
5 | public record UsersQueryRequest(String userName) implements Request {
6 |
7 | public final static String CHANNEL = "webprotege.usersquery.QueryUsers";
8 |
9 | @Override
10 | public String getChannel() {
11 | return CHANNEL;
12 | }
13 |
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/src/main/java/edu/stanford/protege/webprotege/user/UsersQueryResponse.java:
--------------------------------------------------------------------------------
1 | package edu.stanford.protege.webprotege.user;
2 |
3 | import edu.stanford.protege.webprotege.common.Response;
4 | import edu.stanford.protege.webprotege.common.UserId;
5 |
6 | import java.util.List;
7 |
8 | public record UsersQueryResponse(List completions) implements Response {
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/src/main/java/edu/stanford/protege/webprotege/util/Counter.java:
--------------------------------------------------------------------------------
1 | package edu.stanford.protege.webprotege.util;
2 |
3 | /**
4 | * Matthew Horridge
5 | * Stanford Center for Biomedical Informatics Research
6 | * 9 Apr 2018
7 | */
8 | public class Counter {
9 |
10 | private int counter;
11 |
12 | public void increment() {
13 | counter++;
14 | }
15 |
16 | /**
17 | * A convenience method that allows a counter the easily by used in streams as a lambda expression.
18 | * @param object An object that will be passed through this method.
19 | */
20 | public T increment(T object) {
21 | counter++;
22 | return object;
23 | }
24 |
25 | public int getCounter() {
26 | return counter;
27 | }
28 |
29 | public void reset() {
30 | counter = 0;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/java/edu/stanford/protege/webprotege/util/IriReplacerFactory.java:
--------------------------------------------------------------------------------
1 | package edu.stanford.protege.webprotege.util;
2 |
3 | import com.google.common.collect.ImmutableMap;
4 | import org.semanticweb.owlapi.model.IRI;
5 | import org.semanticweb.owlapi.model.OWLDataFactory;
6 |
7 | import javax.annotation.Nonnull;
8 |
9 | /**
10 | * Matthew Horridge
11 | * Stanford Center for Biomedical Informatics Research
12 | * 2021-07-13
13 | */
14 | public class IriReplacerFactory {
15 |
16 | private final OWLDataFactory dataFactory;
17 |
18 | public IriReplacerFactory(OWLDataFactory dataFactory) {
19 | this.dataFactory = dataFactory;
20 | }
21 |
22 | @Nonnull
23 | public IriReplacer create(ImmutableMap iriMap) {
24 | return new IriReplacer(dataFactory, iriMap);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/edu/stanford/protege/webprotege/util/TempFileFactory.java:
--------------------------------------------------------------------------------
1 | package edu.stanford.protege.webprotege.util;
2 |
3 | import java.io.File;
4 | import java.io.IOException;
5 |
6 | /**
7 | * @author Matthew Horridge,
8 | * Stanford University,
9 | * Bio-Medical Informatics Research Group
10 | * Date: 18/02/2014
11 | */
12 | public interface TempFileFactory {
13 |
14 | /**
15 | * Creates a fresh, empty temporary directory.
16 | * @return The directory.
17 | */
18 | File createTempDirectory() throws IOException;
19 | }
20 |
--------------------------------------------------------------------------------
/src/main/java/edu/stanford/protege/webprotege/viz/AnyEdgeTypeCriteria.java:
--------------------------------------------------------------------------------
1 | package edu.stanford.protege.webprotege.viz;
2 |
3 | import com.fasterxml.jackson.annotation.JsonTypeName;
4 | import com.google.auto.value.AutoValue;
5 |
6 |
7 | /**
8 | * Matthew Horridge
9 | * Stanford Center for Biomedical Informatics Research
10 | * 2019-12-06
11 | */
12 | @AutoValue
13 |
14 | @JsonTypeName("AnyEdgeType")
15 | public class AnyEdgeTypeCriteria {
16 |
17 | public static AnyEdgeTypeCriteria get() {
18 | return new AutoValue_AnyEdgeTypeCriteria();
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/edu/stanford/protege/webprotege/viz/AnyNodeCriteria.java:
--------------------------------------------------------------------------------
1 | package edu.stanford.protege.webprotege.viz;
2 |
3 | import com.fasterxml.jackson.annotation.JsonTypeName;
4 | import com.google.auto.value.AutoValue;
5 |
6 | import javax.annotation.Nonnull;
7 |
8 | /**
9 | * Matthew Horridge
10 | * Stanford Center for Biomedical Informatics Research
11 | * 2019-12-06
12 | */
13 | @AutoValue
14 |
15 | @JsonTypeName("AnyNode")
16 | public abstract class AnyNodeCriteria implements EdgeNodeCriteria {
17 |
18 | @Override
19 | public R accept(@Nonnull EdgeCriteriaVisitor visitor) {
20 | return visitor.visit(this);
21 | }
22 |
23 | @Nonnull
24 | @Override
25 | public EdgeCriteria simplify() {
26 | return this;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/java/edu/stanford/protege/webprotege/viz/EdgeMatcher.java:
--------------------------------------------------------------------------------
1 | package edu.stanford.protege.webprotege.viz;
2 |
3 | import javax.annotation.Nonnull;
4 |
5 | /**
6 | * Matthew Horridge
7 | * Stanford Center for Biomedical Informatics Research
8 | * 2019-12-05
9 | */
10 | public interface EdgeMatcher {
11 |
12 | boolean matches(@Nonnull Edge edge);
13 | }
14 |
--------------------------------------------------------------------------------
/src/main/java/edu/stanford/protege/webprotege/viz/EdgeNodeCriteria.java:
--------------------------------------------------------------------------------
1 | package edu.stanford.protege.webprotege.viz;
2 |
3 | /**
4 | * Matthew Horridge
5 | * Stanford Center for Biomedical Informatics Research
6 | * 2019-12-06
7 | */
8 | public interface EdgeNodeCriteria extends EdgeCriteria {
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/src/main/java/edu/stanford/protege/webprotege/viz/EdgeTypeCriteria.java:
--------------------------------------------------------------------------------
1 | package edu.stanford.protege.webprotege.viz;
2 |
3 | /**
4 | * Matthew Horridge
5 | * Stanford Center for Biomedical Informatics Research
6 | * 2019-12-06
7 | */
8 | public interface EdgeTypeCriteria extends EdgeCriteria {
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/src/main/java/edu/stanford/protege/webprotege/viz/EntityGraphEdgeLimit.java:
--------------------------------------------------------------------------------
1 | package edu.stanford.protege.webprotege.viz;
2 |
3 | import jakarta.inject.Qualifier;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 |
7 | /**
8 | * Matthew Horridge
9 | * Stanford Center for Biomedical Informatics Research
10 | * 2019-12-15
11 | */
12 | @Qualifier
13 | @Retention(RetentionPolicy.RUNTIME)
14 | public @interface EntityGraphEdgeLimit {
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/java/edu/stanford/protege/webprotege/viz/FilterName.java:
--------------------------------------------------------------------------------
1 | package edu.stanford.protege.webprotege.viz;
2 |
3 | import com.fasterxml.jackson.annotation.JsonCreator;
4 | import com.fasterxml.jackson.annotation.JsonValue;
5 | import com.google.auto.value.AutoValue;
6 |
7 | import javax.annotation.Nonnull;
8 |
9 | /**
10 | * Matthew Horridge
11 | * Stanford Center for Biomedical Informatics Research
12 | * 2019-12-11
13 | */
14 | @AutoValue
15 |
16 | public abstract class FilterName {
17 |
18 | @Nonnull
19 | @JsonCreator
20 | public static FilterName get(@Nonnull String name) {
21 | return new AutoValue_FilterName(name);
22 | }
23 |
24 | @JsonValue
25 | @Nonnull
26 | public abstract String getName();
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/edu/stanford/protege/webprotege/viz/NodeMatchesCriteria.java:
--------------------------------------------------------------------------------
1 | package edu.stanford.protege.webprotege.viz;
2 |
3 | import edu.stanford.protege.webprotege.criteria.EntityMatchCriteria;
4 |
5 | import javax.annotation.Nonnull;
6 |
7 | /**
8 | * Matthew Horridge
9 | * Stanford Center for Biomedical Informatics Research
10 | * 2019-12-06
11 | *
12 | * A node that matches some entity matching criteria
13 | */
14 | public interface NodeMatchesCriteria extends EdgeNodeCriteria {
15 |
16 | @Nonnull
17 | EntityMatchCriteria getNodeCriteria();
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/edu/stanford/protege/webprotege/watches/WatchNotificationEmailTemplate.java:
--------------------------------------------------------------------------------
1 | package edu.stanford.protege.webprotege.watches;
2 |
3 | import jakarta.inject.Qualifier;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 |
7 | /**
8 | * Matthew Horridge
9 | * Stanford Center for Biomedical Informatics Research
10 | * 20 Mar 2017
11 | */
12 | @Qualifier
13 | @Retention(RetentionPolicy.RUNTIME)
14 | public @interface WatchNotificationEmailTemplate {
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/java/edu/stanford/protege/webprotege/watches/WatchType.java:
--------------------------------------------------------------------------------
1 | package edu.stanford.protege.webprotege.watches;
2 |
3 | /**
4 | * Matthew Horridge
5 | * Stanford Center for Biomedical Informatics Research
6 | * 19 Apr 2017
7 | */
8 | public enum WatchType {
9 |
10 | ENTITY,
11 |
12 | BRANCH
13 | }
14 |
--------------------------------------------------------------------------------
/src/main/java/edu/stanford/protege/webprotege/webhook/CommentNotificationSlackTemplate.java:
--------------------------------------------------------------------------------
1 | package edu.stanford.protege.webprotege.webhook;
2 |
3 | import org.springframework.beans.factory.annotation.Qualifier;
4 |
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 |
8 | /**
9 | * Matthew Horridge
10 | * Stanford Center for Biomedical Informatics Research
11 | * 23 May 2017
12 | */
13 | @Qualifier
14 | @Retention(RetentionPolicy.RUNTIME)
15 | public @interface CommentNotificationSlackTemplate {
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/src/main/java/edu/stanford/protege/webprotege/webhook/ProjectWebhookEventType.java:
--------------------------------------------------------------------------------
1 | package edu.stanford.protege.webprotege.webhook;
2 |
3 | /**
4 | * Matthew Horridge
5 | * Stanford Center for Biomedical Informatics Research
6 | * 19 May 2017
7 | */
8 | public enum ProjectWebhookEventType {
9 |
10 | PROJECT_CHANGED,
11 |
12 | COMMENT_POSTED
13 | }
14 |
--------------------------------------------------------------------------------
/src/main/java/edu/stanford/protege/webprotege/webhook/SlackWebhookRepository.java:
--------------------------------------------------------------------------------
1 | package edu.stanford.protege.webprotege.webhook;
2 |
3 | import edu.stanford.protege.webprotege.persistence.Repository;
4 | import edu.stanford.protege.webprotege.common.ProjectId;
5 |
6 | import javax.annotation.Nonnull;
7 | import java.util.List;
8 |
9 | /**
10 | * Matthew Horridge
11 | * Stanford Center for Biomedical Informatics Research
12 | * 8 Jun 2017
13 | */
14 | public interface SlackWebhookRepository extends Repository {
15 |
16 | List getWebhooks(@Nonnull ProjectId projectId);
17 |
18 | void clearWebhooks(@Nonnull ProjectId projectId);
19 |
20 | void addWebhook(@Nonnull SlackWebhook webhooks);
21 | }
22 |
--------------------------------------------------------------------------------
/src/main/java/edu/stanford/protege/webprotege/webhook/Webhook.java:
--------------------------------------------------------------------------------
1 | package edu.stanford.protege.webprotege.webhook;
2 |
3 | import javax.annotation.Nonnull;
4 |
5 | /**
6 | * Matthew Horridge
7 | * Stanford Center for Biomedical Informatics Research
8 | * 4 Feb 2018
9 | */
10 | public interface Webhook {
11 |
12 | /**
13 | * Get the payload Url for the webhook
14 | * @return The payload Url
15 | */
16 | @Nonnull
17 | String getPayloadUrl();
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/edu/stanford/protege/webprotege/webhook/WebhookInvoker.java:
--------------------------------------------------------------------------------
1 | package edu.stanford.protege.webprotege.webhook;
2 |
3 | /**
4 | * Matthew Horridge
5 | * Stanford Center for Biomedical Informatics Research
6 | * 19 May 2017
7 | */
8 | public interface WebhookInvoker {
9 |
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/src/main/resources/builtin-perspective-data/History.json:
--------------------------------------------------------------------------------
1 | {
2 | "perspectiveId" : "766764b8-eeb9-43dc-b48e-aee3146bdd4b",
3 | "favorite" : true,
4 | "label" : {
5 | "en" : "History"
6 | },
7 | "layout" : {
8 | "@type" : "LeafNode",
9 | "properties" : {
10 | "portlet": {
11 | "@type": "String",
12 | "value": "portlets.ProjectHistory"
13 | }
14 | }
15 | }
16 |
17 | }
--------------------------------------------------------------------------------
/src/main/resources/builtin-perspective-data/Query.json:
--------------------------------------------------------------------------------
1 | {
2 | "perspectiveId" : "4b0c350f-d922-46f9-8a27-fbb70a42b93a",
3 | "favorite": false,
4 | "label" : {
5 | "en" : "Query"
6 | },
7 | "layout" : {
8 | "@type" : "LeafNode",
9 | "properties": {
10 | "portlet": {
11 | "@type": "String",
12 | "value": "portlet.query"
13 | }
14 | }
15 | }
16 |
17 | }
--------------------------------------------------------------------------------
/src/main/resources/templates/comment-notification-slack-template.json:
--------------------------------------------------------------------------------
1 | {
2 | "username" : "{{application.name}}",
3 | "mrkdwn_in" : ["text", "fields"],
4 | "attachments": [
5 | {
6 | "fallback": "Comment posted by {{userId}}\n{{comment.body}}",
7 | "color": "#6c1a91",
8 | "pretext": "New comment in {{project.displayName}}",
9 | "title" : "Commented on {{entity.browserText}}",
10 | "title_link" : "{{{entity.url}}}",
11 | "author_name": "{{userId}}",
12 | "text": "{{{comment.body}}}",
13 | "footer" : "<{{{entity.url}}}|View comment on {{application.name}}>",
14 | "ts": {{comment.ts}}
15 | }
16 | ]
17 | }
18 |
--------------------------------------------------------------------------------
/src/main/resources/templates/password-reset-email-template.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
12 |
13 |
14 |
15 | Your {{{application.name}}} password (for user name {{{userId}}}) has been reset to:
16 |
17 |
18 | {{{pwd}}}
19 |
20 |
21 | Please
sign in using this new password and then change it after signing in.
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/src/test/java/edu/stanford/protege/webprotege/persistence/UserIdReadConverterTestCase.java:
--------------------------------------------------------------------------------
1 | package edu.stanford.protege.webprotege.persistence;
2 |
3 | import edu.stanford.protege.webprotege.common.UserId;
4 | import org.junit.jupiter.api.Test;
5 |
6 | import static junit.framework.Assert.assertEquals;
7 |
8 | /**
9 | * Author: Matthew Horridge
10 | * Stanford University
11 | * Bio-Medical Informatics Research Group
12 | * Date: 8/20/13
13 | */
14 | public class UserIdReadConverterTestCase {
15 |
16 | @Test
17 | public void convertShouldReturnUserIdWithSuppliedUserName() {
18 | UserIdReadConverter converter = new UserIdReadConverter();
19 | String suppliedName = "janedoe";
20 | UserId UserId = converter.convert(suppliedName);
21 | assertEquals(suppliedName, UserId.id());
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/test/resources/application-integrationtest.properties:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/protegeproject/webprotege-backend-service/4dd9c1dcae187a73488a9769e4f056f6639dcb56/src/test/resources/application-integrationtest.properties
--------------------------------------------------------------------------------
/src/test/resources/edu/stanford/protege/webprotege/app/UserInSession.json:
--------------------------------------------------------------------------------
1 | {
2 | "userName": "JohnSmith",
3 | "displayName": "John Smith",
4 | "userEmail": "john.smith@gmail.com",
5 | "applicationActions" : []
6 | }
--------------------------------------------------------------------------------