This section provides information about the format of collection and map values in response messages from the Legacy REST Web Services server.

Expanding Multiple Values and Complex Objects

The Legacy REST Web Services server returns multiple-values and complex objects as REST paths by default. Include the atg-rest-show-rest-paths control parameter to expand these values in the response you receive. Set the value of the control parameter to true.

If you set atg-rest-show-rest-paths to false, the REST response will include expanded data for nested properties down to the level specified by the atg-rest-depth control parameter. See Return Depth.

You can configure the default setting for atg-rest-show-rest-paths.

The example below shows a REST path in the creditCards property. The example that follows it shows the effect of the atg-rest-show-rest-paths control parameter.

curl -v -b cookies.txt -X GET \
http://myserver:8080/rest/repository/atg/userprofiling/ProfileAdapterRepository/
user/130001/

* About to connect() to myserver port 8080 (#0)
*   Trying 12.34.567.890... connected
* Connected to myserver (12.34.567.890) port 8080 (#0)
> GET /rest/repository/atg/userprofiling/ProfileAdapterRepository/user/130001/
HTTP/1.1
> User-Agent: curl/7.21.1 (i386-pc-win32) libcurl/7.21.1 zlib/1.2.5
> Host: myserver:8080
> Accept: */*
> Cookie: DYN_USER_ID=140003; JSESSIONID=9B95CAFAA8B94A05C46488E482A91543;
DYN_USER_CONFIRM=1231cf3e7573bf936dbd29dbbbfe150b
>
< HTTP/1.1 200 OK
< Server: Apache-Coyote/1.1
< X-Powered-By: Servlet 2.5; JBoss-5.0/JBossWeb-2.1
* Replaced cookie JSESSIONID="A2C79A00F7194A1F113604FD1C4BE7DD" for domain
myserver, path /, expire 0
< Set-Cookie: JSESSIONID=A2C79A00F7194A1F113604FD1C4BE7DD; Path=/
< X-ATG-Version: version=
QVRHUGxhdGZvcm0vMTAuMCxDb21tZXJjZVJlZmVyZW5jZVN0b3JlLzEwLjAgWyBQbGF0Zm9ybUxpY2
Vuc2UvMCBCMkNMaWNlbnNlLzAgIF0=
< Content-Type: application/xml;charset=UTF-8
< Transfer-Encoding: chunked
< Date: Fri, 05 Nov 2010 21:50:44 GMT
<
<?xml version="1.0" encoding="UTF-8"?>

<atgResponse>

[Additional property values omitted to save space]

  <creditCards>http://myserver:8080/rest/repository/atg/userprofiling/
      ProfileAdapterRepository/user/130001/creditCards</creditCards>

[Additional property values omitted to save space]

</atgResponse>
* Connection #0 to host myserver left intact
* Closing connection #0

The example below shows a collection value that has been expanded. The Legacy REST Web Services request sets the atg-rest-show-rest-paths control parameter to false.

curl -v -b cookies.txt -X GET \
http://myserver:8080/rest/repository/atg/userprofiling/ProfileAdapterRepository/
user/130001/?atg-rest-show-rest-paths=false

* About to connect() to myserver port 8080 (#0)
*   Trying 12.34.567.890... connected
* Connected to myserver (12.34.567.890) port 8080 (#0)
> GET /rest/repository/atg/userprofiling/ProfileAdapterRepository/user/130001/?
atg-rest-show-rest-paths=false HTTP/1.1
> User-Agent: curl/7.21.1 (i386-pc-win32) libcurl/7.21.1 zlib/1.2.5
> Host: myserver:8080
> Accept: */*
> Cookie: DYN_USER_ID=140003; JSESSIONID=9B95CAFAA8B94A05C46488E482A91543;
DYN_USER_CONFIRM=1231cf3e7573bf936dbd29dbbbfe150b
>
< HTTP/1.1 200 OK
< Server: Apache-Coyote/1.1
< X-Powered-By: Servlet 2.5; JBoss-5.0/JBossWeb-2.1
* Replaced cookie JSESSIONID="9D730DE9D4A7C250994F20363ACC3FA6" for domain
myserver, path /, expire 0
< Set-Cookie: JSESSIONID=9D730DE9D4A7C250994F20363ACC3FA6; Path=/
< X-ATG-Version: version=
QVRHUGxhdGZvcm0vMTAuMCxDb21tZXJjZVJlZmVyZW5jZVN0b3JlLzEwLjAgWyBQbGF0Zm9ybU
xpY2Vuc2UvMCBCMkNMaWNlbnNlLzAgIF0=
< Content-Type: application/xml;charset=UTF-8
< Transfer-Encoding: chunked
< Date: Fri, 05 Nov 2010 22:04:32 GMT
<
<?xml version="1.0" encoding="UTF-8"?>

<atgResponse>

[Additional property values omitted to save space]

  <creditCards>
    <element>
      <key>MyOtherCard</key>
      <value>
        <atgRestComponentPath>/atg/userprofiling/ProfileAdapterRepository
            </atgRestComponentPath>
        <atgRestItemDescriptor>credit-card</atgRestItemDescriptor>
        <atgRestRepositoryId>usercc10003</atgRestRepositoryId>
      </value>
    </element>
    <element>
      <key>MyCard</key>
      <value>
        <atgRestComponentPath>/atg/userprofiling/ProfileAdapterRepository
           </atgRestComponentPath>
        <atgRestItemDescriptor>credit-card</atgRestItemDescriptor>
        <atgRestRepositoryId>usercc10001</atgRestRepositoryId>
      </value>
    </element>
  </creditCards>

[Additional property values omitted to save space]

</atgResponse>
* Connection #0 to host myserver left intact
* Closing connection #0
Collection Values in Output

The Legacy REST Web Services server will return each element in a property value of class java.utils.Collection as shown in the examples below.

curl -v -b cookies.txt -X GET \
http://myserver:8080/rest/bean/atg/userprofiling/ProfileUserDirectory/roles

* About to connect() to myserver port 8080 (#0)
*   Trying 12.34.567.890... connected
* Connected to myserver (12.34.567.890) port 8080 (#0)
> GET /rest/bean/atg/userprofiling/ProfileUserDirectory/roles HTTP/1.1
> User-Agent: curl/7.21.1 (i386-pc-win32) libcurl/7.21.1 zlib/1.2.5
> Host: myserver:8080
> Accept: */*
> Cookie: DYN_USER_ID=140003; JSESSIONID=9B95CAFAA8B94A05C46488E482A91543;
DYN_USER_CONFIRM=1231cf3e7573bf936dbd29dbbbfe150b
>
< HTTP/1.1 200 OK
< Server: Apache-Coyote/1.1
< X-Powered-By: Servlet 2.5; JBoss-5.0/JBossWeb-2.1
* Replaced cookie JSESSIONID="6F710DD421CDBB1C0A092133210E7A0E" for
* domain myserver, path /, expire 0
< Set-Cookie: JSESSIONID=6F710DD421CDBB1C0A092133210E7A0E; Path=/
< X-ATG-Version: version=
QVRHUGxhdGZvcm0vMTAuMCxDb21tZXJjZVJlZmVyZW5jZVN0b3JlLzEwLjAgWyBQbGF0Zm9yb
UxpY2Vuc2UvMCBCMkNMaWNlbnNlLzAgIF0=
< Content-Type: application/xml;charset=UTF-8
< Transfer-Encoding: chunked
< Date: Wed, 03 Nov 2010 15:05:19 GMT
<
<?xml version="1.0" encoding="UTF-8"?>

<atgResponse>
  <roles>
    <element>
- RepositoryItemGroupRole:
--&gt; name: Young
--&gt; primary key: Young__grouprole
</element>    <element>
- RepositoryItemGroupRole:
--&gt; name: WomenOnly
--&gt; primary key: WomenOnly__grouprole
</element>    <element>
- RepositoryItemGroupRole:
--&gt; name: Fashionista
--&gt; primary key: Fashionista__grouprole
</element>    <element>
- RepositoryItemGroupRole:
--&gt; name: MenOnly
--&gt; primary key: MenOnly__grouprole
</element>    <element>
- RepositoryItemGroupRole:
--&gt; name: ThirtySomethings
--&gt; primary key: ThirtySomethings__grouprole
</element>  </roles></atgResponse>* Connection #0 to host myserver left intact
* Closing connection #0

The following example shows the same property value in JSON format.

{"roles": [
  "\n- RepositoryItemGroupRole:\n--> name: Young\n--
> primary key: Young__grouprole\n",
  "\n- RepositoryItemGroupRole:\n--> name: WomenOnly\n--
> primary key: WomenOnly__grouprole\n",
  "\n- RepositoryItemGroupRole:\n--> name: Fashionista\n--
> primary key: Fashionista__grouprole\n",
  "\n- RepositoryItemGroupRole:\n--> name: MenOnly\n--
> primary key: MenOnly__grouprole\n",
  "\n- RepositoryItemGroupRole:\n--> name: ThirtySomethings\n--
> primary key: ThirtySomethings__grouprole\n"
]}
Map Values in Output

The Legacy REST Web Services server will return each element in a property value of class java.utils.Map as shown in the examples below.

curl -v -b cookies.txt -X GET \
http://myserver:8080/rest/repository/atg/userprofiling/ProfileAdapterRepository/
user/130001/creditCards

* About to connect() to myserver port 8080 (#0)
*   Trying 12.34.567.890... connected
* Connected to myserver (12.34.567.890) port 8080 (#0)
> GET /rest/repository/atg/userprofiling/ProfileAdapterRepository/user/130001/
creditCards HTTP/1.1
> User-Agent: curl/7.21.1 (i386-pc-win32) libcurl/7.21.1 zlib/1.2.5
> Host: myserver:8080
> Accept: */*
> Cookie: DYN_USER_ID=140003; JSESSIONID=9B95CAFAA8B94A05C46488E482A91543;
DYN_USER_CONFIRM=1231cf3e7573bf936dbd29dbbbfe150b
>
< HTTP/1.1 200 OK
< Server: Apache-Coyote/1.1
< X-Powered-By: Servlet 2.5; JBoss-5.0/JBossWeb-2.1
* Replaced cookie JSESSIONID="F60503E5A6051C18D119B6CE470F9591" for domain
myserver, path /, expire 0
< Set-Cookie: JSESSIONID=F60503E5A6051C18D119B6CE470F9591; Path=/
< X-ATG-Version: version=
QVRHUGxhdGZvcm0vMTAuMCxDb21tZXJjZVJlZmVyZW5jZVN0b3JlLzEwLjAgWyBQbGF0Zm9ybUxpY2V
uc2UvMCBCMkNMaWNlbnNlLzAgIF0=
< Content-Type: application/xml;charset=UTF-8
< Transfer-Encoding: chunked
< Date: Wed, 03 Nov 2010 16:12:57 GMT
<
<?xml version="1.0" encoding="UTF-8"?>

<atgResponse>
  <creditCards>
    <element>
      <key>MyOtherCard</key>
      <value>http://myserver:8080/rest/repository/atg/userprofiling/
          ProfileAdapterRepository/credit-card/usercc10003</value>
    </element>
    <element>
      <key>MyCard</key>
      <value>http://myserver:8080/rest/repository/atg/userprofiling/
          ProfileAdapterRepository/credit-card/usercc10001</value>
    </element>
  </creditCards>
</atgResponse>
* Connection #0 to host myserver left intact
* Closing connection #0

The following example shows the same property value in JSON format.

{"creditCards": { "MyCard": "http://myserver:8080/rest/repository/atg/
userprofiling/ProfileAdapterRepository/credit-card/usercc10001",
"MyOtherCard": "http://myserver:8080/rest/repository/atg/userprofiling/
ProfileAdapterRepository/credit-card/usercc10003" }}
Array Values in Output

The Legacy REST Web Services server will return each element in a property value that is an array as shown in the examples below.

curl -v -b cookies.txt -X GET http://12.34.567.890:7003/rest/repository/atg/
userprofiling/ProfileAdapterRepository/user/190000/previousPasswords
* About to connect() to 12.34.567.890 port 7003 (#0)
*   Trying 12.34.567.890... connected
* Connected to 12.34.567.890 (12.34.567.890) port 7003 (#0)
> GET /rest/repository/atg/userprofiling/ProfileAdapterRepository/user/
190000/previousPasswords HTTP/1.1
> User-Agent: curl/7.20.1 (i686-pc-cygwin) libcurl/7.20.1 OpenSSL/
0.9.8r zlib/1.2.5 libidn/1.18 libssh2/1.2.5
> Host: 12.34.567.890:7003
> Accept: */*
> Cookie: DYN_USER_CONFIRM=4587a098fc47b063d7e60c9097fa3c99; DYN_USER_ID=140001;
JSESSIONID=PGpxTW0BWgSfQT2sXspwJf3H3JJKdTGHgJ1yMZ1QV8V1GRQJ9MVN!-249339435
>
< HTTP/1.1 200 OK
< Date: Thu, 13 Oct 2011 16:18:22 GMT
< Transfer-Encoding: chunked
< Content-Type: application/xml; charset=UTF-8
< X-ATG-Version: version=
QVRHUGxhdGZvcm0vMTAuMSxDb21tZXJjZVJlZmVyZW5jZVN0b3JlLzEwLjE=
* Replaced cookie JSESSIONID=
"V9TCTXPTkCnXrgJJKb2bhbzHwpvn2yzlDJb4JTXhLlkyw22J7xm7!-249339435" for domain
12.34.567.890, path /, expire 0
< Set-Cookie: JSESSIONID=V9TCTXPTkCnXrgJJKb2bhbzHwpvn2yzlDJb4JTXhLlkyw22J7xm7!
-249339435; path=/; HttpOnly
< X-Powered-By: Servlet/2.5 JSP/2.1
<
<?xml version="1.0" encoding="UTF-8"?>

<atgResponse>
  <previousPasswords>

<element>17d0b74864b89840e07f08f46dd72f90fed59b62d476639c25667a3b3f74bdf5
    </element>

<element>914eb28cb2996739bdd33ed74deed1005ff1fd40489583d22bd35d5a8344fa6c
    </element>
  </previousPasswords>
</atgResponse>
* Connection #0 to host 12.34.567.890 left intact
* Closing connection #0

The following example shows the same property value in JSON format.

{"previousPasswords": [
  "17d0b74864b89840e07f08f46dd72f90fed59b62d476639c25667a3b3f74bdf5",
  "914eb28cb2996739bdd33ed74deed1005ff1fd40489583d22bd35d5a8344fa6c"
]}

Copyright © 1997, 2014 Oracle and/or its affiliates. All rights reserved. Legal Notices