28
28
* > obj4
29
29
* > obj5
30
30
* > obj6
31
+ * > obj7
31
32
* > obj3
32
33
*
33
34
* @author bbpennel
@@ -40,7 +41,9 @@ public class TestCorpus {
40
41
public PID pid4 ;
41
42
public PID pid5 ;
42
43
public PID pid6 ;
44
+ public PID pid7 ;
43
45
public PID pid6File ;
46
+ public PID pid7File ;
44
47
public PID nonExistentPid ;
45
48
46
49
public TestCorpus () {
@@ -50,7 +53,9 @@ public TestCorpus() {
50
53
pid4 = makePid ();
51
54
pid5 = makePid ();
52
55
pid6 = makePid ();
56
+ pid7 = makePid ();
53
57
pid6File = makePid ();
58
+ pid7File = makePid ();
54
59
nonExistentPid = makePid ();
55
60
}
56
61
@@ -79,7 +84,7 @@ public List<SolrInputDocument> populate() {
79
84
newDoc .addField ("ancestorPath" , makeAncestorPath (pid1 ));
80
85
newDoc .addField ("resourceType" , "Collection" );
81
86
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" );
83
88
newDoc .addField (SearchFieldKey .DATASTREAM .getSolrField (), collectionDatastream );
84
89
docs .add (newDoc );
85
90
@@ -119,7 +124,7 @@ public List<SolrInputDocument> populate() {
119
124
newDoc .addField ("resourceType" , ResourceType .File .name ());
120
125
List <String > imgDatastreams = Arrays .asList (
121
126
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" );
123
128
newDoc .addField (SearchFieldKey .DATASTREAM .getSolrField (), imgDatastreams );
124
129
newDoc .addField (SearchFieldKey .FILE_FORMAT_CATEGORY .getSolrField (), ContentCategory .image .getDisplayName ());
125
130
newDoc .addField (SearchFieldKey .FILE_FORMAT_TYPE .getSolrField (), "png" );
@@ -137,12 +142,48 @@ public List<SolrInputDocument> populate() {
137
142
newDoc .addField ("resourceType" , ResourceType .Work .name ());
138
143
List <String > workDatastreams = Arrays .asList (
139
144
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" );
141
146
newDoc .addField (SearchFieldKey .DATASTREAM .getSolrField (), workDatastreams );
142
147
newDoc .addField (SearchFieldKey .FILE_FORMAT_CATEGORY .getSolrField (), ContentCategory .image .getDisplayName ());
143
148
newDoc .addField (SearchFieldKey .FILE_FORMAT_TYPE .getSolrField (), "png" );
144
149
docs .add (newDoc );
145
150
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
+
146
187
newDoc = new SolrInputDocument ();
147
188
newDoc .addField ("title" , "Second collection" );
148
189
newDoc .addField ("id" , pid3 .getId ());
@@ -154,7 +195,7 @@ public List<SolrInputDocument> populate() {
154
195
newDoc .addField ("ancestorPath" , makeAncestorPath (pid1 ));
155
196
newDoc .addField ("resourceType" , "Collection" );
156
197
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 " );
158
199
newDoc .addField (SearchFieldKey .DATASTREAM .getSolrField (), collection2Datastream );
159
200
docs .add (newDoc );
160
201
0 commit comments