diff --git a/doc/main_wiki.md b/doc/main_wiki.md
index 8afcae02d..48b77e450 100644
--- a/doc/main_wiki.md
+++ b/doc/main_wiki.md
@@ -17,18 +17,12 @@ Installation is as simple as downloading a WAR file. To expose your Repositories
-
-
-
-
The file `shared.xml` contains a JDBC DataSource configuration, an EntityManagerFactoryBean, and a JpaTransactionManager.
-Of note in this configuration is the bean named `baseUri`. This is the fully-qualified URI at which the exporter is deployed. This tells the exporter what base URI to use when generating links to your entities.
-
### Including your domain artifacts
To expose your domain objects (your JPA entities, Repositories) and Spring configuration using the web exporter, you need to copy those resources to the web exporter's `WEB-INF/lib` or `WEB-INF/classes` directory. There are potentially other ways to deploy these artifacts without modifying the web exporter's WAR file, but those methods are considerably more complicated and prone to classpath problems. The easiest and most reliable way to deploy your user artifacts are by deploying them alongside the web exporter's artifacts.
@@ -37,7 +31,7 @@ To expose your domain objects (your JPA entities, Repositories) and Spring confi
By default, any repositories found are exported using the bean name of the repository in the Spring configuration (minus the word "Repository", if it appears in the bean name).
-If you have a JPA entity in your domain model that looks like this:
+If you have a JPA entity in your domain model that looks like...
@Entity
public class Person {
@@ -52,12 +46,12 @@ If you have a JPA entity in your domain model that looks like this:
private Map profiles;
}
-An appropriate CrudRepository interface defined like this:
+...and an appropriate CrudRepository interface defined like...
public interface PersonRepository extends CrudRepository {
}
-Your PersonRepository will by default be declared in the ApplicationContext with a bean name of "personRepository". The web exporter will strip the word "Repository" from it and expose a resource named "person". The resulting URL of this repository will be `http://localhost:8080/data/person`.
+...your PersonRepository will by default be declared in the ApplicationContext with a bean name of "personRepository". The web exporter will strip the word "Repository" from it and expose a resource named "person". The resulting URL of this repository (assuming the exporter webapp is deployed at context path `/data` in your servlet container) will be `http://localhost:8080/data/person`.
### Discoverability
@@ -78,7 +72,7 @@ You'll get back a chunk of JSON that points your user agent to the locations of
The "rel" of the link will match the exposed name of the repository. Your application should keep track of this rel value as the key to this repository.
-Similarly, if you issue a GET to `http://localhost:8080/data/person`, you should get back a list of entities exposed at this resource (as returned by the CrudRepository.findAll method).
+Similarly, if you issue a GET to `http://localhost:8080/data/person`, you should get back a list of entities exposed at this resource (as returned by the CrudRepository.findAll method). At the moment, there is no paging, sorting, or querying capability.
curl -v http://localhost:8080/data/person
@@ -117,7 +111,7 @@ This entity has a simple String value called "name", and two relationships to ot
The "self" link will always point to the resource for this entity. Use the "self" link to access the entity itself if you wish to update or delete the entity.
-Following the links for the "profiles" property, gives us a list of links to the actual entities that are referenced by this relationship:
+Following the links for the "profiles" property gives us a list of links to the actual entities that are referenced by this relationship:
curl -v http://localhost:8080/data/person/1/profiles
diff --git a/webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryRestConfiguration.java b/webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryRestConfiguration.java
index e18c0d445..335ee1b60 100644
--- a/webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryRestConfiguration.java
+++ b/webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryRestConfiguration.java
@@ -1,6 +1,5 @@
package org.springframework.data.rest.webmvc;
-import java.net.URI;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -25,8 +24,6 @@ import org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcesso
@ImportResource("classpath*:META-INF/spring-data-rest/**/*-export.xml")
public class RepositoryRestConfiguration {
- @Autowired(required = false)
- URI baseUri;
@Autowired
EntityManagerFactory entityManagerFactory;
@Autowired(required = false)
@@ -37,13 +34,6 @@ public class RepositoryRestConfiguration {
@Autowired(required = false)
List> httpMessageConverters = new ArrayList>();
- @Bean URI baseUri() {
- if (null == baseUri) {
- baseUri = URI.create("");
- }
- return baseUri;
- }
-
@Bean ConversionService conversionService() {
if (null != customConversionService) {
return customConversionService;
diff --git a/webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryRestController.java b/webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryRestController.java
index e6efe1550..9781d54fc 100644
--- a/webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryRestController.java
+++ b/webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryRestController.java
@@ -495,13 +495,13 @@ public class RepositoryRestController implements InitializingBean {
if (child instanceof Collection) {
for (Object o : (Collection) child) {
String childId = childTypeMeta.entityInfo.getId(o).toString();
- URI uri = buildUri(baseUri, repositoryMetadata.repositoryNameFor(childRepo), childId);
+ URI uri = buildUri(baseUri, repository, id, property, childId);
links.add(new SimpleLink(childType.getSimpleName(), uri));
}
} else if (child instanceof Map) {
for (Map.Entry