/**
 * Returns the RecTrac types associated with the chosen category
 *
 * @param string $category The five character category Type code from RecTrac
 * @return stdClass The JSON object from the response
 */
function cob_rectrac_types($category)
{
    $RECTRAC = variable_get('cob_rectrac_uri');
    $url = "{$RECTRAC}/types?format=json;category={$category}";
    $json = cob_http_get($url);
    return json_decode($json);
}
function cob_person_info($username)
{
    $DIRECTORY = variable_get('cob_directory_uri');
    $url = $DIRECTORY . '/people/view?format=json;username=' . $username;
    $json = cob_http_get($url);
    return json_decode($json);
}
示例#3
0
/**
 * Returns the share url for a node
 *
 * nodeRef should be in the form of:
 * workspace://SpacesStore/bbb3c8b2-3e13-4a23-b00a-3441f34c6a05
 *
 * @param  string $nodeRef An alfresco nodeRef
 * @return string
 */
function _cmisro_getShareUrl($nodeRef)
{
    $cmis = parse_url(variable_get('cmisro_url'));
    $user = variable_get('cmisro_username');
    $pass = variable_get('cmisro_password');
    $url = "{$cmis['scheme']}://{$user}:{$pass}@{$cmis['host']}/alfresco/service/api/sites/shareUrl?" . http_build_query(['nodeRef' => $nodeRef]);
    $response = cob_http_get($url);
    if ($response) {
        $json = json_decode($response);
        if ($json) {
            return $json->url;
        }
    }
}