Display meeting detail

Note: See the sample files XMLApiAdapter.java, SCO.java, mymeetings.jsp, and showmeeting.jsp.

Most of the information you want to display about a meeting comes from sco-info :

https://example.com/api/xml?action=sco-info&sco-id=2006334909

The response has many values that you can display, for example:

<?xml version="1.0" encoding="utf-8" ?>  
<results> 
    <status code="ok" />  
    <sco account-id="624520" disabled="" display-seq="0"  
                folder-id="2006258747" icon="producer" lang="en" max-retries="" 
                sco-id="2006334909" source-sco-id="" type="content" version="1"> 
        <date-created>2006-05-11T12:00:02.000-07:00</date-created>  
        <date-modified>2006-05-16T15:22:25.703-07:00</date-modified>  
        <name>Test Quiz</name>  
        <url-path>/quiz/</url-path>  
        <passing-score>10</passing-score>  
        <duration>15100.0</duration>  
        <section-count>6</section-count>  
    </sco> 
</results>

Get information about a SCO

The getSco Java method makes the call to sco-info and parses the result, storing values in variables so that you can display them in a user interface:

public SCO getSco(String scoId) throws XMLApiException { 
        try { 
            Element e = scoInfo(scoId); 
            if(!"ok".equalsIgnoreCase(codePath.valueOf(e))) 
                return null; 
            Element sco = (Element) XPath.selectSingleNode(e, "//sco"); 
        ...

Construct the URL to the meeting room

You also need to create the URL to the meeting room. You can do this with a call to sco-info and another to sco-shortcuts :

https://example.com/api/xml?action=sco-info&sco-id=2006258750  
https://example.com/api/xml?action=sco-shortcuts

Extract the url-path from the sco-info response. Then, extract the domain-name from the sco-shortcuts response and concatenate the two values:

<?xml version="1.0" encoding="utf-8" ?>  
<results> 
    <status code="ok" />  
    <shortcuts> 
        <sco tree-id="4930295" sco-id="2006258748" type="my-courses"> 
            <domain-name>http://example.com</domain-name>  
        </sco> 
        ..

You can also use a single call to report-my-meetings if the user is logged in and the meeting is in the user’s my-meetings folder:

https://example.com/api/xml?action=report-my-meetings

In this case, extract both the domain-name and url-path from the report-my-meetings response.

The scoUrl Java method constructs the URL by calling sco-info to retrieve the url-path and then sco-shortcuts to retrieve the domain-name . In this case, two calls are used so that you do not need to make the assumption that the meeting is in the current user’s my-meetings folder:

public String scoUrl(String scoId) throws XMLApiException { 
    try { 
        Element e = request("sco-info", "sco-id=" + scoId); 
        if(!(codePath.valueOf(e).equalsIgnoreCase("ok"))) 
                return ""; 
        XPath xpath = XPath.newInstance("//url-path/text()"); 
        String path = ((Text) xpath.selectSingleNode(e)).getText(); 
 
        e = request("sco-shortcuts", null); 
        xpath = XPath.newInstance("//domain-name/text()"); 
        String url = ((Text) xpath.selectSingleNode(e)).getText(); 
 
        return url + "/" + path.substring(1) + "?session=" + breezesession; 
    } catch (JDOMException jde) { 
            throw new XMLApiException(PARSE_ERROR, jde); 
    }  
}  

// Ethnio survey code removed