Example usage for org.springframework.data.rest.webmvc BaseUri BaseUri

List of usage examples for org.springframework.data.rest.webmvc BaseUri BaseUri

Introduction

In this page you can find the example usage for org.springframework.data.rest.webmvc BaseUri BaseUri.

Prototype

public BaseUri(String uri) 

Source Link

Document

Creates a new BaseUri with the given URI as base.

Usage

From source file:org.moserp.common.json_schema.factories.ValuePropertyJsonSchemaFactory.java

private String calculateValueListUri(PropertyFactoryContext context) {
    ValueListKey valueListValue = getAnnotation(context, ValueListKey.class);
    String valueListKey = valueListValue.value();
    final BaseUri baseUri = new BaseUri(
            "http://" + moduleRegistry.getModuleForResource("valueLists") + "/valueLists");
    UriComponentsBuilder builder = baseUri.getUriComponentsBuilder();
    return builder.pathSegment(valueListKey).pathSegment("values").build().toUriString();
}

From source file:org.moserp.common.structure.factories.ResourceAssociationPropertyFactory.java

private String calculateValueListUri(PropertyFactoryContext context) {
    ResourceAssociation resourceAssociation = getAnnotation(context, ResourceAssociation.class);
    String resourceName = resourceAssociation.value();

    final BaseUri baseUri = new BaseUri("http://" + moduleRegistry.getModuleForResource(resourceName));
    UriComponentsBuilder builder = baseUri.getUriComponentsBuilder();
    return builder.path(resourceName).build().toUriString();
}

From source file:org.moserp.common.structure.factories.AssociationPropertyFactory.java

private String calculateUri(PropertyFactoryContext context) {
    ResourceMetadata mapping = mappings.getMetadataFor(context.getPersistentProperty().getType());
    final BaseUri baseUri = new BaseUri("http://" + moduleRegistry.getModuleForResource(mapping.getRel()));
    UriComponentsBuilder builder = baseUri.getUriComponentsBuilder();
    return builder.path(mapping.getPath().toString()).build().toUriString();
}

From source file:org.moserp.common.structure.ApplicationStructureController.java

private String getRootPath() {
    BaseUri baseUri = new BaseUri(configuration.getBaseUri());
    return baseUri.getUriComponentsBuilder().path(BASE_PATH).build().toString();
}

From source file:org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration.java

@Bean
public BaseUri baseUri() {
    return new BaseUri(config().getBaseUri());
}