]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
f55a4a203a1ed0aa3708fd5c8b95dd14491e4b78
[tmp/jakarta-migration.git] /
1 /**\r
2  * This document is a part of the source code and related artifacts\r
3  * for CollectionSpace, an open source collections management system\r
4  * for museums and related institutions:\r
5  *\r
6  * http://www.collectionspace.org\r
7  * http://wiki.collectionspace.org\r
8  *\r
9  * Copyright (c)) 2009 Regents of the University of California\r
10  *\r
11  * Licensed under the Educational Community License (ECL), Version 2.0.\r
12  * You may not use this file except in compliance with this License.\r
13  *\r
14  * You may obtain a copy of the ECL 2.0 License at\r
15  * https://source.collectionspace.org/collection-space/LICENSE.txt\r
16  *\r
17  * Unless required by applicable law or agreed to in writing, software\r
18  * distributed under the License is distributed on an "AS IS" BASIS,\r
19  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
20  * See the License for the specific language governing permissions and\r
21  * limitations under the License.\r
22  */\r
23 \r
24 package org.collectionspace.services.vocabulary.client.sample;\r
25 \r
26 import java.util.ArrayList;\r
27 import java.util.Arrays;\r
28 import java.util.List;\r
29 \r
30 import javax.ws.rs.core.MediaType;\r
31 import javax.ws.rs.core.MultivaluedMap;\r
32 import javax.ws.rs.core.Response;\r
33 \r
34 import org.apache.log4j.BasicConfigurator;\r
35 import org.collectionspace.services.client.VocabularyClient;\r
36 import org.collectionspace.services.client.test.ServiceRequestType;\r
37 import org.collectionspace.services.vocabulary.VocabulariesCommon;\r
38 import org.collectionspace.services.vocabulary.VocabulariesCommonList;\r
39 import org.collectionspace.services.vocabulary.VocabularyitemsCommon;\r
40 import org.collectionspace.services.vocabulary.VocabularyitemsCommonList;\r
41 import org.jboss.resteasy.client.ClientResponse;\r
42 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;\r
43 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;\r
44 import org.jboss.resteasy.plugins.providers.multipart.InputPart;\r
45 import org.jboss.resteasy.plugins.providers.multipart.OutputPart;\r
46 import org.slf4j.Logger;\r
47 import org.slf4j.LoggerFactory;\r
48 \r
49 /**\r
50  * VocabularyServiceTest, carries out tests against a\r
51  * deployed and running Vocabulary Service.\r
52  *\r
53  * $LastChangedRevision$\r
54  * $LastChangedDate$\r
55  */\r
56 public class Sample {\r
57     private static final Logger logger =\r
58         LoggerFactory.getLogger(Sample.class);\r
59 \r
60     // Instance variables specific to this test.\r
61     private VocabularyClient client = new VocabularyClient();\r
62     final String SERVICE_PATH_COMPONENT = "vocabularies";\r
63     final String ITEM_SERVICE_PATH_COMPONENT = "items";\r
64 \r
65 \r
66     // ---------------------------------------------------------------\r
67     // Create\r
68     // ---------------------------------------------------------------\r
69 \r
70     public void createEnumeration(String vocabName, List<String> enumValues ) {\r
71 \r
72         // Expected status code: 201 Created\r
73         int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode();\r
74         // Type of service request being tested\r
75         ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE;\r
76 \r
77         logger.info("Import: Create vocabulary: \"" + vocabName +"\"");\r
78         MultipartOutput multipart = createVocabularyInstance(vocabName, \r
79                         createRefName(vocabName), "enum");\r
80         ClientResponse<Response> res = client.create(multipart);\r
81 \r
82         int statusCode = res.getStatus();\r
83 \r
84         if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
85                 throw new RuntimeException("Could not create enumeration: \""+vocabName\r
86                                 +"\" "+ invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
87         }\r
88         if(statusCode != EXPECTED_STATUS_CODE) {\r
89                 throw new RuntimeException("Unexpected Status when creating enumeration: \""\r
90                                 +vocabName +"\", Status:"+ statusCode);\r
91         }\r
92 \r
93         // Store the ID returned from this create operation\r
94         // for additional tests below.\r
95         String newVocabId = extractId(res);\r
96         logger.info("Import: Created vocabulary: \"" + vocabName +"\" ID:"\r
97                                 +newVocabId );\r
98         \r
99         // Add items to the vocabulary\r
100         for(String itemName : enumValues){\r
101                 createItemInVocab(newVocabId, vocabName, itemName, createRefName(itemName));\r
102         }\r
103         \r
104     }\r
105     \r
106     private String createItemInVocab(String vcsid, String vocabName, String itemName, String refName) {\r
107         // Expected status code: 201 Created\r
108         int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode();\r
109         // Type of service request being tested\r
110         ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE;\r
111 \r
112         logger.info("Import: Create Item: \""+itemName+"\" in vocabulary: \"" + vocabName +"\"");\r
113         MultipartOutput multipart = createVocabularyItemInstance(vcsid, itemName, refName);\r
114         ClientResponse<Response> res = client.createItem(vcsid, multipart);\r
115 \r
116         int statusCode = res.getStatus();\r
117 \r
118         if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
119                 throw new RuntimeException("Could not create Item: \""+itemName\r
120                                 +"\" in vocabulary: \"" + vocabName\r
121                                 +"\" "+ invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
122         }\r
123         if(statusCode != EXPECTED_STATUS_CODE) {\r
124                 throw new RuntimeException("Unexpected Status when creating Item: \""+itemName\r
125                                 +"\" in vocabulary: \"" + vocabName +"\", Status:"+ statusCode);\r
126         }\r
127 \r
128         return extractId(res);\r
129     }\r
130 \r
131 \r
132    // ---------------------------------------------------------------\r
133    // Read\r
134    // ---------------------------------------------------------------\r
135 \r
136    private VocabulariesCommonList readVocabularies() {\r
137 \r
138         // Expected status code: 200 OK\r
139         int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();\r
140         // Type of service request being tested\r
141         ServiceRequestType REQUEST_TYPE = ServiceRequestType.READ;\r
142 \r
143         // Submit the request to the service and store the response.\r
144         ClientResponse<VocabulariesCommonList> res = client.readList();\r
145         VocabulariesCommonList list = res.getEntity();\r
146 \r
147         int statusCode = res.getStatus();\r
148         if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
149                 throw new RuntimeException("Could not read list of vocabularies: "\r
150                 + invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
151         }\r
152         if(statusCode != EXPECTED_STATUS_CODE) {\r
153                 throw new RuntimeException("Unexpected Status when reading " +\r
154                 "list of vocabularies, Status:"+ statusCode);\r
155         }\r
156 \r
157         return list;\r
158    }\r
159 \r
160     private List<String> readVocabularyIds(VocabulariesCommonList list) {\r
161 \r
162         List<String> ids = new ArrayList<String>();\r
163         List<VocabulariesCommonList.VocabularyListItem> vocabularies =\r
164             list.getVocabularyListItem();\r
165         for (VocabulariesCommonList.VocabularyListItem vocabulary : vocabularies) {\r
166             ids.add(vocabulary.getCsid());\r
167         }\r
168         return ids;\r
169    }\r
170     \r
171    private VocabulariesCommon readVocabulary(String vocabId) {\r
172 \r
173         // Expected status code: 200 OK\r
174         int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();\r
175         // Type of service request being tested\r
176         ServiceRequestType REQUEST_TYPE = ServiceRequestType.READ;\r
177 \r
178         // Submit the request to the service and store the response.\r
179         VocabulariesCommon vocabulary = null;\r
180         try {\r
181             ClientResponse<MultipartInput> res = client.read(vocabId);\r
182             int statusCode = res.getStatus();\r
183             if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
184                 throw new RuntimeException("Could not read vocabulary"\r
185                     + invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
186             }\r
187             if(statusCode != EXPECTED_STATUS_CODE) {\r
188                 throw new RuntimeException("Unexpected Status when reading " +\r
189                     "vocabulary, Status:"+ statusCode);\r
190             }\r
191             MultipartInput input = (MultipartInput) res.getEntity();\r
192             vocabulary = (VocabulariesCommon) extractPart(input,\r
193                     client.getCommonPartName(), VocabulariesCommon.class);\r
194         } catch (Exception e) {\r
195             throw new RuntimeException("Could not read vocabulary: ", e);\r
196         }\r
197 \r
198         return vocabulary;\r
199     }\r
200 \r
201     private VocabularyitemsCommonList readItemsInVocab(String vocabId) {\r
202 \r
203         // Expected status code: 200 OK\r
204         int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();\r
205         // Type of service request being tested\r
206         ServiceRequestType REQUEST_TYPE = ServiceRequestType.READ;\r
207 \r
208         // Submit the request to the service and store the response.\r
209         ClientResponse<VocabularyitemsCommonList> res =\r
210                 client.readItemList(vocabId);\r
211         VocabularyitemsCommonList list = res.getEntity();\r
212 \r
213         int statusCode = res.getStatus();\r
214 \r
215         if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
216                 throw new RuntimeException("Could not read items in vocabulary: "\r
217                 + invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
218         }\r
219         if(statusCode != EXPECTED_STATUS_CODE) {\r
220                 throw new RuntimeException("Unexpected Status when reading " +\r
221                 "items in vocabulary, Status:"+ statusCode);\r
222         }\r
223 \r
224         return list;\r
225     }\r
226 \r
227     private List<String> readVocabularyItemIds(VocabularyitemsCommonList list) {\r
228 \r
229         List<String> ids = new ArrayList<String>();\r
230         List<VocabularyitemsCommonList.VocabularyitemListItem> items =\r
231             list.getVocabularyitemListItem();\r
232         for (VocabularyitemsCommonList.VocabularyitemListItem item : items) {\r
233             ids.add(item.getCsid());\r
234         }\r
235         return ids;\r
236    }\r
237 \r
238     // ---------------------------------------------------------------\r
239     // Delete\r
240     // ---------------------------------------------------------------\r
241 \r
242     private void deleteVocabulary(String vcsid) {\r
243          // Expected status code: 200 OK\r
244         int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();\r
245         // Type of service request being tested\r
246         ServiceRequestType REQUEST_TYPE = ServiceRequestType.DELETE;\r
247 \r
248         ClientResponse<Response> res = client.delete(vcsid);\r
249         int statusCode = res.getStatus();\r
250 \r
251         if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
252                 throw new RuntimeException("Could not delete vocabulary: "\r
253                 + invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
254         }\r
255         if(statusCode != EXPECTED_STATUS_CODE) {\r
256                 throw new RuntimeException("Unexpected Status when deleting " +\r
257                 "vocabulary, Status:"+ statusCode);\r
258         }\r
259     }\r
260 \r
261     private void deleteAllVocabularies() {\r
262         List<String> ids = readVocabularyIds(readVocabularies());\r
263         for (String id : ids) {\r
264             deleteVocabulary(id);\r
265         }\r
266     }\r
267 \r
268         private void deleteVocabularyItem(String vcsid, String itemcsid) {\r
269          // Expected status code: 200 OK\r
270         int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();\r
271         // Type of service request being tested\r
272         ServiceRequestType REQUEST_TYPE = ServiceRequestType.DELETE;\r
273 \r
274         ClientResponse<Response> res = client.deleteItem(vcsid, itemcsid);\r
275         int statusCode = res.getStatus();\r
276 \r
277         if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
278                 throw new RuntimeException("Could not delete vocabulary item: "\r
279                 + invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
280         }\r
281         if(statusCode != EXPECTED_STATUS_CODE) {\r
282                 throw new RuntimeException("Unexpected Status when deleting " +\r
283                 "vocabulary item, Status:"+ statusCode);\r
284         }\r
285     }\r
286 \r
287     private void deleteAllItemsForVocab(String vocabId) {\r
288         List<String> itemIds = readVocabularyItemIds(readItemsInVocab(vocabId));\r
289         for (String itemId : itemIds) {\r
290             deleteVocabularyItem(vocabId, itemId);\r
291         }\r
292     }\r
293 \r
294     // ---------------------------------------------------------------\r
295     // Utility methods used by tests above\r
296     // ---------------------------------------------------------------\r
297 \r
298     private MultipartOutput createVocabularyInstance(\r
299                 String displayName, String refName, String vocabType) {\r
300         VocabulariesCommon vocabulary = new VocabulariesCommon();\r
301         vocabulary.setDisplayName(displayName);\r
302         vocabulary.setRefName(refName);\r
303         vocabulary.setVocabType(vocabType);\r
304         MultipartOutput multipart = new MultipartOutput();\r
305         OutputPart commonPart = multipart.addPart(vocabulary, MediaType.APPLICATION_XML_TYPE);\r
306         commonPart.getHeaders().add("label", client.getCommonPartName());\r
307 \r
308         if(logger.isDebugEnabled()){\r
309                 logger.debug("to be created, vocabulary common ",\r
310                                         vocabulary, VocabulariesCommon.class);\r
311         }\r
312 \r
313         return multipart;\r
314     }\r
315 \r
316     private MultipartOutput createVocabularyItemInstance(\r
317                 String inVocabulary, String displayName, String refName) {\r
318         VocabularyitemsCommon vocabularyItem = new VocabularyitemsCommon();\r
319         vocabularyItem.setInVocabulary(inVocabulary);\r
320         vocabularyItem.setDisplayName(displayName);\r
321         vocabularyItem.setRefName(refName);\r
322         MultipartOutput multipart = new MultipartOutput();\r
323         OutputPart commonPart = multipart.addPart(vocabularyItem, MediaType.APPLICATION_XML_TYPE);\r
324         commonPart.getHeaders().add("label", client.getItemCommonPartName());\r
325 \r
326         if(logger.isDebugEnabled()){\r
327                 logger.debug("to be created, vocabularyitem common ", vocabularyItem, VocabularyitemsCommon.class);\r
328         }\r
329 \r
330         return multipart;\r
331     }\r
332 \r
333     // Retrieve individual fields of vocabulary records.\r
334 \r
335     private String displayAllVocabularies(VocabulariesCommonList list) {\r
336         StringBuffer sb = new StringBuffer();\r
337             List<VocabulariesCommonList.VocabularyListItem> vocabularies =\r
338                     list.getVocabularyListItem();\r
339             int i = 0;\r
340         for (VocabulariesCommonList.VocabularyListItem vocabulary : vocabularies) {\r
341             sb.append("vocabulary [" + i + "]" + "\n");\r
342             sb.append(displayVocabularyDetails(vocabulary));\r
343             i++;\r
344         }\r
345         return sb.toString();\r
346     }\r
347 \r
348     private String displayVocabularyDetails(\r
349         VocabulariesCommonList.VocabularyListItem vocabulary) {\r
350             StringBuffer sb = new StringBuffer();\r
351             sb.append("displayName=" + vocabulary.getDisplayName() + "\n");\r
352             sb.append("vocabType=" + vocabulary.getVocabType() + "\n");\r
353             // sb.append("csid=" + vocabulary.getCsid() + "\n");\r
354             sb.append("URI=" + vocabulary.getUri() + "\n");\r
355         return sb.toString();\r
356     }\r
357 \r
358     // Retrieve individual fields of vocabulary item records.\r
359 \r
360     private String displayAllVocabularyItems(VocabularyitemsCommonList list) {\r
361         StringBuffer sb = new StringBuffer();\r
362         List<VocabularyitemsCommonList.VocabularyitemListItem> items =\r
363                 list.getVocabularyitemListItem();\r
364         int i = 0;\r
365         for (VocabularyitemsCommonList.VocabularyitemListItem item : items) {\r
366             sb.append("vocabulary item [" + i + "]" + "\n");\r
367             sb.append(displayVocabularyItemDetails(item));\r
368             i++;\r
369         }\r
370         return sb.toString();\r
371     }\r
372 \r
373     private String displayVocabularyItemDetails(\r
374         VocabularyitemsCommonList.VocabularyitemListItem item) {\r
375             StringBuffer sb = new StringBuffer();\r
376             sb.append("csid=" + item.getCsid() + "\n");\r
377             sb.append("displayName=" + item.getDisplayName() + "\n");\r
378             // sb.append("URI=" + item.getUri() + "\n");\r
379         return sb.toString();\r
380     }\r
381 \r
382     private Object extractPart(MultipartInput input, String label,\r
383         Class clazz) throws Exception {\r
384         Object obj = null;\r
385         for(InputPart part : input.getParts()){\r
386             String partLabel = part.getHeaders().getFirst("label");\r
387             if(label.equalsIgnoreCase(partLabel)){\r
388                 String partStr = part.getBodyAsString();\r
389                 if(logger.isDebugEnabled()){\r
390                     logger.debug("extracted part str=\n" + partStr);\r
391                 }\r
392                 obj = part.getBody(clazz, null);\r
393                 if(logger.isDebugEnabled()){\r
394                     logger.debug("extracted part obj=\n", obj, clazz);\r
395                 }\r
396                 break;\r
397             }\r
398         }\r
399         return obj;\r
400     }\r
401 \r
402     /**\r
403      * Returns an error message indicating that the status code returned by a\r
404      * specific call to a service does not fall within a set of valid status\r
405      * codes for that service.\r
406      *\r
407      * @param serviceRequestType  A type of service request (e.g. CREATE, DELETE).\r
408      *\r
409      * @param statusCode  The invalid status code that was returned in the response,\r
410      *                    from submitting that type of request to the service.\r
411      *\r
412      * @return An error message.\r
413      */\r
414     protected String invalidStatusCodeMessage(ServiceRequestType requestType, int statusCode) {\r
415         return "Status code '" + statusCode + "' in response is NOT within the expected set: " +\r
416                 requestType.validStatusCodesAsString();\r
417     }\r
418 \r
419     protected String extractId(ClientResponse<Response> res) {\r
420         MultivaluedMap<String, Object> mvm = res.getMetadata();\r
421         String uri = (String) ((ArrayList<Object>) mvm.get("Location")).get(0);\r
422         if(logger.isDebugEnabled()){\r
423                 logger.info("extractId:uri=" + uri);\r
424         }\r
425         String[] segments = uri.split("/");\r
426         String id = segments[segments.length - 1];\r
427         if(logger.isDebugEnabled()){\r
428                 logger.debug("id=" + id);\r
429         }\r
430         return id;\r
431     }\r
432     \r
433     protected String createRefName(String displayName) {\r
434         return displayName.replaceAll("\\W", "");\r
435     }\r
436 \r
437         public static void main(String[] args) {\r
438 \r
439         // Configure logging.\r
440                 BasicConfigurator.configure();\r
441 \r
442         logger.info("VocabularyBaseImport starting...");\r
443 \r
444                 Sample vbi = new Sample();\r
445         VocabulariesCommonList vocabularies;\r
446         List<String> vocabIds;\r
447         String details = "";\r
448 \r
449         // Optionally delete all vocabularies and vocabulary items.\r
450 \r
451         boolean ENABLE_DELETE_ALL = false;\r
452         if (ENABLE_DELETE_ALL) {\r
453 \r
454             logger.info("Deleting all vocabulary items and vocabularies ...");\r
455 \r
456             // For each vocabulary ...\r
457             vocabularies = vbi.readVocabularies();\r
458             vocabIds = vbi.readVocabularyIds(vocabularies);\r
459             for (String vocabId : vocabIds) {\r
460                 logger.info("Deleting all vocabulary items for vocabulary ...");\r
461                 vbi.deleteAllItemsForVocab(vocabId);\r
462                 logger.info("Deleting vocabulary ...");\r
463                 vbi.deleteVocabulary(vocabId);\r
464             }\r
465 \r
466             logger.info("Reading vocabularies after deletion ...");\r
467             vocabularies = vbi.readVocabularies();\r
468             details = vbi.displayAllVocabularies(vocabularies);\r
469             logger.info(details);\r
470 \r
471             logger.info("Reading items in each vocabulary after deletion ...");\r
472             vocabIds = vbi.readVocabularyIds(vocabularies);\r
473             for (String vocabId : vocabIds) {\r
474                 VocabularyitemsCommonList items = vbi.readItemsInVocab(vocabId);\r
475                 details = vbi.displayAllVocabularyItems(items);\r
476                 logger.info(details);\r
477             }\r
478 \r
479         }\r
480 \r
481         // Create new vocabularies, each populated with vocabulary items.\r
482 \r
483                 final String acquisitionMethodsVocabName = "Acquisition Methods";\r
484                 final String entryMethodsVocabName = "Entry Methods";\r
485                 final String entryReasonsVocabName = "Entry Reasons";\r
486                 final String responsibleDeptsVocabName = "Responsible Departments";\r
487 \r
488                 List<String> acquisitionMethodsEnumValues = \r
489                         Arrays.asList("Gift","Purchase","Exchange","Transfer","Treasure");\r
490                 List<String> entryMethodsEnumValues = \r
491                         Arrays.asList("In person","Post","Found on doorstep");\r
492                 List<String> entryReasonsEnumValues = \r
493                         Arrays.asList("Enquiry","Commission","Loan");\r
494                 List<String> respDeptNamesEnumValues = \r
495                         Arrays.asList("Antiquities","Architecture and Design","Decorative Arts",\r
496                                                                         "Ethnography","Herpetology","Media and Performance Art",\r
497                                                                         "Paintings and Sculpture","Paleobotany","Photographs",\r
498                                                                         "Prints and Drawings");\r
499         \r
500                 vbi.createEnumeration(acquisitionMethodsVocabName, acquisitionMethodsEnumValues);\r
501                 vbi.createEnumeration(entryMethodsVocabName, entryMethodsEnumValues);\r
502                 vbi.createEnumeration(entryReasonsVocabName, entryReasonsEnumValues);\r
503                 vbi.createEnumeration(responsibleDeptsVocabName, respDeptNamesEnumValues);\r
504 \r
505                 logger.info("VocabularyBaseImport complete.");\r
506 \r
507         logger.info("Reading vocabularies and items ...");\r
508         // Get a list of vocabularies.\r
509         vocabularies = vbi.readVocabularies();\r
510         // For each vocabulary ...\r
511         for (VocabulariesCommonList.VocabularyListItem\r
512             vocabulary : vocabularies.getVocabularyListItem()) {\r
513             // Get its display name.\r
514             logger.info(vocabulary.getDisplayName());\r
515             // Get a list of the vocabulary items in this vocabulary.\r
516             VocabularyitemsCommonList items =\r
517                 vbi.readItemsInVocab(vocabulary.getCsid());\r
518             // For each vocabulary item ...\r
519             for (VocabularyitemsCommonList.VocabularyitemListItem\r
520                 item : items.getVocabularyitemListItem()) {\r
521                 // Get its display name.\r
522                 logger.info(" " + item.getDisplayName());\r
523             }\r
524         }\r
525 \r
526         // Sample alternate methods of reading all vocabularies and\r
527         // vocabulary items separately.\r
528         boolean RUN_ADDITIONAL_SAMPLES = false;\r
529         if (RUN_ADDITIONAL_SAMPLES) {\r
530 \r
531             logger.info("Reading all vocabularies ...");\r
532             details = vbi.displayAllVocabularies(vocabularies);\r
533             logger.info(details);\r
534 \r
535             logger.info("Reading all vocabulary items ...");\r
536             vocabIds = vbi.readVocabularyIds(vocabularies);\r
537             for (String vocabId : vocabIds) {\r
538                 VocabularyitemsCommonList items = vbi.readItemsInVocab(vocabId);\r
539                 details = vbi.displayAllVocabularyItems(items);\r
540                 logger.info(details);\r
541             }\r
542 \r
543         }\r
544 \r
545         }\r
546 \r
547 }\r