Skip to content

Commit

Permalink
Fix bug that borked canvas IDs (#383)
Browse files Browse the repository at this point in the history
  • Loading branch information
jabrah committed Oct 10, 2018
1 parent f30ff91 commit afb534a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.Collections;

import rosa.archive.core.ArchiveNameParser;
import rosa.archive.model.Book;
import rosa.archive.model.BookCollection;
import rosa.archive.model.BookImage;
Expand All @@ -20,9 +21,11 @@

public class CanvasTransformer implements TransformerConstants {
private final PresentationUris pres_uris;
private final ArchiveNameParser nameParser;

public CanvasTransformer(PresentationUris pres_uris) {
this.pres_uris = pres_uris;
this.nameParser = new ArchiveNameParser();
}

/**
Expand All @@ -37,7 +40,7 @@ public Canvas transform(BookCollection collection, Book book, BookImage image, b
return null;
}
Canvas canvas = new Canvas();
canvas.setId(pres_uris.getCanvasURI(collection.getId(), book.getId(), image.getName()));
canvas.setId(pres_uris.getCanvasURI(collection.getId(), book.getId(), nameParser.shortName(image.getId())));
canvas.setType(SC_CANVAS);

/*
Expand Down

0 comments on commit afb534a

Please sign in to comment.