]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
71119a652065e3907fd3583c7411ce6ed38ac456
[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.organization.client.sample;\r
25 \r
26 import java.util.ArrayList;\r
27 import java.util.Arrays;\r
28 import java.util.HashMap;\r
29 import java.util.List;\r
30 import java.util.Map;\r
31 \r
32 import javax.ws.rs.core.MediaType;\r
33 import javax.ws.rs.core.MultivaluedMap;\r
34 import javax.ws.rs.core.Response;\r
35 \r
36 import org.apache.log4j.BasicConfigurator;\r
37 import org.collectionspace.services.OrganizationJAXBSchema;\r
38 import org.collectionspace.services.client.OrgAuthorityClient;\r
39 import org.collectionspace.services.client.OrgAuthorityClientUtils;\r
40 import org.collectionspace.services.client.test.ServiceRequestType;\r
41 import org.collectionspace.services.organization.OrgauthoritiesCommon;\r
42 import org.collectionspace.services.organization.OrgauthoritiesCommonList;\r
43 import org.collectionspace.services.organization.OrganizationsCommon;\r
44 import org.collectionspace.services.organization.OrganizationsCommonList;\r
45 import org.jboss.resteasy.client.ClientResponse;\r
46 import org.jboss.resteasy.plugins.providers.multipart.InputPart;\r
47 import org.jboss.resteasy.plugins.providers.multipart.OutputPart;\r
48 import org.slf4j.Logger;\r
49 import org.slf4j.LoggerFactory;\r
50 \r
51 /**\r
52  * OrgAuthority Sample, carries out tests against a\r
53  * deployed and running OrgAuthority Service.\r
54  *\r
55  * $LastChangedRevision: 1055 $\r
56  * $LastChangedDate: 2009-12-09 12:25:15 -0800 (Wed, 09 Dec 2009) $\r
57  */\r
58 public class Sample {\r
59     private static final Logger logger =\r
60         LoggerFactory.getLogger(Sample.class);\r
61 \r
62     // Instance variables specific to this test.\r
63     private OrgAuthorityClient client = new OrgAuthorityClient();\r
64     final String SERVICE_PATH_COMPONENT = "organizations";\r
65     final String ITEM_SERVICE_PATH_COMPONENT = "items";\r
66 \r
67 \r
68     // ---------------------------------------------------------------\r
69     // Create\r
70     // ---------------------------------------------------------------\r
71     protected String createOrgAuthRefName(String orgAuthorityName) {\r
72         return "urn:cspace:org.collectionspace.demo:orgauthority:name("\r
73                         +orgAuthorityName+")";\r
74     }\r
75 \r
76     protected String createOrganizationRefName(\r
77                                                 String orgAuthRefName, String orgName) {\r
78         return orgAuthRefName+":organization:name("+orgName+")";\r
79     }\r
80 \r
81     \r
82 \r
83     public void createOrgAuthority(String orgAuthName, List<Map<String,String>> orgInfos ) {\r
84 \r
85         // Expected status code: 201 Created\r
86         int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode();\r
87         // Type of service request being tested\r
88         ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE;\r
89 \r
90         logger.info("Import: Create orgAuthority: \"" + orgAuthName +"\"");\r
91         String baseOrgAuthRefName = createOrgAuthRefName(orgAuthName);\r
92         String fullOrgAuthRefName = baseOrgAuthRefName+"'"+orgAuthName+"'";\r
93         PoxPayloadOut multipart = \r
94                 OrgAuthorityClientUtils.createOrgAuthorityInstance(\r
95                                 orgAuthName, fullOrgAuthRefName, \r
96                                 client.getCommonPartName());\r
97         ClientResponse<Response> res = client.create(multipart);\r
98 \r
99         int statusCode = res.getStatus();\r
100 \r
101         if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
102                 throw new RuntimeException("Could not create enumeration: \""+orgAuthName\r
103                                 +"\" "+ OrgAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
104         }\r
105         if(statusCode != EXPECTED_STATUS_CODE) {\r
106                 throw new RuntimeException("Unexpected Status when creating enumeration: \""\r
107                                 +orgAuthName +"\", Status:"+ statusCode);\r
108         }\r
109 \r
110         // Store the ID returned from this create operation\r
111         // for additional tests below.\r
112         String newOrgAuthId = OrgAuthorityClientUtils.extractId(res);\r
113         logger.info("Import: Created orgAuthority: \"" + orgAuthName +"\" ID:"\r
114                                 +newOrgAuthId );\r
115         \r
116         // Add items to the orgAuthority\r
117         for(Map<String,String> orgInfo : orgInfos){\r
118                 createItemInOrgAuth(newOrgAuthId, baseOrgAuthRefName, orgInfo);\r
119         }\r
120         \r
121     }\r
122     \r
123     private String createItemInOrgAuth(String vcsid, \r
124                 String orgAuthorityRefName, Map<String,String> orgInfo) {\r
125         // Expected status code: 201 Created\r
126         int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode();\r
127         // Type of service request being tested\r
128         ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE;\r
129         String shortName = orgInfo.get(OrganizationJAXBSchema.SHORT_NAME);\r
130         String refName = createOrganizationRefName(\r
131                                                 orgAuthorityRefName, shortName)+"'"+shortName+"'";\r
132 \r
133 \r
134         logger.info("Import: Create Item: \""+shortName+\r
135                         "\" in orgAuthority: \"" + orgAuthorityRefName +"\"");\r
136         PoxPayloadOut multipart = \r
137                 OrgAuthorityClientUtils.createOrganizationInstance( vcsid, \r
138                                 refName, orgInfo, client.getItemCommonPartName() );\r
139 \r
140         ClientResponse<Response> res = client.createItem(vcsid, multipart);\r
141 \r
142         int statusCode = res.getStatus();\r
143 \r
144         if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
145                 throw new RuntimeException("Could not create Item: \""+shortName\r
146                                 +"\" in orgAuthority: \"" + orgAuthorityRefName\r
147                                 +"\" "+ OrgAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
148         }\r
149         if(statusCode != EXPECTED_STATUS_CODE) {\r
150                 throw new RuntimeException("Unexpected Status when creating Item: \""+shortName\r
151                                 +"\" in orgAuthority: \"" + orgAuthorityRefName +\r
152                                 "\", Status:"+ statusCode);\r
153         }\r
154 \r
155         return OrgAuthorityClientUtils.extractId(res);\r
156     }\r
157 \r
158 \r
159    // ---------------------------------------------------------------\r
160    // Read\r
161    // ---------------------------------------------------------------\r
162 \r
163    private OrgauthoritiesCommonList readOrgAuthorities() {\r
164 \r
165         // Expected status code: 200 OK\r
166         int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();\r
167         // Type of service request being tested\r
168         ServiceRequestType REQUEST_TYPE = ServiceRequestType.READ;\r
169 \r
170         // Submit the request to the service and store the response.\r
171         ClientResponse<OrgauthoritiesCommonList> res = client.readList();\r
172         OrgauthoritiesCommonList list = res.getEntity();\r
173 \r
174         int statusCode = res.getStatus();\r
175         if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
176                 throw new RuntimeException("Could not read list of orgAuthorities: "\r
177                 + OrgAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
178         }\r
179         if(statusCode != EXPECTED_STATUS_CODE) {\r
180                 throw new RuntimeException("Unexpected Status when reading " +\r
181                 "list of orgAuthorities, Status:"+ statusCode);\r
182         }\r
183 \r
184         return list;\r
185    }\r
186 \r
187     private List<String> readOrgAuthorityIds(OrgauthoritiesCommonList list) {\r
188 \r
189         List<String> ids = new ArrayList<String>();\r
190         List<OrgauthoritiesCommonList.OrgauthorityListItem> orgAuthorities =\r
191             list.getOrgauthorityListItem();\r
192         for (OrgauthoritiesCommonList.OrgauthorityListItem orgAuthority : orgAuthorities) {\r
193             ids.add(orgAuthority.getCsid());\r
194         }\r
195         return ids;\r
196    }\r
197     \r
198    private OrgauthoritiesCommon readOrgAuthority(String orgAuthId) {\r
199 \r
200         // Expected status code: 200 OK\r
201         int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();\r
202         // Type of service request being tested\r
203         ServiceRequestType REQUEST_TYPE = ServiceRequestType.READ;\r
204 \r
205         // Submit the request to the service and store the response.\r
206         OrgauthoritiesCommon orgAuthority = null;\r
207         try {\r
208             ClientResponse<PoxPayloadIn> res = client.read(orgAuthId);\r
209             int statusCode = res.getStatus();\r
210             if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
211                 throw new RuntimeException("Could not read orgAuthority"\r
212                     + OrgAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
213             }\r
214             if(statusCode != EXPECTED_STATUS_CODE) {\r
215                 throw new RuntimeException("Unexpected Status when reading " +\r
216                     "orgAuthority, Status:"+ statusCode);\r
217             }\r
218             PoxPayloadIn input = (PoxPayloadIn) res.getEntity();\r
219             orgAuthority = (OrgauthoritiesCommon) extractPart(input,\r
220                     client.getCommonPartName(), OrgauthoritiesCommon.class);\r
221         } catch (Exception e) {\r
222             throw new RuntimeException("Could not read orgAuthority: ", e);\r
223         }\r
224 \r
225         return orgAuthority;\r
226     }\r
227 \r
228     private OrganizationsCommonList readItemsInOrgAuth(String orgAuthId) {\r
229 \r
230         // Expected status code: 200 OK\r
231         int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();\r
232         // Type of service request being tested\r
233         ServiceRequestType REQUEST_TYPE = ServiceRequestType.READ;\r
234 \r
235         // Submit the request to the service and store the response.\r
236 \r
237         //was: ClientResponse<OrganizationsCommonList> res = client.readItemList(orgAuthId);\r
238         //new API: readItemList(String inAuthority, String partialTerm, String keywords)\r
239         ClientResponse<OrganizationsCommonList> res = client.readItemList(orgAuthId, "", "");//TODO:   .New call, most certainly wrong.  Just trying to get this to compile. Laramie20100728\r
240 \r
241         OrganizationsCommonList list = res.getEntity();\r
242 \r
243         int statusCode = res.getStatus();\r
244 \r
245         if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
246                 throw new RuntimeException("Could not read items in orgAuthority: "\r
247                 + OrgAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
248         }\r
249         if(statusCode != EXPECTED_STATUS_CODE) {\r
250                 throw new RuntimeException("Unexpected Status when reading " +\r
251                 "items in orgAuthority, Status:"+ statusCode);\r
252         }\r
253 \r
254         return list;\r
255     }\r
256 \r
257     private List<String> readOrganizationIds(OrganizationsCommonList list) {\r
258 \r
259         List<String> ids = new ArrayList<String>();\r
260         List<OrganizationsCommonList.OrganizationListItem> items =\r
261             list.getOrganizationListItem();\r
262         for (OrganizationsCommonList.OrganizationListItem item : items) {\r
263             ids.add(item.getCsid());\r
264         }\r
265         return ids;\r
266    }\r
267 \r
268     // ---------------------------------------------------------------\r
269     // Delete\r
270     // ---------------------------------------------------------------\r
271 \r
272     private void deleteOrgAuthority(String vcsid) {\r
273          // Expected status code: 200 OK\r
274         int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();\r
275         // Type of service request being tested\r
276         ServiceRequestType REQUEST_TYPE = ServiceRequestType.DELETE;\r
277 \r
278         ClientResponse<Response> res = client.delete(vcsid);\r
279         int statusCode = res.getStatus();\r
280 \r
281         if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
282                 throw new RuntimeException("Could not delete orgAuthority: "\r
283                 + OrgAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
284         }\r
285         if(statusCode != EXPECTED_STATUS_CODE) {\r
286                 throw new RuntimeException("Unexpected Status when deleting " +\r
287                 "orgAuthority, Status:"+ statusCode);\r
288         }\r
289     }\r
290 \r
291     private void deleteAllOrgAuthorities() {\r
292         List<String> ids = readOrgAuthorityIds(readOrgAuthorities());\r
293         for (String id : ids) {\r
294             deleteOrgAuthority(id);\r
295         }\r
296     }\r
297 \r
298         private void deleteOrganization(String vcsid, String itemcsid) {\r
299          // Expected status code: 200 OK\r
300         int EXPECTED_STATUS_CODE = Response.Status.OK.getStatusCode();\r
301         // Type of service request being tested\r
302         ServiceRequestType REQUEST_TYPE = ServiceRequestType.DELETE;\r
303 \r
304         ClientResponse<Response> res = client.deleteItem(vcsid, itemcsid);\r
305         int statusCode = res.getStatus();\r
306 \r
307         if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
308                 throw new RuntimeException("Could not delete orgAuthority item: "\r
309                 + OrgAuthorityClientUtils.invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
310         }\r
311         if(statusCode != EXPECTED_STATUS_CODE) {\r
312                 throw new RuntimeException("Unexpected Status when deleting " +\r
313                 "orgAuthority item, Status:"+ statusCode);\r
314         }\r
315     }\r
316 \r
317     private void deleteAllItemsForOrgAuth(String orgAuthId) {\r
318         List<String> itemIds = readOrganizationIds(readItemsInOrgAuth(orgAuthId));\r
319         for (String itemId : itemIds) {\r
320             deleteOrganization(orgAuthId, itemId);\r
321         }\r
322     }\r
323 \r
324     // ---------------------------------------------------------------\r
325     // Utility methods used by tests above\r
326     // ---------------------------------------------------------------\r
327 \r
328 \r
329     // Retrieve individual fields of orgAuthority records.\r
330 \r
331     private String displayAllOrgAuthorities(OrgauthoritiesCommonList list) {\r
332         StringBuffer sb = new StringBuffer();\r
333             List<OrgauthoritiesCommonList.OrgauthorityListItem> orgAuthorities =\r
334                     list.getOrgauthorityListItem();\r
335             int i = 0;\r
336         for (OrgauthoritiesCommonList.OrgauthorityListItem orgAuthority : orgAuthorities) {\r
337             sb.append("orgAuthority [" + i + "]" + "\n");\r
338             sb.append(displayOrgAuthorityDetails(orgAuthority));\r
339             i++;\r
340         }\r
341         return sb.toString();\r
342     }\r
343 \r
344     private String displayOrgAuthorityDetails(\r
345         OrgauthoritiesCommonList.OrgauthorityListItem orgAuthority) {\r
346             StringBuffer sb = new StringBuffer();\r
347             sb.append("displayName=" + orgAuthority.getDisplayName() + "\n");\r
348             sb.append("vocabType=" + orgAuthority.getVocabType() + "\n");\r
349             // sb.append("csid=" + orgAuthority.getCsid() + "\n");\r
350             sb.append("URI=" + orgAuthority.getUri() + "\n");\r
351         return sb.toString();\r
352     }\r
353 \r
354     // Retrieve individual fields of organization records.\r
355 \r
356     private String displayAllOrganizations(OrganizationsCommonList list) {\r
357         StringBuffer sb = new StringBuffer();\r
358         List<OrganizationsCommonList.OrganizationListItem> items =\r
359                 list.getOrganizationListItem();\r
360         int i = 0;\r
361         for (OrganizationsCommonList.OrganizationListItem item : items) {\r
362             sb.append("organization [" + i + "]" + "\n");\r
363             sb.append(displayOrganizationDetails(item));\r
364             i++;\r
365         }\r
366         return sb.toString();\r
367     }\r
368 \r
369     private String displayOrganizationDetails(\r
370         OrganizationsCommonList.OrganizationListItem item) {\r
371             StringBuffer sb = new StringBuffer();\r
372             sb.append("csid=" + item.getCsid() + "\n");\r
373             sb.append("displayName=" + item.getDisplayName() + "\n");\r
374             // sb.append("URI=" + item.getUri() + "\n");\r
375         return sb.toString();\r
376     }\r
377 \r
378     private Object extractPart(PoxPayloadIn input, String label,\r
379         Class clazz) throws Exception {\r
380         Object obj = null;\r
381         for(InputPart part : input.getParts()){\r
382             String partLabel = part.getHeaders().getFirst("label");\r
383             if(label.equalsIgnoreCase(partLabel)){\r
384                 String partStr = part.getBodyAsString();\r
385                 if(logger.isDebugEnabled()){\r
386                     logger.debug("extracted part str=\n" + partStr);\r
387                 }\r
388                 obj = part.getBody(clazz, null);\r
389                 if(logger.isDebugEnabled()){\r
390                     logger.debug("extracted part obj=\n", obj, clazz);\r
391                 }\r
392                 break;\r
393             }\r
394         }\r
395         return obj;\r
396     }\r
397 \r
398         public static void main(String[] args) {\r
399 \r
400         // Configure logging.\r
401                 BasicConfigurator.configure();\r
402 \r
403         logger.info("OrgAuthority Sample starting...");\r
404 \r
405                 Sample sample = new Sample();\r
406         OrgauthoritiesCommonList orgAuthorities;\r
407         List<String> orgAuthIds;\r
408         String details = "";\r
409 \r
410         // Optionally delete all orgAuthorities and organizations.\r
411 \r
412         boolean ENABLE_DELETE_ALL = false;\r
413         if (ENABLE_DELETE_ALL) {\r
414 \r
415             logger.info("Deleting all organizations and orgAuthorities ...");\r
416 \r
417             // For each orgAuthority ...\r
418             orgAuthorities = sample.readOrgAuthorities();\r
419             orgAuthIds = sample.readOrgAuthorityIds(orgAuthorities);\r
420             for (String orgAuthId : orgAuthIds) {\r
421                 logger.info("Deleting all organizations for orgAuthority ...");\r
422                 sample.deleteAllItemsForOrgAuth(orgAuthId);\r
423                 logger.info("Deleting orgAuthority ...");\r
424                 sample.deleteOrgAuthority(orgAuthId);\r
425             }\r
426 \r
427             logger.info("Reading orgAuthorities after deletion ...");\r
428             orgAuthorities = sample.readOrgAuthorities();\r
429             details = sample.displayAllOrgAuthorities(orgAuthorities);\r
430             logger.info(details);\r
431 \r
432             logger.info("Reading items in each orgAuthority after deletion ...");\r
433             orgAuthIds = sample.readOrgAuthorityIds(orgAuthorities);\r
434             for (String orgAuthId : orgAuthIds) {\r
435                 OrganizationsCommonList items = sample.readItemsInOrgAuth(orgAuthId);\r
436                 details = sample.displayAllOrganizations(items);\r
437                 logger.info(details);\r
438             }\r
439 \r
440         }\r
441 \r
442         // Create new authorities, each populated with organizations.\r
443         Map<String, String> mmiOrgMap = new HashMap<String,String>();\r
444         mmiOrgMap.put(OrganizationJAXBSchema.SHORT_NAME, "MMI");\r
445         mmiOrgMap.put(OrganizationJAXBSchema.LONG_NAME, "Museum of the Moving Image");\r
446         //mmiOrgMap.put(OrganizationJAXBSchema.CONTACT_NAME, "Megan Forbes");\r
447         mmiOrgMap.put(OrganizationJAXBSchema.FOUNDING_DATE, "1984");\r
448         mmiOrgMap.put(OrganizationJAXBSchema.FOUNDING_PLACE, "Astoria, NY");\r
449         Map<String, String> pahmaOrgMap = new HashMap<String,String>();\r
450         pahmaOrgMap.put(OrganizationJAXBSchema.SHORT_NAME, "PAHMA");\r
451         pahmaOrgMap.put(OrganizationJAXBSchema.LONG_NAME, "Phoebe A. Hearst Museum of Anthropology");\r
452         pahmaOrgMap.put(OrganizationJAXBSchema.NAME_ADDITIONS, "University of California, Berkeley");\r
453         //pahmaOrgMap.put(OrganizationJAXBSchema.CONTACT_NAME, "Michael Black");\r
454         pahmaOrgMap.put(OrganizationJAXBSchema.FOUNDING_DATE, "1901");\r
455         pahmaOrgMap.put(OrganizationJAXBSchema.FOUNDING_PLACE, "Berkeley, CA");\r
456         Map<String, String> savoyOrgMap = new HashMap<String,String>();\r
457         savoyOrgMap.put(OrganizationJAXBSchema.SHORT_NAME, "Savoy Theatre");\r
458         savoyOrgMap.put(OrganizationJAXBSchema.FOUNDING_DATE, "1900");\r
459         savoyOrgMap.put(OrganizationJAXBSchema.DISSOLUTION_DATE, "1952");\r
460         savoyOrgMap.put(OrganizationJAXBSchema.FOUNDING_PLACE, "New York, NY");\r
461         List<Map<String, String>> orgMaps = \r
462                 Arrays.asList(mmiOrgMap, pahmaOrgMap, savoyOrgMap );\r
463         \r
464                 sample.createOrgAuthority("Sample Org Authority", orgMaps);\r
465 \r
466                 logger.info("OrgAuthority Sample complete.");\r
467 \r
468         logger.info("Reading orgAuthorities and items ...");\r
469         // Get a list of orgAuthorities.\r
470         orgAuthorities = sample.readOrgAuthorities();\r
471         // For each orgAuthority ...\r
472         for (OrgauthoritiesCommonList.OrgauthorityListItem\r
473             orgAuthority : orgAuthorities.getOrgauthorityListItem()) {\r
474             // Get its display name.\r
475             logger.info(orgAuthority.getDisplayName());\r
476             // Get a list of the organizations in this orgAuthority.\r
477             OrganizationsCommonList items =\r
478                 sample.readItemsInOrgAuth(orgAuthority.getCsid());\r
479             // For each organization ...\r
480             for (OrganizationsCommonList.OrganizationListItem\r
481                 item : items.getOrganizationListItem()) {\r
482                 // Get its display name.\r
483                 logger.info(" " + item.getDisplayName());\r
484             }\r
485         }\r
486 \r
487         // Sample alternate methods of reading all orgAuthorities and\r
488         // organizations separately.\r
489         boolean RUN_ADDITIONAL_SAMPLES = false;\r
490         if (RUN_ADDITIONAL_SAMPLES) {\r
491 \r
492             logger.info("Reading all orgAuthorities ...");\r
493             details = sample.displayAllOrgAuthorities(orgAuthorities);\r
494             logger.info(details);\r
495 \r
496             logger.info("Reading all organizations ...");\r
497             orgAuthIds = sample.readOrgAuthorityIds(orgAuthorities);\r
498             for (String orgAuthId : orgAuthIds) {\r
499                 OrganizationsCommonList items = sample.readItemsInOrgAuth(orgAuthId);\r
500                 details = sample.displayAllOrganizations(items);\r
501                 logger.info(details);\r
502             }\r
503 \r
504         }\r
505 \r
506         }\r
507 \r
508 }\r