tag:help-archives.hannonhill.com,2010-02-09:/discussions/web-services/1385-how-to-create-new-output-in-configuration-set-using-php-apiCascade CMS: Discussion 2015-04-27T19:18:51Ztag:help-archives.hannonhill.com,2010-02-09:Comment/336478182014-07-03T18:34:16Z2014-07-03T18:34:16ZHow to create new output in configuration set using PHP API<div><p>Jeff,</p>
<p>I don't know how it works, but it seems that I am reading your
mind. I added the method
<code>PageConfigurationSet::addConfiguration( $name, Template $t,
$extension, $type )</code> just this morning. It has NOT been
tested thoroughly. But if you want to try it, you are very welcome.
I have not updated the documentation yet. Here is the code I used
to test the method:</p>
<pre>
$id = 'fc51bcda8b7f085600406eac9dc67ed8';
$pcs = $cascade->getAsset( PageConfigurationSet::TYPE, $id );
$pcs->addConfiguration(
'XML', // name
$cascade->getAsset( Template::TYPE, 'fd27b6798b7f08560159f3f08e013f23' ), // template
'.xml', // file extension
T::XML // serialization type, others: T::HTML, T::PDF, T::RTF
);
</pre>
<p>Once you have the new configuration (output), you can use
<code>PageConfigurationSet::setDefaultConfiguration( $name
)</code>, <code>PageConfigurationSet::getConfiguration( $name
)</code>, <code>PageConfiguration::setRegionBlock( $region_name,
Block $block=NULL )</code> and so on to work with blocks and
formats.</p>
<p>If you want to try the code, use it to work with one or two
configuration sets first to make sure everything is OK. Once you
find everything alright, then you can try it on others. Please let
me know the result.</p>
<p>Wing</p></div>Wing Ming Chantag:help-archives.hannonhill.com,2010-02-09:Comment/336478182014-07-09T14:13:36Z2014-07-09T14:23:34ZHow to create new output in configuration set using PHP API<div><p>I have finally finished the entire suite, altogether 45, of
<code>Cascade::createX</code> methods. Now anyone can use my
library to create an asset of any type. See <a href=
"http://www.upstate.edu/cascade-admin/projects/web-services/oop/building-site/index.php">
Building a Site from Scratch Using Web Services</a> for code
examples on how to create assets and perform basic operations on
them. On <a href=
"http://www.upstate.edu/cascade-admin/projects/web-services/oop/building-site/configuration-set-container-configuration-set.php">
Configuration Set Container and Configuration Set</a> there is an
example on how to add a configuration to a configuration set and
attach a block to a region at the configuration level.</p>
<p>Wing</p></div>Wing Ming Chan