{"id":973,"date":"2011-06-07T15:08:04","date_gmt":"2011-06-07T15:08:04","guid":{"rendered":"https:\/\/copyright.lboro.ac.uk\/lorls\/?page_id=973"},"modified":"2011-06-07T15:08:04","modified_gmt":"2011-06-07T15:08:04","slug":"getstructuralunit","status":"publish","type":"page","link":"https:\/\/blog.lboro.ac.uk\/lorls\/documentation\/integration\/lumps-apis\/getstructuralunit","title":{"rendered":"GetStructuralUnit"},"content":{"rendered":"<pre>NAME\n    GetStructuralUnit - LUMP CGI XML API to return the contents of a\n    Structural Unit (and its children).\n\nDESCRIPTION\n    The GetStructuralUnit CGI script is designed to allow Structural Units\n    held in a LUMP database to be returned in an XML container format. The\n    script can return a tree of Structural Units to an arbitrary depth\n    rooted at a particular Structural Unit specified by its ID.\n\nPARAMETERS\n  Standard\n    *username* - Name of user running this CGI script. Required unless web\n    server authentication is in use (when it is, the web server\n    authenticated user is used instead).\n    *password* - Password for the user. This is only required if the web\n    server is not handling the user authentication and if no security hash\n    parameter is being given.\n    *security_hash* - An opaque value used to authenticate the user without\n    requiring the password to be sent. This value is generated by a previous\n    execution of a LUMP API script and may well be time limited. It is only\n    required if no password or webserver authentication is done.\n    *act_as* - Users in the SysAdmins group can elect to act on the behalf\n    of other users once they are themselves authenticated. If this parameter\n    is present it should contain the username of the user that should be\n    switched to if this option is available and the real user has been\n    authenticated successfully. Optional.\n    *session_id* - An opaque string as far as the server is concerned that\n    is intended solely to allow async clients to differentiate different\n    results more easily. Optional.\n\n  Specific for this script\n    *suid* - ID of the root Structural Unit for the tree that should be\n    returned.\n    *format* - Name of display format to render the results with. If not\n    specified, XML is returned.\n    *levels* - Specify how many levels down to go from the given Structural\n    Unit ID when expanding child Structural Units. By default no levels are\n    descended. If a level of 1 given, all the child Structural Units of the\n    specified Structural Unit will be returned as well. For 2, their child\n    will be included, and so on. Asking for more levels than there actually\n    are children is not considered to be an error (you just get the whole\n    Structural Unit tree rooted at the Structural Unit with the given ID).\n    *ignore* - Specifies a comma separated list of Structural Unit Type\n    names which indicate Structural Units that should be ignored in the\n    output.\n    *include_deleted* - By default deleted Structural Units are ignored -\n    setting this flag to &apos;Y&apos; indicates that they should be included.\n    *sort* - Provides sorting instructions. If specified it is a list\n    separated by vertical bar (\"|\") characters where each list item is pair\n    giving Structrual Unit Type name and Data Type name. The Structural Unit\n    Type name can be given as &apos;*&apos;, which applies to child Structural Units\n    of any Structural Unit Type that doesn&apos;t have an explicit entry. These\n    are used to find Data Element values which are then used in the\n    comparison. For example, imagine you want to sort on the \"Title\" Data\n    Elements in Book and Journal Article child Structural Units, the\n    \"Journal Title\" in Journal child Structural Units and the \"Name\" in any\n    other child Structural Units, you&apos;d specify the sort parameters as\n    \"Book.Title|Journal Article.Title|Journal.Journal Title|*.Name\". Note\n    that child Structural Units that don&apos;t match any of the Data Types given\n    (in this example ones that aren&apos;t using named Structural Unit Types and\n    don&apos;t have any Data Elements of a Data Type called \"Name\") are left\n    alone by the sort routine. This means that you can, for example, leave\n    Notes interspersed in lists of Books, Journals, etc and just sort the\n    little groups of Books, Journals, etc by title without affecting the\n    order of the Notes. Also note the sorting criteria are case sensitive\n    and have to match the case for Structural Unit Type and Data Type names.\n    *sutsort* - Provides an ordering for Structural Unit Type names to be\n    used in the output. This is applied after any Data Element based\n    *sort*ing has been done. This parameter is a comma separated list of\n    Structural Unit Type names - child Structural Units are then sorted into\n    this order. If a Structural Unit is of a Structural Unit Type not given\n    in this list it sent to the end of the list.\n\nRESULTS\n    The script returns an XML document in the standard LUMP response format\n    (as documented in LUMP-XML-Response). The &lt;returns&gt; section&apos;s contents\n    depends on the display format requested with the *format* parameter in\n    the request. If this is specified (and isn&apos;t \"XML\") the &lt;returns&gt;\n    element will contain a &lt;rendered&gt; element that contains the Structural\n    Unit(s) rendered using the appropriated display format module(s). This\n    means that in this case the value of the &lt;rendered&gt; element can often be\n    transmitted straight into an output stream, DOM element, etc.\n\n    The &lt;returns&gt; element also contains the XML structure following this DTD\n    fragment:\n\n     &lt;!ELEMENT returns (su|rendered)&gt;\n     &lt;!ELEMENT rendered (#PCDATA)&gt;\n     &lt;!ELEMENT su (children|id|structural_unit_type_id|state|deleted|data+)&gt;\n     &lt;!ELEMENT children (su+)&gt;\n     &lt;!ELEMENT structural_unit_type_id (#PCDATA)&gt;\n     &lt;!ELEMENT id (#PCDATA)&gt;\n     &lt;!ELEMENT state (#PCDATA)&gt;\n     &lt;!ELEMENT deleted (#PCDATA)&gt;\n     &lt;!ELEMENT data (data_type|data_element)\n     &lt;!ELEMENT data_element (id|value|modified_time)&gt;\n     &lt;!ELEMENT data_type (id|name|edit_representation|default_value|\n        validation_pattern|repeatable|size)&gt;\n     &lt;!ELEMENT value (#PCDATA)&gt;\n     &lt;!ELEMENT edit_representation (#PCDATA)&gt;\n     &lt;!ELEMENT validation_pattern (#PCDATA)&gt;\n     &lt;!ELEMENT repeatable (#PCDATA)&gt;\n     &lt;!ELEMENT name (#PCDATA)&gt;\n     &lt;!ELEMENT size (#PCDATA)&gt;\n\n    For example:\n\n     &lt;response&gt;\n      &lt;returns&gt;\n       &lt;su&gt;\n        &lt;children&gt;\n         &lt;su&gt;\n          &lt;id&gt;350&lt;\/id&gt;\n          &lt;state&gt;published&lt;\/state&gt;\n          &lt;deleted&gt;N&lt;\/deleted&gt;\n         &lt;\/su&gt;\n        &lt;\/children&gt;\n        &lt;data&gt;\n         &lt;data_type&gt;\n          &lt;validation_pattern&gt;&lt;\/validation_pattern&gt;\n          &lt;edit_representation&gt;input text&lt;\/edit_representation&gt;\n          &lt;name&gt;Year&lt;\/name&gt;\n          &lt;id&gt;23&lt;\/id&gt;\n          &lt;repeatable&gt;N&lt;\/repeatable&gt;\n          &lt;size&gt;4&lt;\/size&gt;\n         &lt;\/data_type&gt;\n         &lt;data_element&gt;\n          &lt;value&gt;2006&lt;\/value&gt;\n          &lt;id&gt;1332&lt;\/id&gt;\n         &lt;\/data_element&gt;\n        &lt;\/data&gt;\n        &lt;data&gt;\n         &lt;data_type&gt;\n          &lt;validation_pattern&gt;&lt;\/validation_pattern&gt;\n          &lt;edit_representation&gt;input text&lt;\/edit_representation&gt;\n          &lt;name&gt;Semester&lt;\/name&gt;\n          &lt;id&gt;24&lt;\/id&gt;\n          &lt;repeatable&gt;N&lt;\/repeatable&gt;\n          &lt;size&gt;100&lt;\/size&gt;\n         &lt;\/data_type&gt;\n         &lt;data_element&gt;\n          &lt;value&gt;&lt;\/value&gt;\n          &lt;id&gt;1333&lt;\/id&gt;\n         &lt;\/data_element&gt;\n        &lt;\/data&gt;\n        &lt;data&gt;\n         &lt;data_type&gt;\n          &lt;validation_pattern&gt;&lt;\/validation_pattern&gt;\n          &lt;edit_representation&gt;input text&lt;\/edit_representation&gt;\n          &lt;name&gt;Module Name&lt;\/name&gt;\n          &lt;id&gt;25&lt;\/id&gt;\n          &lt;repeatable&gt;N&lt;\/repeatable&gt;\n          &lt;size&gt;100&lt;\/size&gt;\n         &lt;\/data_type&gt;\n         &lt;data_element&gt;\n          &lt;value&gt;Advanced Human-Computer Integration&lt;\/value&gt;\n          &lt;id&gt;1334&lt;\/id&gt;\n         &lt;\/data_element&gt;\n        &lt;\/data&gt;\n        &lt;data&gt;\n         &lt;data_type&gt;\n          &lt;validation_pattern&gt;&lt;\/validation_pattern&gt;\n          &lt;edit_representation&gt;input text&lt;\/edit_representation&gt;\n          &lt;name&gt;Student Numbers&lt;\/name&gt;\n          &lt;id&gt;27&lt;\/id&gt;\n          &lt;repeatable&gt;N&lt;\/repeatable&gt;\n          &lt;size&gt;10&lt;\/size&gt;\n         &lt;\/data_type&gt;\n         &lt;data_element&gt;\n          &lt;value&gt;0&lt;\/value&gt;\n          &lt;id&gt;1335&lt;\/id&gt;\n         &lt;\/data_element&gt;\n        &lt;\/data&gt;\n        &lt;data&gt;\n         &lt;data_type&gt;\n          &lt;validation_pattern&gt;dd[A-Z][A-Z][ABCPX]ddd&lt;\/validation_pattern&gt;\n          &lt;edit_representation&gt;input text&lt;\/edit_representation&gt;\n          &lt;name&gt;Module Code&lt;\/name&gt;\n          &lt;id&gt;28&lt;\/id&gt;\n          &lt;repeatable&gt;N&lt;\/repeatable&gt;\n          &lt;size&gt;10&lt;\/size&gt;\n         &lt;\/data_type&gt;\n         &lt;data_element&gt;\n          &lt;value&gt;06COC171&lt;\/value&gt;\n          &lt;id&gt;1336&lt;\/id&gt;\n         &lt;\/data_element&gt;\n        &lt;\/data&gt;\n        &lt;data&gt;\n         &lt;data_type&gt;\n          &lt;validation_pattern&gt;&lt;\/validation_pattern&gt;\n          &lt;edit_representation&gt;input text&lt;\/edit_representation&gt;\n          &lt;name&gt;Module Tutor&lt;\/name&gt;\n          &lt;id&gt;26&lt;\/id&gt;\n          &lt;repeatable&gt;Y&lt;\/repeatable&gt;\n          &lt;size&gt;100&lt;\/size&gt;\n         &lt;\/data_type&gt;\n         &lt;data_element&gt;\n          &lt;value&gt;Professor R S Kalawsky&lt;\/value&gt;\n          &lt;id&gt;1339&lt;\/id&gt;\n         &lt;\/data_element&gt;\n        &lt;\/data&gt;\n        &lt;id&gt;350&lt;\/id&gt;\n       &lt;\/su&gt;\n      &lt;\/returns&gt;\n      &lt;session&gt;\n       &lt;security_hash&gt;1248086710:a615619fd3d278c8a15154afade9ccec&lt;\/security_hash&gt;\n       &lt;lump_version&gt;1&lt;\/lump_version&gt;\n       &lt;acting_as&gt;&lt;\/acting_as&gt;\n      &lt;\/session&gt;\n      &lt;error&gt;\n       &lt;error_message&gt;Success&lt;\/error_message&gt;\n       &lt;error_code&gt;SUCCESS&lt;\/error_code&gt;\n      &lt;\/error&gt;\n     &lt;\/response&gt;\n\n    The &lt;error&gt; section contains SUCCESS in the &lt;error_code&gt; if the\n    operation finishes successfully, or a failure error code if it doesn&apos;t.\n    The &lt;error_message&gt; element contains a human readable message that can\n    be used to inform the user of problems if desired.\n\nSEE ALSO\n    FindSuid\n\n    LUMP-XML-Response\n\nCOPYRIGHT\n    Copyright 2009 Loughborough University Library &lt;library@lboro.ac.uk&gt;.\n\n    Permission is granted to copy, distribute and\/or modify this document\n    under the terms of the GNU Free Documentation License, Version 1.2 or\n    any later version published by the Free Software Foundation; with no\n    Invariant Sections, with no Front-Cover Texts, and with no Back-Cover\n    Texts.\n\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>NAME GetStructuralUnit &#8211; LUMP CGI XML API to return the contents of a Structural Unit (and its children). DESCRIPTION The GetStructuralUnit CGI script is designed to allow Structural Units held in a LUMP database to be returned in an XML container format. The script can return a tree of Structural Units to an arbitrary depth [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":125,"menu_order":4,"comment_status":"closed","ping_status":"closed","template":"page-col-1.php","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"class_list":["post-973","page","type-page","status-publish","hentry","count-0","even alt","author-lbjlclboro-ac-uk","last"],"_links":{"self":[{"href":"https:\/\/blog.lboro.ac.uk\/lorls\/wp-json\/wp\/v2\/pages\/973","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.lboro.ac.uk\/lorls\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/blog.lboro.ac.uk\/lorls\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/blog.lboro.ac.uk\/lorls\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.lboro.ac.uk\/lorls\/wp-json\/wp\/v2\/comments?post=973"}],"version-history":[{"count":0,"href":"https:\/\/blog.lboro.ac.uk\/lorls\/wp-json\/wp\/v2\/pages\/973\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/blog.lboro.ac.uk\/lorls\/wp-json\/wp\/v2\/pages\/125"}],"wp:attachment":[{"href":"https:\/\/blog.lboro.ac.uk\/lorls\/wp-json\/wp\/v2\/media?parent=973"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}