/** * Expose or not a property * * @param RdfProperty $property the property to check * @param bool $value true if exposed * * @return void */ public function exposeCategory(RdfProperty $property, $value) { $exposeProperty = new RdfProperty(self::EXPOSE_PROP_URI); if ($value == true) { $property->setPropertyValue($exposeProperty, GENERIS_TRUE); } else { $property->removePropertyValue($exposeProperty, GENERIS_TRUE); } }
/** * remove the index of the property. * @throws Exception * @return void */ public function removePropertyIndex() { if (!tao_helpers_Request::isAjax()) { throw new Exception("wrong request mode"); } if (!$this->hasRequestParameter('uri')) { throw new common_exception_MissingParameter("Uri parameter is missing"); } if (!$this->hasRequestParameter('indexProperty')) { throw new common_exception_MissingParameter("indexProperty parameter is missing"); } $indexPropertyUri = tao_helpers_Uri::decode($this->getRequestParameter('indexProperty')); //remove use of index property in property $property = new core_kernel_classes_Property(tao_helpers_Uri::decode($this->getRequestParameter('uri'))); $property->removePropertyValue(new core_kernel_classes_Property(INDEX_PROPERTY), $indexPropertyUri); //remove index property $indexProperty = new \oat\tao\model\search\Index($indexPropertyUri); $indexProperty->delete(); echo json_encode(array('id' => $this->getRequestParameter('indexProperty'))); }