\n"; $wrapped .= "".urlencode(current_page_url())."\n"; $wrapped .= "".date(DATE_ATOM)."\n"; $wrapped .= "".$_SESSION['user']->name."\n"; $wrapped .= "OpenDD-over-Atom feed\n"; // Itterate foreach ($element as $e) { $wrapper = $factory->getElementWrapper($e); $wrapped .= $wrapper->wrap($e); } // Tail $wrapped .= "\n"; return $wrapped; } } /** * Atom entity wrapper */ class ODDAtomEntityWrapper extends ODDEntityWrapper { function wrap($element) { $wrapped = ""; // Sanity check if (!($element instanceof ODDEntity)) throw new DataFormatException("Element being wrapped is not an ODDEntity"); $wrapped .= "\n"; $wrapped .= "".$element->getAttribute('uuid')."?view=atom"."\n"; $wrapped .= "".date(DATE_ATOM)."\n"; $wrapped .= "Entity\n"; $wrapped .= "".$_SESSION['user']->name."\n"; $wrapped .= "\n"; $wrapped .= "$element\n"; $wrapped .= "\n"; $wrapped .= "\n"; return $wrapped; } } /** * Atom metadata wrapper */ class ODDAtomMetaDataWrapper extends ODDMetaDataWrapper { function wrap($element) { $wrapped = ""; // Sanity check if (!($element instanceof ODDMetaData)) throw new DataFormatException("Element being wrapped is not an ODDMetaData"); $wrapped .= "\n"; $wrapped .= "".$element->getAttribute('uuid')."?view=atom"."\n"; $wrapped .= "".date(DATE_ATOM)."\n"; $wrapped .= "Entity\n"; $wrapped .= "".$_SESSION['user']->name."\n"; $wrapped .= "\n"; $wrapped .= "$element\n"; $wrapped .= "\n"; $wrapped .= "\n"; return $wrapped; } } /** * Atom Relationship wrapper. */ class ODDAtomRelationshipWrapper extends ODDRelationshipWrapper { function wrap($element) { $wrapped = ""; // Sanity check if (!($element instanceof ODDRelationship)) throw new DataFormatException("Element being wrapped is not an ODDRelationship"); $wrapped .= "\n"; $wrapped .= "\n"; $wrapped .= "".date(DATE_ATOM)."\n"; $wrapped .= "Entity\n"; $wrapped .= "".$_SESSION['user']->name."\n"; $wrapped .= "\n"; $wrapped .= "$element\n"; $wrapped .= "\n"; $wrapped .= "\n"; return $wrapped; } } ?>