GetStructuralUnit - LUMP CGI XML API to return the contents of a
    Structural Unit (and its children).

    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
    rooted at a particular Structural Unit specified by its ID.

    *username* - Name of user running this CGI script. Required unless web
    server authentication is in use (when it is, the web server
    authenticated user is used instead).
    *password* - Password for the user. This is only required if the web
    server is not handling the user authentication and if no security hash
    parameter is being given.
    *security_hash* - An opaque value used to authenticate the user without
    requiring the password to be sent. This value is generated by a previous
    execution of a LUMP API script and may well be time limited. It is only
    required if no password or webserver authentication is done.
    *act_as* - Users in the SysAdmins group can elect to act on the behalf
    of other users once they are themselves authenticated. If this parameter
    is present it should contain the username of the user that should be
    switched to if this option is available and the real user has been
    authenticated successfully. Optional.
    *session_id* - An opaque string as far as the server is concerned that
    is intended solely to allow async clients to differentiate different
    results more easily. Optional.

  Specific for this script
    *suid* - ID of the root Structural Unit for the tree that should be
    *format* - Name of display format to render the results with. If not
    specified, XML is returned.
    *levels* - Specify how many levels down to go from the given Structural
    Unit ID when expanding child Structural Units. By default no levels are
    descended. If a level of 1 given, all the child Structural Units of the
    specified Structural Unit will be returned as well. For 2, their child
    will be included, and so on. Asking for more levels than there actually
    are children is not considered to be an error (you just get the whole
    Structural Unit tree rooted at the Structural Unit with the given ID).
    *ignore* - Specifies a comma separated list of Structural Unit Type
    names which indicate Structural Units that should be ignored in the
    *include_deleted* - By default deleted Structural Units are ignored -
    setting this flag to 'Y' indicates that they should be included.
    *sort* - Provides sorting instructions. If specified it is a list
    separated by vertical bar ("|") characters where each list item is pair
    giving Structrual Unit Type name and Data Type name. The Structural Unit
    Type name can be given as '*', which applies to child Structural Units
    of any Structural Unit Type that doesn't have an explicit entry. These
    are used to find Data Element values which are then used in the
    comparison. For example, imagine you want to sort on the "Title" Data
    Elements in Book and Journal Article child Structural Units, the
    "Journal Title" in Journal child Structural Units and the "Name" in any
    other child Structural Units, you'd specify the sort parameters as
    "Book.Title|Journal Article.Title|Journal.Journal Title|*.Name". Note
    that child Structural Units that don't match any of the Data Types given
    (in this example ones that aren't using named Structural Unit Types and
    don't have any Data Elements of a Data Type called "Name") are left
    alone by the sort routine. This means that you can, for example, leave
    Notes interspersed in lists of Books, Journals, etc and just sort the
    little groups of Books, Journals, etc by title without affecting the
    order of the Notes. Also note the sorting criteria are case sensitive
    and have to match the case for Structural Unit Type and Data Type names.
    *sutsort* - Provides an ordering for Structural Unit Type names to be
    used in the output. This is applied after any Data Element based
    *sort*ing has been done. This parameter is a comma separated list of
    Structural Unit Type names - child Structural Units are then sorted into
    this order. If a Structural Unit is of a Structural Unit Type not given
    in this list it sent to the end of the list.

    The script returns an XML document in the standard LUMP response format
    (as documented in LUMP-XML-Response). The <returns> section's contents
    depends on the display format requested with the *format* parameter in
    the request. If this is specified (and isn't "XML") the <returns>
    element will contain a <rendered> element that contains the Structural
    Unit(s) rendered using the appropriated display format module(s). This
    means that in this case the value of the <rendered> element can often be
    transmitted straight into an output stream, DOM element, etc.

    The <returns> element also contains the XML structure following this DTD

     <!ELEMENT returns (su|rendered)>
     <!ELEMENT rendered (#PCDATA)>
     <!ELEMENT su (children|id|structural_unit_type_id|state|deleted|data+)>
     <!ELEMENT children (su+)>
     <!ELEMENT structural_unit_type_id (#PCDATA)>
     <!ELEMENT id (#PCDATA)>
     <!ELEMENT state (#PCDATA)>
     <!ELEMENT deleted (#PCDATA)>
     <!ELEMENT data (data_type|data_element)
     <!ELEMENT data_element (id|value|modified_time)>
     <!ELEMENT data_type (id|name|edit_representation|default_value|
     <!ELEMENT value (#PCDATA)>
     <!ELEMENT edit_representation (#PCDATA)>
     <!ELEMENT validation_pattern (#PCDATA)>
     <!ELEMENT repeatable (#PCDATA)>
     <!ELEMENT name (#PCDATA)>
     <!ELEMENT size (#PCDATA)>

    For example:

          <edit_representation>input text</edit_representation>
          <edit_representation>input text</edit_representation>
          <edit_representation>input text</edit_representation>
          <name>Module Name</name>
          <value>Advanced Human-Computer Integration</value>
          <edit_representation>input text</edit_representation>
          <name>Student Numbers</name>
          <edit_representation>input text</edit_representation>
          <name>Module Code</name>
          <edit_representation>input text</edit_representation>
          <name>Module Tutor</name>
          <value>Professor R S Kalawsky</value>

    The <error> section contains SUCCESS in the <error_code> if the
    operation finishes successfully, or a failure error code if it doesn't.
    The <error_message> element contains a human readable message that can
    be used to inform the user of problems if desired.



    Copyright 2009 Loughborough University Library <>.

    Permission is granted to copy, distribute and/or modify this document
    under the terms of the GNU Free Documentation License, Version 1.2 or
    any later version published by the Free Software Foundation; with no
    Invariant Sections, with no Front-Cover Texts, and with no Back-Cover

Go to Top