tag:help-archives.hannonhill.com,2010-02-09:/discussions/how-do-i/21477-create-an-asset-with-a-page-chooser-in-the-data-definition-using-web-servicesCascade CMS: Discussion 2016-03-23T18:42:16Ztag:help-archives.hannonhill.com,2010-02-09:Comment/393076152016-03-02T13:58:29Z2016-03-02T13:58:29ZCreate an asset with a Page chooser in the data definition using web services<div><p>I'm using web services to create some page assets in the CMS.
One of the pages has a Page chooser in the data definition. I am
using PHP web services to create the page. I can get all the text
values to populate correctly, but I can't figure out how to
populate the Page chooser (supervisor) field.</p>
<p>Ex: Here is the data definition.<br>
<br></p>
<p>Ex of the PHP code for setting up the data<br>
// Organization Information Group - Title, Supervisor, Division,
Dean, Department array ( 'type' => 'group', 'identifier' =>
'organization-information', 'structuredDataNodes' => array (
'structuredDataNode' => array (</p>
<pre>
<code> // Employee Type
array (
'type' => 'text',
'identifier' => 'employee-type',
'text' => $aProfileData['employeeType']
),
// Position Title
array (
'type' => 'text',
'identifier' => 'position-title',
'text' => $aProfileData['title']
),
// Supervisor
array (
'type' => 'asset',
'asset-type' => 'Page',
'identifier' => 'supervisor',
'path' => '/index'
),
// Division
array (
'type' => 'text',
'identifier' => 'division',
'text' => $aProfileData['division']
),
// Division Folder
array (
'type' => 'text',
'identifier' => 'division-folder',
'text' => $aProfileData['divisionFolder']
),
//Dean
array (
'type' => 'text',
'identifier' => 'dean',
'text' => $aProfileData['dean']
),</code>
</pre></div>ediegotag:help-archives.hannonhill.com,2010-02-09:Comment/393076152016-03-02T14:28:17Z2016-03-02T14:28:17ZCreate an asset with a Page chooser in the data definition using web services<div><p>Hi,</p>
<p>You should know of my library by now. To use my library:</p>
<pre>
$page->setPage(
"group;page-chooser",
$cascade->getAsset( a\Page::TYPE, "87e6d0cf8b7f0856002a5e11c8e6bd21" ) )->edit();
</pre>
<p>To use raw code, you should set both the <code>pageId</code> and
<code>pagePath</code> properties:<br></p>
<pre>
object(stdClass)#29 (14) {
["type"]=>
string(5) "asset"
["identifier"]=>
string(12) "page-chooser"
["structuredDataNodes"]=>
NULL
["text"]=>
NULL
["assetType"]=>
string(4) "page"
["blockId"]=>
NULL
["blockPath"]=>
NULL
["fileId"]=>
NULL
["filePath"]=>
NULL
["pageId"]=>
string(32) "87e6d0cf8b7f0856002a5e11c8e6bd21"
["pagePath"]=>
string(4) "test"
["symlinkId"]=>
NULL
["symlinkPath"]=>
NULL
["recycled"]=>
bool(false)
</pre>
<p>Wing</p></div>Wing Ming Chantag:help-archives.hannonhill.com,2010-02-09:Comment/393076152016-03-02T14:30:14Z2016-03-02T14:30:14ZCreate an asset with a Page chooser in the data definition using web services<div><p>We are aware of the library and started migrating some of our
web services to use it. thanks for the library and the response
:)</p></div>ediegotag:help-archives.hannonhill.com,2010-02-09:Comment/393076152016-03-02T14:48:36Z2016-03-02T14:48:36ZCreate an asset with a Page chooser in the data definition using web services<div><p>For your information, these are the upcoming hangout events:</p>
<ol>
<li>
<p>Web Services <a href="http://www.upstate.edu/cascade-admin/projects/web-services/courses/online-tutorials.php">
Online Tutorials</a></p>
</li>
<li>
<p><a href="http://www.upstate.edu/cascade-admin/projects/upstate-implementation/webinars.php">
One Template, One Region, and Lots of Velocity Tricks</a></p>
</li>
</ol>
<p>Wing</p></div>Wing Ming Chan