public function addPageConfiguration($name, Template $t, $extension, $type) { if (trim($extension) == "") { throw new e\EmptyValueException(S_SPAN . c\M::EMPTY_FILE_EXTENSION . E_SPAN); } if (!c\SerializationTypeValues::isSerializationTypeValue($type)) { throw new e\WrongSerializationTypeException(S_SPAN . "The serialization type {$type} is not acceptable. " . E_SPAN); } $config = AssetTemplate::getPageConfiguration(); $config->name = $name; $config->templateId = $t->getId(); $config->templatePath = $t->getPath(); $config->pageRegions = $t->getPageRegionStdForPageConfiguration(); $config->outputExtension = $extension; $config->serializationType = $type; $p = new p\PageConfiguration($config, $this->getService(), NULL); $this->page_configurations[] = $p; $this->edit(); $this->processPageConfigurations($this->getProperty()->pageConfigurations->pageConfiguration); return $this; }
public function createPageConfigurationSet(PageConfigurationSetContainer $parent, $name, $config_name, Template $t, $extension, $type) { if (trim($name) == "") { throw new e\CreationErrorException(S_SPAN . c\M::EMPTY_PAGE_CONFIGURATION_SET_NAME . E_SPAN); } if (trim($config_name) == "") { throw new e\CreationErrorException(S_SPAN . c\M::EMPTY_PAGE_CONFIGURATION_NAME . E_SPAN); } if (trim($extension) == "") { throw new e\EmptyValueException(S_SPAN . c\M::EMPTY_FILE_EXTENSION . E_SPAN); } if (!c\SerializationTypeValues::isSerializationTypeValue($type)) { throw new e\WrongSerializationTypeException(S_SPAN . "The serialization type {$type} is not acceptable. " . E_SPAN); } $config = AssetTemplate::getPageConfiguration(); $config->name = $config_name; $config->defaultConfiguration = true; $config->templateId = $t->getId(); $config->templatePath = $t->getPath(); $config->pageRegions = $t->getPageRegionStdForPageConfiguration(); $config->outputExtension = $extension; $config->serializationType = $type; $asset = AssetTemplate::getPageConfigurationSet(); $asset->pageConfigurationSet->name = $name; $asset->pageConfigurationSet->parentContainerPath = $parent->getPath(); $asset->pageConfigurationSet->siteName = $parent->getSiteName(); $asset->pageConfigurationSet->pageConfigurations->pageConfiguration = $config; return $this->createAsset($asset, PageConfigurationSet::TYPE, $this->getPath($parent, $name), $parent->getSiteName()); }
public function setTemplate(a\Template $template) { $this->template_id = $template->getId(); $this->template_path = $template->getPath(); return $this; }