Skip to content

Commit

Permalink
Merge pull request #327 from futures/repository-sitemap
Browse files Browse the repository at this point in the history
move FedoraSitemap to repository.FedoraRepositorySitemap

Resolves: https://www.pivotaltracker.com/story/show/70466664
  • Loading branch information
Andrew Woods committed Apr 30, 2014
2 parents 5b939db + 755b430 commit bd9309d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package org.fcrepo.http.api;
package org.fcrepo.http.api.repository;

import static java.lang.Integer.parseInt;
import static javax.jcr.query.Query.JCR_SQL2;
Expand All @@ -40,6 +40,7 @@
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;

import org.fcrepo.http.api.FedoraNodes;
import org.fcrepo.http.commons.AbstractResource;
import org.fcrepo.http.commons.jaxb.responses.sitemap.SitemapEntry;
import org.fcrepo.http.commons.jaxb.responses.sitemap.SitemapIndex;
Expand All @@ -61,12 +62,12 @@
@Component
@Scope("prototype")
@Path("/sitemap")
public class FedoraSitemap extends AbstractResource {
public class FedoraRepositorySitemap extends AbstractResource {

@InjectedSession
protected Session session;

private static final Logger LOGGER = getLogger(FedoraSitemap.class);
private static final Logger LOGGER = getLogger(FedoraRepositorySitemap.class);

public static final long entriesPerPage = 50000;

Expand All @@ -91,8 +92,8 @@ public SitemapIndex getSitemapIndex() {
for (int i = 0; i <= count; i++) {
sitemapIndex
.appendSitemapEntry(new SitemapEntry(uriInfo
.getBaseUriBuilder().path(FedoraSitemap.class)
.path(FedoraSitemap.class, "getSitemap").build(
.getBaseUriBuilder().path(FedoraRepositorySitemap.class)
.path(FedoraRepositorySitemap.class, "getSitemap").build(
i + 1)));
}
LOGGER.trace("Executed getSitemapIndex().");
Expand Down
Expand Up @@ -37,7 +37,7 @@
import org.fcrepo.http.api.FedoraFieldSearch;
import org.fcrepo.http.api.FedoraFixity;
import org.fcrepo.http.api.FedoraLocks;
import org.fcrepo.http.api.FedoraSitemap;
import org.fcrepo.http.api.repository.FedoraRepositorySitemap;
import org.fcrepo.http.api.FedoraVersions;
import org.fcrepo.http.api.repository.FedoraRepositoryExport;
import org.fcrepo.http.api.repository.FedoraRepositoryNamespaces;
Expand Down Expand Up @@ -140,7 +140,7 @@ private void addRepositoryStatements(final UriInfo uriInfo, final Model model,

// sitemap
model.add(s, HAS_SITEMAP, createResource(uriInfo.getBaseUriBuilder()
.path(FedoraSitemap.class).build().toASCIIString()));
.path(FedoraRepositorySitemap.class).build().toASCIIString()));

// fcr:tx
model.add(s, HAS_TRANSACTION_SERVICE, createResource(uriInfo
Expand Down
Expand Up @@ -25,15 +25,16 @@

import javax.jcr.Session;

import org.fcrepo.http.api.repository.FedoraRepositorySitemap;
import org.fcrepo.http.commons.jaxb.responses.sitemap.SitemapIndex;
import org.fcrepo.kernel.services.RepositoryService;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;

public class FedoraSitemapTest {
public class FedoraRepositorySitemapTest {

private FedoraSitemap testObj;
private FedoraRepositorySitemap testObj;

@Mock
private RepositoryService mockService;
Expand All @@ -43,7 +44,7 @@ public class FedoraSitemapTest {
@Before
public void setUp() throws Exception {
initMocks(this);
testObj = new FedoraSitemap();
testObj = new FedoraRepositorySitemap();
setField(testObj, "repositoryService", mockService);
setField(testObj, "uriInfo", getUriInfoImpl());
mockSession = mockSession(testObj);
Expand Down

0 comments on commit bd9309d

Please sign in to comment.