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

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

Introduction

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

Prototype

public UriComponentsBuilder getUriComponentsBuilder() 

Source Link

Document

Returns a new UriComponentsBuilder for the base URI.

Usage

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.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.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();
}