function revealInfo(a\MetadataSet $ms) { echo "<h1>", $ms->getName(), "</h1>", S_H2, "Wired Fields", E_H2, S_UL; foreach (a\MetadataSet::$wired_fields as $field_name) { $required_method_name = u\StringUtility::getMethodName($field_name) . "FieldRequired"; $visibility_method_name = u\StringUtility::getMethodName($field_name) . "FieldVisibility"; echo S_LI, $field_name . ", " . ($ms->{$required_method_name}() ? "required" : "not required") . ", " . $ms->{$visibility_method_name}(), E_LI; } echo E_UL; if ($ms->hasDynamicMetadataFieldDefinitions()) { echo S_H2, "Dynamic Fields", E_H2, S_UL; foreach ($ms->getDynamicMetadataFieldDefinitionNames() as $dmfs_name) { $dmfd = $ms->getDynamicMetadataFieldDefinition($dmfs_name); echo S_LI, $dmfd->getName(), " — ", "type: ", $dmfd->getFieldType(), "; ", !$dmfd->isText() ? "possible values: " . implode(";", $dmfd->getPossibleValueStrings()) . "; " : "", $dmfd->isRequired() ? "required" : "not required", "; ", E_LI; } echo E_UL; } else { echo "This MS does not have dynamic fields", BR; } }
public function setMetadataSet(MetadataSet $ms) { if ($ms == NULL) { throw new e\NullAssetException(c\M::NULL_ASSET); } $this->getProperty()->metadataSetId = $ms->getId(); $this->getProperty()->metadataSetPath = $ms->getPath(); $this->edit(); $this->processMetadata(); return $this; }
public function createContentType(ContentTypeContainer $parent, $name, PageConfigurationSet $pcs, MetadataSet $ms, DataDefinition $dd = NULL) { if (trim($name) == "") { throw new e\CreationErrorException(S_SPAN . c\M::EMPTY_ASSET_FACTORY_NAME . E_SPAN); } $asset = AssetTemplate::getContentType(); $asset->contentType->name = $name; $asset->contentType->parentContainerPath = $parent->getPath(); $asset->contentType->siteName = $parent->getSiteName(); $asset->contentType->pageConfigurationSetPath = $pcs->getPath(); $asset->contentType->metadataSetPath = $ms->getPath(); if (isset($dd)) { $asset->contentType->dataDefinitionPath = $dd->getPath(); } return $this->createAsset($asset, ContentType::TYPE, $this->getPath($parent, $name), $parent->getSiteName()); }
public function setMetadataSet(MetadataSet $ms) { $this->getProperty()->metadataSetId = $ms->getId(); $this->getProperty()->metadataSetPath = $ms->getPath(); return $this; }