@ParentResource(RootResource.class) public interface AuditResource
private Class<?> getParentResource() { if (this.baseResource == null) { return null; } ParentResource parent = this.baseResource.getAnnotation(ParentResource.class); if (parent != null) { return parent.value(); } return null; }
/** * Resource for working with patient independent features of {@link org.phenotips.data.permissions.Visibility}. * * @version $Id: 8ad903420649e549629b012eccb942add63a0eaf $ * @since 1.3M2 */ @Path("/permissions/visibility") @Relation("https://phenotips.org/rel/visibilityOptions") @ParentResource(RootResource.class) public interface VisibilityOptionsResource { /** * The system has several predefined options of visibility levels. * * @return all the enabled visibility levels present in the system */ @GET @Produces(MediaType.APPLICATION_JSON) VisibilityOptionsRepresentation getVisibilityOptions(); }
private Class<?> getParentResource() { if (this.baseResource == null) { return null; } ParentResource parent = this.baseResource.getAnnotation(ParentResource.class); if (parent != null) { return parent.value(); } return null; }
/** * Resource for working with patient independent features of {@link org.phenotips.data.permissions.Visibility}. * * @version $Id: 8ad903420649e549629b012eccb942add63a0eaf $ * @since 1.3M2 */ @Path("/permissions/visibility") @Relation("https://phenotips.org/rel/visibilityOptions") @ParentResource(RootResource.class) public interface VisibilityOptionsResource { /** * The system has several predefined options of visibility levels. * * @return all the enabled visibility levels present in the system */ @GET @Produces(MediaType.APPLICATION_JSON) VisibilityOptionsRepresentation getVisibilityOptions(); }
private Set<Class<?>> findChildResources() { Set<Class<?>> result = new LinkedHashSet<>(); for (XWikiRestComponent resource : this.resources.get()) { Class<?> clazz = resource.getClass(); while (clazz != null) { for (Class<?> i : clazz.getInterfaces()) { ParentResource parentAnnotation = i.getAnnotation(ParentResource.class); if (parentAnnotation != null && parentAnnotation.value().equals(this.baseResource)) { result.add(findResourceInterface(resource)); } } clazz = clazz.getSuperclass(); } } return result; }
@ParentResource(PatientsResource.class) public interface PatientByLabeledExternalIdentifierResource
private Set<Class<?>> findChildResources() { Set<Class<?>> result = new LinkedHashSet<>(); for (XWikiRestComponent resource : this.resources.get()) { Class<?> clazz = resource.getClass(); while (clazz != null) { for (Class<?> i : clazz.getInterfaces()) { ParentResource parentAnnotation = i.getAnnotation(ParentResource.class); if (parentAnnotation != null && parentAnnotation.value().equals(this.baseResource)) { result.add(findResourceInterface(resource)); } } clazz = clazz.getSuperclass(); } } return result; }
/** * Resource for working with multiple patient records, identified by their given "external" or "internal" identifiers. * * @version $Id: ccdab503b8f003c5ee0d6bf4cb203c207947e204 $ * @since 1.3M5 */ @Path("/patients/fetch") @Relation("https://phenotips.org/rel/patientRecords") @ParentResource(PatientsResource.class) public interface PatientsFetchResource { /** * Retrieve multiple patient records, identified by their given "external" or "internal" identifiers, in their JSON * representation. If any of the indicated patient records don't exist, or if the user sending the request doesn't * have the right to view any of the target patient records, they are excluded from the search results. * * @return JSON representations of the requested patients, or a status message in case of error */ @GET @Produces(MediaType.APPLICATION_JSON) Response fetchPatients(); }
/** * Resource for resolving multiple vocabulary terms from any valid vocabulary, given a list of their identifiers. Each * identifier must have a valid vocabulary prefix of format {@code <vocabulary prefix>:<term id>} (e.g. HP:0000526). * * @version $Id: add3f33cdcd5490f33a74ea94dc1a57cd452ee0f $ * @since 1.4 */ @Path("/vocabularies/terms/fetch") @Relation("https://phenotips.org/rel/vocabularyTerm") @ParentResource(VocabulariesResource.class) public interface VocabularyTermsResolveResource { /** * Retrieves a JSON representation of the {@link org.phenotips.vocabulary.VocabularyTerm} objects by resolving the * term identifiers using their prefix. The terms that cannot be resolved are ignored. The following request * parameters are used: * * <dl> * <dt>term-id</dt> * <dd>a list of term IDs that should be resolved</dd> * </dl> * * @return the requested terms that were resolved successfully */ @GET @Produces(MediaType.APPLICATION_JSON) Response resolveTerms(); }
/** * Resource for searching in a category for terms matching an input (vocabulary suggest). * * @version $Id: 4fb33572a148793ec311d9ad0385ee423e34ed23 $ * @since 1.4 */ @Path("/vocabularies/categories/{category}/suggest") @ParentResource(CategoryResource.class) @Relation("https://phenotips.org/rel/categoryTermSuggest") public interface CategoryTermSuggestionsResource { /** * Provides term suggestions for the specified vocabulary category as a {@link Response}. Request can optionally * specify the maximum number of results to return. If no suggestions are found, {@link Response} will not contain * any terms. * * @param category The name of the vocabulary category to be used for suggestions. If no matching category is found, * an error is returned to the user * @param input The string which will be used to generate suggestions * @param maxResults The maximum number of results to be returned; default is 10 * @return A {@link Response} object representing a list of {@link VocabularyTerm term} suggestions. */ @GET @Produces(MediaType.APPLICATION_JSON) Response suggest( @PathParam("category") String category, @QueryParam("input") String input, @QueryParam("maxResults") @DefaultValue("10") int maxResults); }
@ParentResource(VocabularyResource.class) @Relation("https://phenotips.org/rel/suggest") public interface VocabularyTermSuggestionsResource
@ParentResource(VocabularyResource.class) @Relation("https://phenotips.org/rel/suggest") public interface VocabularyTermSuggestionsResource
@ParentResource(RootResource.class) public interface PatientsResource
@ParentResource(FamiliesResource.class) @Relation("https://phenotips.org/rel/suggest") public interface FamiliesSuggestionsResource
/** * Root resource for working with vocabularies, listing all the available vocabularies. * * @version $Id: 2b17918bfdefb172e1434c11c9fdaaf2f9a52ff0 $ * @since 1.3M1 */ @Unstable("New API introduced in 1.3") @Path("/vocabularies") @ParentResource(RootResource.class) @Relation("https://phenotips.org/rel/vocabularies") public interface VocabulariesResource { /** * Entry resource for the Vocabularies RESTful API, provides a list of available vocabulary resources. * * @return a {@link Vocabularies} resource representing all the vocabularies that are currently available */ @GET @Produces(MediaType.APPLICATION_JSON) Vocabularies getAllVocabularies(); }
/** * Root resource for working with vocabularies, listing all the available vocabularies. * * @version $Id: 2b17918bfdefb172e1434c11c9fdaaf2f9a52ff0 $ * @since 1.3M1 */ @Unstable("New API introduced in 1.3") @Path("/vocabularies") @ParentResource(RootResource.class) @Relation("https://phenotips.org/rel/vocabularies") public interface VocabulariesResource { /** * Entry resource for the Vocabularies RESTful API, provides a list of available vocabulary resources. * * @return a {@link Vocabularies} resource representing all the vocabularies that are currently available */ @GET @Produces(MediaType.APPLICATION_JSON) Vocabularies getAllVocabularies(); }
@ParentResource(PatientResource.class) public interface PermissionsResource
/** * Resource for working with vocabulary categories, listing all the available categories. * * @version $Id: d1b1dcf54d44457aac1d18774f48880f4c691dca $ * @since 1.4 */ @Unstable("New API introduced in 1.4") @Path("/vocabularies/categories") @ParentResource(VocabulariesResource.class) @Relation("https://phenotips.org/rel/categories") public interface CategoriesResource { /** * Provides a list of all available vocabulary categories. * * @return a {@link Categories} resource representing all the vocabulary categories that are currently available */ @GET @Produces(MediaType.APPLICATION_JSON) Categories getAllCategories(); }
@ParentResource(PatientsResource.class) @Relation("https://phenotips.org/rel/suggest") public interface PatientsSuggestionsResource