2828 * > obj4
2929 * > obj5
3030 * > obj6
31+ * > obj7
3132 * > obj3
3233 *
3334 * @author bbpennel
@@ -40,7 +41,9 @@ public class TestCorpus {
4041 public PID pid4 ;
4142 public PID pid5 ;
4243 public PID pid6 ;
44+ public PID pid7 ;
4345 public PID pid6File ;
46+ public PID pid7File ;
4447 public PID nonExistentPid ;
4548
4649 public TestCorpus () {
@@ -50,7 +53,9 @@ public TestCorpus() {
5053 pid4 = makePid ();
5154 pid5 = makePid ();
5255 pid6 = makePid ();
56+ pid7 = makePid ();
5357 pid6File = makePid ();
58+ pid7File = makePid ();
5459 nonExistentPid = makePid ();
5560 }
5661
@@ -79,7 +84,7 @@ public List<SolrInputDocument> populate() {
7984 newDoc .addField ("ancestorPath" , makeAncestorPath (pid1 ));
8085 newDoc .addField ("resourceType" , "Collection" );
8186 List <String > collectionDatastream = List .of (
82- DatastreamType .JP2_ACCESS_COPY .getId () + "|image/jp2|bunny.jp2|jp2|||" + pid2 .getId () + "|1200x1200" );
87+ DatastreamType .JP2_ACCESS_COPY .getId () + "|image/jp2|bunny.jp2|jp2|766 ||" + pid2 .getId () + "|1200x1200" );
8388 newDoc .addField (SearchFieldKey .DATASTREAM .getSolrField (), collectionDatastream );
8489 docs .add (newDoc );
8590
@@ -119,7 +124,7 @@ public List<SolrInputDocument> populate() {
119124 newDoc .addField ("resourceType" , ResourceType .File .name ());
120125 List <String > imgDatastreams = Arrays .asList (
121126 ORIGINAL_FILE .getId () + "|image/png|file.png|png|766|urn:sha1:checksum||1200x1200" ,
122- DatastreamType .JP2_ACCESS_COPY .getId () + "|image/jp2|bunny.jp2|jp2|||" + pid6File .getId () + "|1200x1200" );
127+ DatastreamType .JP2_ACCESS_COPY .getId () + "|image/jp2|bunny.jp2|jp2|766 ||" + pid6File .getId () + "|1200x1200" );
123128 newDoc .addField (SearchFieldKey .DATASTREAM .getSolrField (), imgDatastreams );
124129 newDoc .addField (SearchFieldKey .FILE_FORMAT_CATEGORY .getSolrField (), ContentCategory .image .getDisplayName ());
125130 newDoc .addField (SearchFieldKey .FILE_FORMAT_TYPE .getSolrField (), "png" );
@@ -137,12 +142,48 @@ public List<SolrInputDocument> populate() {
137142 newDoc .addField ("resourceType" , ResourceType .Work .name ());
138143 List <String > workDatastreams = Arrays .asList (
139144 ORIGINAL_FILE .getId () + "|image/png|file.png|png|766|urn:sha1:checksum|" + pid6File .getId () + "|1200x1200" ,
140- DatastreamType .JP2_ACCESS_COPY .getId () + "|image/jp2|bunny.jp2|jp2|||" + pid6File .getId () + "|1200x1200" );
145+ DatastreamType .JP2_ACCESS_COPY .getId () + "|image/jp2|bunny.jp2|jp2|766 ||" + pid6File .getId () + "|1200x1200" );
141146 newDoc .addField (SearchFieldKey .DATASTREAM .getSolrField (), workDatastreams );
142147 newDoc .addField (SearchFieldKey .FILE_FORMAT_CATEGORY .getSolrField (), ContentCategory .image .getDisplayName ());
143148 newDoc .addField (SearchFieldKey .FILE_FORMAT_TYPE .getSolrField (), "png" );
144149 docs .add (newDoc );
145150
151+ newDoc = new SolrInputDocument ();
152+ newDoc .addField ("title" , "Work2" );
153+ newDoc .addField ("id" , pid7 .getId ());
154+ newDoc .addField ("rollup" , pid7 .getId ());
155+ newDoc .addField ("roleGroup" , "public admin" );
156+ newDoc .addField ("readGroup" , "public" );
157+ newDoc .addField ("adminGroup" , "admin" );
158+ newDoc .addField ("ancestorIds" , makeAncestorIds (pid1 , pid3 ));
159+ newDoc .addField ("ancestorPath" , makeAncestorPath (pid1 , pid3 ));
160+ newDoc .addField ("resourceType" , ResourceType .Work .name ());
161+ List <String > work2Datastreams = Arrays .asList (
162+ ORIGINAL_FILE .getId () + "|image/png|file.png|png|766|urn:sha1:checksum|" + pid6File .getId () + "|1200x1200" ,
163+ DatastreamType .JP2_ACCESS_COPY .getId () + "|image/jp2|bunny.jp2|jp2|766||" + pid6File .getId () + "|1200x1200" );
164+ newDoc .addField (SearchFieldKey .DATASTREAM .getSolrField (), work2Datastreams );
165+ newDoc .addField (SearchFieldKey .FILE_FORMAT_CATEGORY .getSolrField (), ContentCategory .image .getDisplayName ());
166+ newDoc .addField (SearchFieldKey .FILE_FORMAT_TYPE .getSolrField (), "png" );
167+ docs .add (newDoc );
168+
169+ newDoc = new SolrInputDocument ();
170+ newDoc .addField ("title" , "File2" );
171+ newDoc .addField ("id" , pid7File .getId ());
172+ newDoc .addField ("rollup" , pid7 .getId ());
173+ newDoc .addField ("roleGroup" , "public admin" );
174+ newDoc .addField ("readGroup" , "public" );
175+ newDoc .addField ("adminGroup" , "admin" );
176+ newDoc .addField ("ancestorIds" , makeAncestorIds (pid1 , pid3 , pid7 ));
177+ newDoc .addField ("ancestorPath" , makeAncestorPath (pid1 , pid3 , pid7 ));
178+ newDoc .addField ("resourceType" , ResourceType .File .name ());
179+ List <String > fileDatastreams = Arrays .asList (
180+ ORIGINAL_FILE .getId () + "|image/png|file.png|png|766|urn:sha1:checksum||120x120" ,
181+ DatastreamType .JP2_ACCESS_COPY .getId () + "|image/jp2|bunny.jp2|jp2|766||" + pid7File .getId () + "|120x120" );
182+ newDoc .addField (SearchFieldKey .DATASTREAM .getSolrField (), fileDatastreams );
183+ newDoc .addField (SearchFieldKey .FILE_FORMAT_CATEGORY .getSolrField (), ContentCategory .image .getDisplayName ());
184+ newDoc .addField (SearchFieldKey .FILE_FORMAT_TYPE .getSolrField (), "png" );
185+ docs .add (newDoc );
186+
146187 newDoc = new SolrInputDocument ();
147188 newDoc .addField ("title" , "Second collection" );
148189 newDoc .addField ("id" , pid3 .getId ());
@@ -154,7 +195,7 @@ public List<SolrInputDocument> populate() {
154195 newDoc .addField ("ancestorPath" , makeAncestorPath (pid1 ));
155196 newDoc .addField ("resourceType" , "Collection" );
156197 List <String > collection2Datastream = List .of (
157- DatastreamType .JP2_ACCESS_COPY .getId () + "|image/jp2|bunny.jp2|jp2|||" + pid2 .getId () + "|120x120 " );
198+ DatastreamType .JP2_ACCESS_COPY .getId () + "|image/jp2|bunny.jp2|jp2|0 ||" + pid2 .getId () + "|1200x1200 " );
158199 newDoc .addField (SearchFieldKey .DATASTREAM .getSolrField (), collection2Datastream );
159200 docs .add (newDoc );
160201
0 commit comments