Objs

Build 1501 on 14/Nov/2017  This topic last edited on: 22/Mar/2016, at 17:02

Description

Returns one or more object(s) in XML format

Parameters (* denotes an optional parameter)

There are seven possible parameters that apply to the Objs command. Only the ids parameter is mandatory, all others are optional.

ids

size

x

strict

nulls

counter

refkeys

Ids

A comma-separated list of database ids of the objects to return.

NOTE: If any of the specified ids does not exist or the object with that id has been spiked, the command returns an error.

Example: http://server/gnportal/do.ashx?cmd=objs&ids=2244,2248

Size*

An integer that defines the maximum size in bytes of the binary data content that is returned directly in the XML. The default is 0, that is, no binary data is returned directly, but is returned as a url. Use -1 for no size limit. If not specified, the binary data content is always returned as a URL.

Example 1: http://server/gnportal/do.ashx?cmd=objs&ids=27694&size=20000

In this example, any binary data attribute that is < 20000 bytes is returned directly in the browser.

<thumbnail id="data1354" mime="image/jpeg" size="6954">

 <data>/9j/7QKgUGhvdG9zaG9wIDMuMAA4QklNB...</data>

</thumbnail>

<preview id="data1355" mime="image/jpeg" size="88073">

 <url>http://localhost/tark4/do.ashx?Cmd=Data&DataId=1355</url>

</preview>

<data id="data1356" mime="image/jpeg" size="179719">

 <url>http://localhost/tark4/do.ashx?Cmd=Data&DataId=1356</url>

</data>

 

Example 2: http://server/gnportal/do.ashx?cmd=objs&ids=27694

This call returns each binary attribute as a url, since the default is 0.

<thumbnail id="data1354" mime="image/jpeg" size="6954">

 <url>http://localhost/tark4/do.ashx?Cmd=Data&DataId=1354</url>

</thumbnail>

<preview id="data1355" mime="image/jpeg" size="88073">

 <url>http://localhost/tark4/do.ashx?Cmd=Data&DataId=1355</url>

</preview>

<data id="data1356" mime="image/jpeg" size="179719">

 <url>http://localhost/tark4/do.ashx?Cmd=Data&DataId=1356</url>

</data>

X*

This optional string parameter contains the name of an XSL transformation to be applied to the XML. The XSL transformation must be loaded in the database. Note that it is just inserted as an XML instruction and applied by the browser.

Example: http://server/gnportal/do.ashx?cmd=help&x=docbook

This call displays the help file using a stylesheet named 'docbook'.

Strict*

This optional parameter requests strict access. The call fails if any of the requested attributes are not accessible.

Nulls*

When present, this option parameter requests that missing (null) object attributes be rendered as xsi:nil XML elements or empty XML attributes instead of omitting them from the results.

NOTE: Some attribute types, such as strings are not nullable, therefore they appear in the output as empty even when the null parameter is not present.

Example 1: http://server/gnportal/do.ashx?cmd=objs&ids=2244

<image xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
id="obj2244" name="image_09102621404497" 
creationDate="2009-10-26T20:40:45.133Z"
modifiedDate="2009-10-26T20:40:45.133Zauthor="" size="95450
pixWidth="200" pixHeight="300" resolutionX="200" resolutionY="200" 
width="2.53999996185303" height="3.80999994277954" 
headline="" country=""  colorUsage="cuGray"> 

 

Example 2: http://server/gnportal/do.ashx?cmd=objs&ids=2244&nulls=

<image xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
id="obj2244" name="image_09102621404497" 
creationDate="2009-10-26T20:40:45.133Z
modifiedDate="2009-10-26T20:40:45.133Z
author="" size="95450pixWidth="200" pixHeight="300" 
resolutionX="200" resolutionY="200" width="2.53999996185303" 
height="3.80999994277954" headline="" country="" countryCode="" 
genre=""  colorUsage="cuGray"> 

 

Counter*

This option string parameter contains the name of the counter to increment for each returned object. The counter must be defined in the GN4 database.

 

RefKeys*

When present, this optional parameter requests that references to other objects contain the referenced object key attribute(s) values rather than the database id.

Example 1: http://server/gnportal/do.ashx?cmd=objs&ids=2244

<...

<folderRef idref="obj2242" />

<creatorRef idref="obj12" />

<modifierRef idref="obj12" />

...>

Example 2: http://tera-ifra/gnportal/int/do.ashx?cmd=objs&ids=2244&refkeys=

<...

<folderRef objectType=folder">

 <keyVal>/system/users/Guest/My Images</keyVal>

</folderRef>

<creatorRef objectType="user">

 <keyVal>Guest</keyVal>

</creatorRef>

<modifierRef objectType="user">

 <keyVal>Guest</keyVal>

</modifierRef>

...>

See also

ObjsList, ObjsNav