ESciDoc Infrastructure XSD subresource

ESciDoc  Restricted Access to eSciDoc group

Harmonizing method behavior
Lists in XML-data of retrieve-methods are retuned differently. for example:
 * in item:
 * if there exists at least one "component" the surrounding element exist
 * if there exists no "component" the surrounding element is not contained in the XML-data
 * so the method "retrieveComponents"
 * returns a list of components if there is at least one component return: .... or
 * throws an exception if there is non


 * What do you mean if there is no component the method throws an exceptoin? (It is a regular case that item has no components at all) - same question for MD-records and relations (in fact 1 MD record is mandatory only). --Natasa 09:46, 14 April 2008 (CEST)
 * The problem is: If the subresource "components" is retrieved but there is no component in that item we can not deliver an empty components element (components element is only allowed if there is at least one component). Therefore the infrastructure must throw an exception. In opposition to subresources (as components, md-records etc.), for lists (e.g. of items, of organizational-units etc.) an empty list-element is allowed. Therefore if a list without any entry is retrieved the infrastructure deliveres an empty list element. Frank 10:08, 14 April 2008 (CEST)


 * same is true for "relations" and "MD-records"
 * in Organizational Unit:
 * if there exists at least one "parent" the surrounding element exist
 * if there exists no "parent" the surrounding element is contained in the XML-data but no entry in it
 * so the method "retrieveParents" returns
 * a list of parents if there is at least one parent return: ..... or
 * an empty list (but doesn't throw an exception)
 * the method "retrieveChildren" returns
 * a list of children if there is at least one child return:  ..... or
 * an empty list  (but doesn't throw an exception)

So the processing of the returned XML-data is differnet from mehtod to method even in one object.

our proposal for harmonizing the processing

 * 1) The XML-data will always contain the surrounding element even there is no entry
 * 2) retrieve methods of sub-resources and virtual resources will always return a list (which might be empty)
 * 3) In the XML-data of create- or update-methods the surrounding element would only be needed if there is a list entry otherwise it could be omitted.


 * Please provide a comparison of how is the current implementation in respect to the proposed one and some examples for all three proposals. There were update issues you were mentioning before e.g. there was a parent element "components" with single component. When during update we omit the element "component" but we leave the parent element "components" that was "understood" by the core method as deletion. Please the clarify if things will be changed and how. On the other hand, please clarify if the harmonization affects only item and organizational units or other resources as well? --Natasa 09:35, 14 April 2008 (CEST)


 * We would harmonize ALL resources as well. --kappus 11:28, 14 April 2008 (CEST)