title: Exposing link on collection entity in spring data REST
body: <p>Using spring data REST I have exposed a <code>ProjectRepository</code> that supports listing projects and performing CRUD operations on them. When I go to <code>http://localhost:8080/projects/</code> I get the list of projects as I expect.</p>
  
  <p>What I am trying to do is add a custom action to the <code>_links</code> section of the JSON response for the Project Collection.</p>
  
  <p>For example, I'd like the call to <code>http://localhost:8080/projects/</code> to return something like this:</p>
  
  <pre><code>{
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/projects/{?page,size,sort}",
        "templated" : true
      },
      "search" : {
        "href" : "http://localhost:8080/projects/search"
      },
      "customAction" : {
         "href" : "http://localhost:8080/projects/customAction"
      }
    },
    "page" : {
      "size" : 20,
      "totalElements" : 0,
      "totalPages" : 0,
      "number" : 0
    }
  }
  </code></pre>
  
  <p>Where <code>customAction</code> is defined in some controller.</p>
  
  <p>I've tried creating the following class:</p>
  
  <pre><code>public class ProjectCollectionResourceProcessor implements ResourceProcessor&lt;Resource&lt;Collection&lt;Project&gt;&gt;&gt; {
  
      @Override
      public Resource&lt;Collection&lt;Project&gt;&gt; process(Resource&lt;Collection&lt;Project&gt;&gt; listResource) {
          // code to add the links to customAction here
          return listResource;
      }
  
  }
  </code></pre>
  
  <p>and adding adding the following Bean to my applications configuration:</p>
  
  <pre><code>@Bean
  public ProjectCollectionResourceProcessor projectCollectionResourceProcessor() {
      return new ProjectCollectionResourceProcessor();
  }
  </code></pre>
  
  <p>But <code>process(...)</code> doesn't ever seem to get called.  What is the correct way to add links to Collections of resources?</p>