public function __construct(\SimpleXMLElement $action_xml)
 {
     if ($action_xml == NULL) {
         throw new e\EmptyValueException("The xml cannot be empty.");
     }
     if (self::DEBUG && self::DUMP) {
         DebugUtility::dump(u\XMLUtility::replaceBrackets($action_xml->asXML()));
     }
     $this->action_xml = $action_xml;
     $action_attr = $action_xml->attributes();
     $this->identifier = $action_attr->identifier->__toString();
     if ($action_attr->label) {
         $this->label = $action_attr->label->__toString();
     }
     if ($action_attr->move) {
         $this->move = $action_attr->move->__toString();
     } else {
         $this->move = "";
     }
     if ($action_attr->{"next-id"}) {
         $this->next_id = $action_attr->{"next-id"}->__toString();
     } else {
         $this->next_id = "";
     }
     $this->triggers = array();
     if ($this->action_xml->trigger) {
         foreach ($this->action_xml->trigger as $trigger) {
             $this->triggers[] = new TriggerDefinition($trigger);
         }
     }
 }
 public function displayScript()
 {
     $script_string = htmlentities($this->getProperty()->script);
     // &
     $script_string = u\XMLUtility::replaceBrackets($script_string);
     echo S_H2 . "Script" . E_H2 . S_PRE . $script_string . E_PRE . HR;
     return $this;
 }
 public function displayXml()
 {
     $xml_string = htmlentities($this->getProperty()->xml);
     // &
     $xml_string = u\XMLUtility::replaceBrackets($xml_string);
     echo S_H2 . "XML" . E_H2 . S_PRE . $xml_string . E_PRE . HR;
     return $this;
 }
 public function displayXml($formatted = true)
 {
     if ($formatted) {
         $xml_string = u\XMLUtility::replaceBrackets($this->xml);
         echo S_H2 . "XML" . E_H2 . S_PRE;
     }
     echo $xml_string;
     if ($formatted) {
         echo E_PRE . HR;
     }
     return $this;
 }
 public function displayXhtml()
 {
     if (!$this->hasStructuredData()) {
         $xhtml_string = u\XMLUtility::replaceBrackets($this->xhtml);
         echo S_H2 . 'XHTML' . E_H2;
         echo $xhtml_string . HR;
     }
     return $this;
 }
 public function displayXml()
 {
     $xml_string = u\XMLUtility::replaceBrackets($this->xml);
     echo S_H2 . "XML" . E_H2 . S_PRE . $xml_string . E_PRE . HR;
     return $this;
 }
<?php

require_once 'auth_tutorial7.php';
use cascade_ws_AOHS as aohs;
use cascade_ws_constants as c;
use cascade_ws_asset as a;
use cascade_ws_property as p;
use cascade_ws_utility as u;
use cascade_ws_exception as e;
try {
    $cascade->getAsset(a\TextBlock::TYPE, "388fa7a58b7ffe83164c93149320e775")->edit();
    echo u\XMLUtility::replaceBrackets($service->getLastRequest());
} catch (\Exception $e) {
    echo S_PRE . $e . E_PRE;
} catch (\Error $er) {
    echo S_PRE . $er . E_PRE;
}
/*
<?xml version="1.0" encoding="UTF-8"?> 
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:ns1="http://www.hannonhill.com/ws/ns/AssetOperationService" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <SOAP-ENV:Body>
    <ns1:edit>
      <ns1:authentication>
        <ns1:password>password</ns1:password>
        <ns1:username>username</ns1:username>
      </ns1:authentication>
      <ns1:asset>
        <ns1:textBlock>
          <ns1:id>388fa7a58b7ffe83164c93149320e775</ns1:id>
          <ns1:name>ajax-read-profile-php</ns1:name>
     }
     if ($mode != 'all') {
         break;
     }
 case 'list-sites':
     $sites = $cascade->getSites();
     foreach ($sites as $site) {
         echo $site->getPathPath() . BR;
     }
     if ($mode != 'all') {
         break;
     }
 case 'asset-tree':
     $site = $cascade->getSite('22q');
     $tree = $site->getAssetTree();
     echo S_PRE . u\XMLUtility::replaceBrackets($tree->toXml()) . E_PRE;
     if ($mode != 'all') {
         break;
     }
 case 'access-rights':
     $ari = $cascade->getAccessRights(a\Page::TYPE, '03b44ae28b7f085600adcd81311fbcdc');
     // test33
     echo S_PRE;
     var_dump($ari->toStdClass());
     echo E_PRE;
     /*               
                     
                 $user1 = $cascade->getAsset( a\User::TYPE, 'chanw' );
                 $user2 = $cascade->getAsset( a\User::TYPE, 'tuw' );
                 if( $ari->hasUser( $user1 ) )
                 {
<?php

require_once 'auth_tutorial7.php';
use cascade_ws_AOHS as aohs;
use cascade_ws_constants as c;
use cascade_ws_asset as a;
use cascade_ws_property as p;
use cascade_ws_utility as u;
use cascade_ws_exception as e;
try {
    $cascade->getAsset(a\TextBlock::TYPE, "388fa7a58b7ffe83164c93149320e775")->dump();
    echo u\XMLUtility::replaceBrackets($service->getLastResponse());
} catch (\Exception $e) {
    echo S_PRE . $e . E_PRE;
} catch (\Error $er) {
    echo S_PRE . $er . E_PRE;
}
/*
<?xml version="1.0" encoding="UTF-8"?> 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Body>
    <readResponse xmlns="http://www.hannonhill.com/ws/ns/AssetOperationService">
      <readReturn>
        <asset>
          <assetFactory xsi:nil="true" />
          <assetFactoryContainer xsi:nil="true" />
          <connectorContainer xsi:nil="true" />
          <contentType xsi:nil="true" />
          <contentTypeContainer xsi:nil="true" />
          <dataDefinition xsi:nil="true" />
     //$s->removeRole( $r )->edit();
     if ($mode != 'all') {
         break;
     }
 case 'set':
     $s->setUrl('http://www.upstate.edu/tuw-test')->setDefaultMetadataSet(a\Asset::getAsset($service, a\MetadataSet::TYPE, 'b893fd058b7f0856002a5e11185ff809'))->setCssFile(NULL)->setSiteAssetFactoryContainer(a\Asset::getAsset($service, a\AssetFactoryContainer::TYPE, '04af3e2e8b7f085600e28886d7e2221d'))->setStartingPage(a\Asset::getAsset($service, a\Page::TYPE, '04af1d7a8b7f085600e28886865346c3'))->setSendReportOnErrorOnly(true)->addUserToSendReport(a\Asset::getAsset($service, a\User::TYPE, 'tuw'))->addGroupToSendReport(a\Asset::getAsset($service, a\Group::TYPE, 'hemonc'))->setRecycleBinExpiration(a\Site::NEVER)->edit();
     if ($mode != 'all') {
         break;
     }
 case 'publish':
     //$s->publish();
     if ($mode != 'all') {
         break;
     }
 case 'asset-tree':
     echo S_PRE . u\XMLUtility::replaceBrackets($s->getRootAssetFactoryContainerAssetTree()->toXml()) . E_PRE;
     if ($mode != 'all') {
         break;
     }
 case 'raw':
     $s_std = $service->retrieve($service->createId(c\T::SITE, $id), c\P::SITE);
     /*          
                 if( $s_std->timeToPublish == NULL )
                     unset( $s_std->timeToPublish );
                 else if( strpos( $s_std->timeToPublish, '-' ) !== false )
                 {
                     $pos = strpos( $s_std->timeToPublish, '-' );
                     $s_std->timeToPublish = substr( $s_std->timeToPublish, 0, $pos );
                 }
                 
                 if( $s_std->publishIntervalHours == NULL )