You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by ch...@apache.org on 2008/09/06 21:54:26 UTC
svn commit: r692718 - in /incubator/shindig/trunk/php/src/social-api:
dataservice/CollectionOptions.php opensocial/model/Account.php
opensocial/model/ComplexField.php opensocial/model/Im.php
opensocial/model/ListField.php opensocial/model/Photo.php
Author: chabotc
Date: Sat Sep 6 12:54:26 2008
New Revision: 692718
URL: http://svn.apache.org/viewvc?rev=692718&view=rev
Log:
Missing files from SHINDIG-538
Added:
incubator/shindig/trunk/php/src/social-api/dataservice/CollectionOptions.php
incubator/shindig/trunk/php/src/social-api/opensocial/model/Account.php
incubator/shindig/trunk/php/src/social-api/opensocial/model/ComplexField.php
incubator/shindig/trunk/php/src/social-api/opensocial/model/Im.php
incubator/shindig/trunk/php/src/social-api/opensocial/model/ListField.php
incubator/shindig/trunk/php/src/social-api/opensocial/model/Photo.php
Added: incubator/shindig/trunk/php/src/social-api/dataservice/CollectionOptions.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/social-api/dataservice/CollectionOptions.php?rev=692718&view=auto
==============================================================================
--- incubator/shindig/trunk/php/src/social-api/dataservice/CollectionOptions.php (added)
+++ incubator/shindig/trunk/php/src/social-api/dataservice/CollectionOptions.php Sat Sep 6 12:54:26 2008
@@ -0,0 +1,141 @@
+<?php
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+
+/**
+ * Represents the request options for sorting/filtering/paging.
+ */
+class CollectionOptions {
+ private $sortBy;
+ private $sortOrder;
+ const SORT_ORDER_ASCENDING = 'ascending';
+ const SORT_ORDER_DESCENDING = 'descending';
+
+ private $filterBy;
+ private $filterOp;
+ private $filterValue;
+ const FILTER_OP_EQUALS = 'equals';
+ const FILTER_OP_CONTAINS = 'contains';
+ const FILTER_OP_STARTSWITH = 'startswith';
+ const FILTER_OP_PRESENT = 'present';
+
+ private $updatedSince;
+
+ private $networkDistance;
+
+ private $startIndex;
+ private $count;
+
+ public function __construct()
+ {
+ // set default values, per spec
+ $this->startIndex = 0;
+ $this->count = 0;
+ $this->sortOrder = CollectionOptions::SORT_ORDER_ASCENDING;
+ }
+
+ public function getSortBy()
+ {
+ return $this->sortBy;
+ }
+
+ public function setSortBy($sortBy)
+ {
+ $this->sortBy = $sortBy;
+ }
+
+ public function getSortOrder()
+ {
+ return $this->sortOrder;
+ }
+
+ public function setSortOrder($sortOrder)
+ {
+ $this->sortOrder = $sortOrder;
+ }
+
+ public function getFilterBy()
+ {
+ return $this->filterBy;
+ }
+
+ public function setFilterBy($filterBy)
+ {
+ $this->filterBy = $filterBy;
+ }
+
+ public function getFilterOperation()
+ {
+ return $this->filterOp;
+ }
+
+ public function setFilterOperation($filterOp)
+ {
+ $this->filterOp = $filterOp;
+ }
+
+ public function getFilterValue()
+ {
+ return $this->filterValue;
+ }
+
+ public function setFilterValue($filterValue)
+ {
+ $this->filterValue = $filterValue;
+ }
+
+ public function getUpdatedSince()
+ {
+ return $this->updatedSince;
+ }
+
+ public function setUpdatedSince($updatedSince)
+ {
+ $this->updatedSince = $updatedSince;
+ }
+
+ public function getNetworkDistance()
+ {
+ return $this->networkDistance;
+ }
+
+ public function setNetworkDistance($networkDistance)
+ {
+ $this->networkDistance = $networkDistance;
+ }
+
+ public function getStartIndex()
+ {
+ return $this->startIndex;
+ }
+
+ public function setStartIndex($startIndex)
+ {
+ $this->startIndex = $startIndex;
+ }
+
+ public function getCount()
+ {
+ return $this->count;
+ }
+
+ public function setCount($count)
+ {
+ $this->count = $count;
+ }
+}
Added: incubator/shindig/trunk/php/src/social-api/opensocial/model/Account.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/social-api/opensocial/model/Account.php?rev=692718&view=auto
==============================================================================
--- incubator/shindig/trunk/php/src/social-api/opensocial/model/Account.php (added)
+++ incubator/shindig/trunk/php/src/social-api/opensocial/model/Account.php Sat Sep 6 12:54:26 2008
@@ -0,0 +1,83 @@
+<?php
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+
+/**
+ * see
+ * http://code.google.com/apis/opensocial/docs/0.7/reference/opensocial.Account.Field.html
+ *
+ */
+class Account implements ComplexField {
+ public $domain;
+ public $userid;
+ public $username;
+ public $primary;
+
+ public function __construct($domain, $userid, $username, $primary = null)
+ {
+ $this->domain = $domain;
+ $this->userid = $userid;
+ $this->username = $username;
+ $this->primary = $primary;
+ }
+
+ public function getDomain()
+ {
+ return $this->domain;
+ }
+
+ public function setDomain($domain)
+ {
+ $this->domain = $domain;
+ }
+
+ public function getUserid()
+ {
+ return $this->userid;
+ }
+
+ public function setUserid($userid)
+ {
+ $this->userid = $userid;
+ }
+
+ public function getUsername()
+ {
+ return $this->username;
+ }
+
+ public function setUsername($username)
+ {
+ $this->username = $username;
+ }
+
+ public function getPrimary()
+ {
+ return $this->primary;
+ }
+
+ public function setPrimary($primary)
+ {
+ $this->primary = $primary;
+ }
+
+ public function getPrimarySubValue()
+ {
+ return $this->getDomain();
+ }
+}
Added: incubator/shindig/trunk/php/src/social-api/opensocial/model/ComplexField.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/social-api/opensocial/model/ComplexField.php?rev=692718&view=auto
==============================================================================
--- incubator/shindig/trunk/php/src/social-api/opensocial/model/ComplexField.php (added)
+++ incubator/shindig/trunk/php/src/social-api/opensocial/model/ComplexField.php Sat Sep 6 12:54:26 2008
@@ -0,0 +1,27 @@
+<?php
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+
+interface ComplexField {
+
+ /**
+ * Returns the value of the primary sub-field for this complex field.
+ * This is usually the "value" sub-field, and it's the value used for sorting/filtering.
+ */
+ function getPrimarySubValue();
+}
Added: incubator/shindig/trunk/php/src/social-api/opensocial/model/Im.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/social-api/opensocial/model/Im.php?rev=692718&view=auto
==============================================================================
--- incubator/shindig/trunk/php/src/social-api/opensocial/model/Im.php (added)
+++ incubator/shindig/trunk/php/src/social-api/opensocial/model/Im.php Sat Sep 6 12:54:26 2008
@@ -0,0 +1,25 @@
+<?php
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+
+/**
+ * see
+ * http://code.google.com/apis/opensocial/docs/0.7/reference/opensocial.Im.Field.html
+ *
+ */
+class Im extends ListField {}
Added: incubator/shindig/trunk/php/src/social-api/opensocial/model/ListField.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/social-api/opensocial/model/ListField.php?rev=692718&view=auto
==============================================================================
--- incubator/shindig/trunk/php/src/social-api/opensocial/model/ListField.php (added)
+++ incubator/shindig/trunk/php/src/social-api/opensocial/model/ListField.php Sat Sep 6 12:54:26 2008
@@ -0,0 +1,69 @@
+<?php
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+
+/**
+ * Base class for plural fields, defining the standard value/type/primary sub-fields.
+ */
+class ListField implements ComplexField {
+ public $value;
+ public $type;
+ public $primary;
+
+ public function __construct($value, $type, $primary = null)
+ {
+ $this->value = $value;
+ $this->type = $type;
+ $this->primary = $primary;
+ }
+
+ public function getValue()
+ {
+ return $this->value;
+ }
+
+ public function setValue($value)
+ {
+ $this->value = $value;
+ }
+
+ public function getType()
+ {
+ return $this->type;
+ }
+
+ public function setType($type)
+ {
+ $this->type = $type;
+ }
+
+ public function getPrimary()
+ {
+ return $this->primary;
+ }
+
+ public function setPrimary($primary)
+ {
+ $this->primary = $primary ? true : null;
+ }
+
+ public function getPrimarySubValue()
+ {
+ return $this->getValue();
+ }
+}
Added: incubator/shindig/trunk/php/src/social-api/opensocial/model/Photo.php
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/social-api/opensocial/model/Photo.php?rev=692718&view=auto
==============================================================================
--- incubator/shindig/trunk/php/src/social-api/opensocial/model/Photo.php (added)
+++ incubator/shindig/trunk/php/src/social-api/opensocial/model/Photo.php Sat Sep 6 12:54:26 2008
@@ -0,0 +1,26 @@
+<?php
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+
+/**
+ * see
+ * http://code.google.com/apis/opensocial/docs/0.7/reference/opensocial.Photo.Field.html
+ *
+ */
+class Photo extends ListField {
+}