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