Author: chabotc
Date: Sun Jan 25 11:12:54 2009
New Revision: 737501
URL: http://svn.apache.org/viewvc?rev=737501&view=rev
Log:
Cleaned up a few whitespaces & removed the no-longer-used ncludeOsearch var
from the atom converter
Modified:
incubator/shindig/trunk/php/src/common/BlobCrypter.php
incubator/shindig/trunk/php/src/social/converters/OutputAtomConverter.php
Modified: incubator/shindig/trunk/php/src/common/BlobCrypter.php
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/common/BlobCrypter.php?rev=737501&r1=737500&r2=737501&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/common/BlobCrypter.php (original)
+++ incubator/shindig/trunk/php/src/common/BlobCrypter.php Sun Jan 25 11:12:54
2009
@@ -19,34 +19,33 @@
*/
-class BlobCrypterException extends Exception {
-}
+class BlobCrypterException extends Exception { }
/**
* Utility interface for managing signed, encrypted, and time stamped blobs.
* Blobs are made up of name/value pairs. Time stamps are automatically
* included and checked.
- *
+ *
*/
abstract class BlobCrypter {
/**
* Time stamps, encrypts, and signs a blob.
- *
+ *
* @param in name/value pairs to encrypt
* @return a base64 encoded blob
- *
+ *
* @throws BlobCrypterException
*/
abstract public function wrap(Array $in);
/**
* Unwraps a blob.
- *
+ *
* @param in blob
* @param maxAgeSec maximum age for the blob
* @return the name/value pairs, including the origin timestamp.
- *
+ *
* @throws BlobExpiredException if the blob is too old to be accepted.
* @throws BlobCrypterException if the blob can't be decoded.
*/
Modified:
incubator/shindig/trunk/php/src/social/converters/OutputAtomConverter.php
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/social/converters/OutputAtomConverter.php?rev=737501&r1=737500&r2=737501&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/social/converters/OutputAtomConverter.php
(original)
+++ incubator/shindig/trunk/php/src/social/converters/OutputAtomConverter.php
Sun Jan 25 11:12:54 2009
@@ -28,10 +28,8 @@
private static $xmlVersion = '1.0';
private static $charSet = 'UTF-8';
private static $formatOutput = true;
- //FIXME osearch fields break the validator ... remove option once i know if
they should be included or not
- private static $includeOsearch = false;
// this maps the REST url to the atom content type
- private static $entryTypes = array('people' => 'person', 'appdata' =>
'appdata',
+ private static $entryTypes = array('people' => 'person', 'appdata' =>
'appdata',
'activities' => 'activity', 'messages' => 'messages');
private $doc;
@@ -44,17 +42,17 @@
$guid = 'urn:guid:' . $userId;
$authorName = $_SERVER['HTTP_HOST'] . ':' . $userId;
$updatedAtom = date(DATE_ATOM);
-
- // Check to see if this is a single entry, or a collection, and construct
either an atom
- // feed (collection) or an entry (single)
+
+ // Check to see if this is a single entry, or a collection, and construct
either an atom
+ // feed (collection) or an entry (single)
if ($responseItem->getResponse() instanceof RestfulCollection) {
$totalResults = $responseItem->getResponse()->getTotalResults();
$itemsPerPage = $requestItem->getCount();
$startIndex = $requestItem->getStartIndex();
-
+
// The root Feed element
$entry = $this->addNode($doc, 'feed', '', false, self::$nameSpace);
-
+
// Required Atom fields
$endPos = ($startIndex + $itemsPerPage) > $totalResults ? $totalResults
: ($startIndex + $itemsPerPage);
$this->addNode($entry, 'title', $requestType . ' feed for id ' .
$authorName . ' (' . $startIndex . ' - ' . ($endPos - 1) . ' of ' .
$totalResults . ')');
@@ -63,7 +61,7 @@
$this->addNode($author, 'name', $authorName);
$this->addNode($entry, 'updated', $updatedAtom);
$this->addNode($entry, 'id', $guid);
- $this->addNode($entry, 'link', '', array('rel' => 'self',
+ $this->addNode($entry, 'link', '', array('rel' => 'self',
'href' => 'http://' . $_SERVER['HTTP_HOST'] .
$_SERVER['REQUEST_URI']));
// Add osearch & next link to the entry
$this->addPagingFields($entry, $startIndex, $itemsPerPage,
$totalResults);
@@ -99,12 +97,12 @@
$this->addNode($feedEntry, 'title', $requestType . ' feed entry for
id ' . $idField);
$this->addNode($feedEntry, 'updated', $updatedAtom);
}
-
+
// recursively add responseItem data to the xml structure
$this->addData($content, $requestType, $response, self::$osNameSpace);
}
} else {
- // Single entry = Atom:Entry
+ // Single entry = Atom:Entry
$entry = $doc->appendChild($doc->createElementNS(self::$nameSpace,
"entry"));
// Atom fields
$this->addNode($entry, 'title', $requestType . ' entry for ' .
$authorName);
@@ -199,7 +197,7 @@
}
/**
- * Recursive function that maps an data array or object to it's xml
represantation
+ * Recursive function that maps an data array or object to it's xml
represantation
*
* @param DOMElement $element the element to append the new node(s) to
* @param string $name the name of the to be created node