You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by ie...@apache.org on 2008/08/27 17:06:04 UTC
svn commit: r689497 - in
/incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social:
./ core/config/ opensocial/model/ sample/oauth/
Author: ieb
Date: Wed Aug 27 08:06:03 2008
New Revision: 689497
URL: http://svn.apache.org/viewvc?rev=689497&view=rev
Log:
Update to javadoc in the model area, and some other javadoc in the social API.
Added:
incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/sample/oauth/package.html
Modified:
incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/ResponseError.java
incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/ResponseItem.java
incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/config/SocialApiGuiceModule.java
incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Account.java
incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Activity.java
incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Address.java
incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/BodyType.java
incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/ListField.java
incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/MediaItem.java
incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Message.java
incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Organization.java
incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Person.java
incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Url.java
Modified: incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/ResponseError.java
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/ResponseError.java?rev=689497&r1=689496&r2=689497&view=diff
==============================================================================
--- incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/ResponseError.java (original)
+++ incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/ResponseError.java Wed Aug 27 08:06:03 2008
@@ -18,28 +18,55 @@
package org.apache.shindig.social;
import javax.servlet.http.HttpServletResponse;
-
+/**
+ * An Enumeration for holding all the responses emitted by the social API.
+ */
public enum ResponseError {
+ /** value representing NOT IMPLEMENTED. */
NOT_IMPLEMENTED("notImplemented", HttpServletResponse.SC_NOT_IMPLEMENTED),
+ /** value representing UNAUTHORIZED. */
UNAUTHORIZED("unauthorized", HttpServletResponse.SC_UNAUTHORIZED),
+ /** value representing FORBIDDEN. */
FORBIDDEN("forbidden", HttpServletResponse.SC_FORBIDDEN),
+ /** value representing BAD REQUEST. */
BAD_REQUEST("badRequest", HttpServletResponse.SC_BAD_REQUEST),
+ /** value representing INTERNAL SERVER ERROR. */
INTERNAL_ERROR("internalError", HttpServletResponse.SC_INTERNAL_SERVER_ERROR),
+ /** value representing EXPECTATION FAILED. */
LIMIT_EXCEEDED("limitExceeded", HttpServletResponse.SC_EXPECTATION_FAILED);
+ /**
+ * The json value of the error.
+ */
private final String jsonValue;
+ /**
+ * The http error code associated with the error.
+ */
private int httpErrorCode;
+ /**
+ * Construct a Response Error from the jsonValue as a string and the Http Error Code.
+ * @param jsonValue the json String representation of the error code.
+ * @param httpErrorCode the numeric HTTP error code.
+ */
ResponseError(String jsonValue, int httpErrorCode) {
this.jsonValue = jsonValue;
this.httpErrorCode = httpErrorCode;
}
+ /**
+ *
+ * Converts the ResponseError to a String representation
+ */
@Override
public String toString() {
return jsonValue;
}
+ /**
+ * Get the HTTP error code.
+ * @return the Http Error code.
+ */
public int getHttpErrorCode() {
return httpErrorCode;
}
Modified: incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/ResponseItem.java
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/ResponseItem.java?rev=689497&r1=689496&r2=689497&view=diff
==============================================================================
--- incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/ResponseItem.java (original)
+++ incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/ResponseItem.java Wed Aug 27 08:06:03 2008
@@ -22,28 +22,60 @@
* DataResponse.
*/
public class ResponseItem {
+ /**
+ * The ResponseError associated with the item.
+ */
private ResponseError error;
+ /**
+ * The error message.
+ */
private String errorMessage;
- protected ResponseItem() {}
+ /**
+ * Blank constructor protected for subclasses.
+ */
+ protected ResponseItem() {
+
+ }
+ /**
+ * Create a ResponseItem specifying the ResponseError and error Message.
+ * @param error a ResponseError
+ * @param errorMessage the Error Message
+ */
public ResponseItem(ResponseError error, String errorMessage) {
this.error = error;
this.errorMessage = errorMessage;
}
+ /**
+ * Get the ResponseError associated with this ResponseItem.
+ * @return the ResponseError associated with this ResponseItem
+ */
public ResponseError getError() {
return error;
}
+ /**
+ * Set the ResponseError associated with this item.
+ * @param error the new ResponseError
+ */
public void setError(ResponseError error) {
this.error = error;
}
+ /**
+ * Get the Error Message associated with this Response Item.
+ * @return the Error Message
+ */
public String getErrorMessage() {
return errorMessage;
}
+ /**
+ * Set the Error Message associated with this ResponseItem.
+ * @param errorMessage the new error Message
+ */
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
Modified: incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/config/SocialApiGuiceModule.java
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/config/SocialApiGuiceModule.java?rev=689497&r1=689496&r2=689497&view=diff
==============================================================================
--- incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/config/SocialApiGuiceModule.java (original)
+++ incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/core/config/SocialApiGuiceModule.java Wed Aug 27 08:06:03 2008
@@ -31,7 +31,10 @@
import com.google.inject.name.Names;
/**
- * Provides social api component injection.
+ * Provides social api component injection. Implementor may want to replace this module if they
+ * need to replace some of the internals of the Social API, like for instance the JSON to Bean to JSON
+ * converter Beans, however in general this should not be required, as most default implementations have
+ * been specified with the Guice @ImplementedBy annotation.
*/
public class SocialApiGuiceModule extends AbstractModule {
Modified: incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Account.java
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Account.java?rev=689497&r1=689496&r2=689497&view=diff
==============================================================================
--- incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Account.java (original)
+++ incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Account.java Wed Aug 27 08:06:03 2008
@@ -21,36 +21,114 @@
import com.google.inject.ImplementedBy;
+/**
+ * <p>
+ * The Account interface describes the an account held by a person. Describes an account held by a
+ * Person, which MAY be on the Service Provider's service, or MAY be on a different service. The
+ * service provider does not have a requirement to verify that the account actually belongs to the
+ * person that the account is connected to, and consumers are appropriately warned of this in the
+ * Specification.
+ * </p>
+ * <p>
+ * For each account, the domain is the top-most authoritative domain for this
+ * account, e.g. yahoo.com or reader.google.com, and MUST be non-empty. Each account must also
+ * contain a non-empty value for either username or userid, and MAY contain both, in which case the
+ * two values MUST be for the same account. These accounts can be used to determine if a user on one
+ * service is also known to be the same person on a different service, to facilitate connecting to
+ * people the user already knows on different services.
+ * <p>
+ * <p>
+ * Since V0.8.1
+ * </p>
+ */
@ImplementedBy(AccountImpl.class)
-
public interface Account {
+
+ /**
+ * The fields that represent the account object in json form.
+ *
+ * <p>
+ * All of the fields that an account can have, all fields are required
+ * </p>
+ *
+ */
public static enum Field {
+ /** the json field for domain. */
DOMAIN("domain"),
+ /** the json field for userId. */
USER_ID("userId"),
+ /** the json field for username. */
USERNAME("username");
+ /**
+ * The json field that the instance represents.
+ */
private final String jsonString;
+ /**
+ * create a field base on the a json element.
+ *
+ * @param jsonString the name of the element
+ */
private Field(String jsonString) {
this.jsonString = jsonString;
}
+ /**
+ * emit the field as a json element.
+ *
+ * @return the field name
+ */
@Override
public String toString() {
return this.jsonString;
}
}
+ /**
+ * The top-most authoritative domain for this account, e.g. "twitter.com". This is the Primary
+ * Sub-Field for this field, for the purposes of sorting and filtering.
+ *
+ * @return the domain
+ */
String getDomain();
+ /**
+ * The top-most authoritative domain for this account, e.g. "twitter.com". This is the Primary
+ * Sub-Field for this field, for the purposes of sorting and filtering. *
+ *
+ * @param domain the domain
+ */
void setDomain(String domain);
+ /**
+ * A user ID number, usually chosen automatically, and usually numeric but sometimes alphanumeric,
+ * e.g. "12345" or "1Z425A".
+ *
+ * @return the userId
+ */
String getUserId();
+ /**
+ * A user ID number, usually chosen automatically, and usually numeric but sometimes alphanumeric,
+ * e.g. "12345" or "1Z425A".
+ *
+ * @param userId the userId
+ */
void setUserId(String userId);
+ /**
+ * An alphanumeric user name, usually chosen by the user, e.g. "jsmarr".
+ *
+ * @return the username
+ */
String getUsername();
+ /**
+ * An alphanumeric user name, usually chosen by the user, e.g. "jsmarr".
+ *
+ * @param username the username
+ */
void setUsername(String username);
}
Modified: incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Activity.java
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Activity.java?rev=689497&r1=689496&r2=689497&view=diff
==============================================================================
--- incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Activity.java (original)
+++ incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Activity.java Wed Aug 27 08:06:03 2008
@@ -9,12 +9,13 @@
*
* http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless OPTIONAL by applicable law or agreed to in writing,
+ * 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.
*/
+
package org.apache.shindig.social.opensocial.model;
import org.apache.shindig.social.core.model.ActivityImpl;
Modified: incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Address.java
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Address.java?rev=689497&r1=689496&r2=689497&view=diff
==============================================================================
--- incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Address.java (original)
+++ incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Address.java Wed Aug 27 08:06:03 2008
@@ -30,19 +30,28 @@
public interface Address {
/**
- * The fields that represent the address object ion json form.
+ * The fields that represent the address object in json form.
*/
public static enum Field {
+ /** the field name for country. */
COUNTRY("country"),
+ /** the field name for latitude. */
LATITUDE("latitude"),
+ /** the field name for locality. */
LOCALITY("locality"),
+ /** the field name for longitude. */
LONGITUDE("longitude"),
+ /** the field name for postalCode. */
POSTAL_CODE("postalCode"),
+ /** the field name for region. */
REGION("region"),
- /** this field may be multiple lines */
+ /** the feild name for streetAddress this field may be multiple lines. */
STREET_ADDRESS("streetAddress"),
+ /** the field name for type. */
TYPE("type"),
+ /** the field name for formatted. */
FORMATTED("formatted"),
+ /** the field name for primary. */
PRIMARY("primary");
/**
@@ -196,7 +205,19 @@
*/
void setFormatted(String formatted);
+ /**
+ * Get a Boolean value indicating whether this instance of the Plural Field is the primary or
+ * preferred value of for this field, e.g. the preferred mailing address. Service Providers MUST
+ * NOT mark more than one instance of the same Plural Field as primary="true", and MAY choose not
+ * to mark any fields as primary, if this information is not available. Introduced in v0.8.1
+ *
+ * @return true if the instance if the primary instance.
+ */
Boolean getPrimary();
+ /**
+ * @see Address.getPrimary()
+ * @param primary set the Primary status of this Address.
+ */
void setPrimary(Boolean primary);
}
Modified: incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/BodyType.java
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/BodyType.java?rev=689497&r1=689496&r2=689497&view=diff
==============================================================================
--- incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/BodyType.java (original)
+++ incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/BodyType.java Wed Aug 27 08:06:03 2008
@@ -30,22 +30,22 @@
public interface BodyType {
/**
- * The fields that represent the person object ion json form.
+ * The fields that represent the person object in serialized form.
*/
public static enum Field {
- /** the json field for build. */
+ /** the field name for build. */
BUILD("build"),
- /** the json field for build. */
+ /** the field name for build. */
EYE_COLOR("eyeColor"),
- /** the json field for hairColor. */
+ /** the field name for hairColor. */
HAIR_COLOR("hairColor"),
- /** the json field for height. */
+ /** the field name for height. */
HEIGHT("height"),
- /** the json field for weight. */
+ /** the field name for weight. */
WEIGHT("weight");
/**
- * The json field that the instance represents.
+ * The field name that the instance represents.
*/
private final String jsonString;
Modified: incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/ListField.java
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/ListField.java?rev=689497&r1=689496&r2=689497&view=diff
==============================================================================
--- incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/ListField.java (original)
+++ incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/ListField.java Wed Aug 27 08:06:03 2008
@@ -23,15 +23,38 @@
@ImplementedBy(ListFieldImpl.class)
+/**
+ * <p>
+ * A Interface to represent list fields where there is potential for one of the items to have a
+ * primary or preferred status. Used where the List is a list of string values.
+ * </p>
+ * <p>
+ * Introduced in v0.8.1
+ * </p>
+ */
public interface ListField {
+ /**
+ * The fields that represent the ListField object in serialized form.
+ */
public static enum Field {
+ /** the field name for value. */
VALUE("value"),
+ /** the field name for type. */
TYPE("type"),
+ /** the field name for primary. */
PRIMARY("primary");
+ /**
+ * The field name that the instance represents.
+ */
private final String jsonString;
+ /**
+ * create a field baseD on the name of an element.
+ *
+ * @param jsonString the name of the element
+ */
private Field(String jsonString) {
this.jsonString = jsonString;
}
@@ -42,15 +65,52 @@
}
}
+ /**
+ * The type of field for this instance, usually used to label the preferred function of the given
+ * contact information. Unless otherwise specified, this string value specifies Canonical Values
+ * of <em>work</em>, <em>home</em>, and <em>other</em>.
+ *
+ * @return the type of the field
+ */
String getType();
+ /**
+ * Set the type of the field.
+ * @param type the type of the field
+ */
void setType(String type);
+ /**
+ * Get the primary value of this field, e.g. the actual e-mail address, phone number, or URL. When
+ * specifying a sortBy field in the Query Parameters for a Plural Field, the default meaning is to
+ * sort based on this value sub-field. Each non-empty Plural Field value MUST contain at least the
+ * value sub-field, but all other sub-fields are optional.
+ *
+ * @return the value of the field
+ */
String getValue();
+ /**
+ * @see ListField.getValue()
+ * @param value the value of the field
+ */
void setValue(String value);
+ /**
+ * Get Boolean value indicating whether this instance of the Plural Field is the primary or
+ * preferred value of for this field, e.g. the preferred mailing address or primary e-mail
+ * address. Service Providers MUST NOT mark more than one instance of the same Plural Field as
+ * primary="true", and MAY choose not to mark any fields as primary, if this information is not
+ * available. For efficiency, Service Providers SHOULD NOT mark all non-primary fields with
+ * primary="false", but should instead omit this sub-field for all non-primary instances.
+ *
+ * @return true if this is a primary or preferred value
+ */
Boolean getPrimary();
+ /**
+ * @see ListField.getPrimary()
+ * @param primary set to true if a primary or preferred value
+ */
void setPrimary(Boolean primary);
}
Modified: incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/MediaItem.java
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/MediaItem.java?rev=689497&r1=689496&r2=689497&view=diff
==============================================================================
--- incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/MediaItem.java (original)
+++ incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/MediaItem.java Wed Aug 27 08:06:03 2008
@@ -22,16 +22,29 @@
import com.google.inject.ImplementedBy;
@ImplementedBy(MediaItemImpl.class)
-
+/**
+ * A container for the media item.
+ */
public interface MediaItem {
public static enum Field {
+ /** the field name for mimeType. */
MIME_TYPE("mimeType"),
+ /** the field name for type. */
TYPE("type"),
+ /** the field name for url. */
URL("url");
+ /**
+ * The field name that the instance represents.
+ */
private final String jsonString;
+ /**
+ * create a field base on the an element name.
+ *
+ * @param jsonString the name of the element
+ */
private Field(String jsonString) {
this.jsonString = jsonString;
}
@@ -42,13 +55,27 @@
}
}
+ /**
+ * An enumeration of potential media types.
+ */
public enum Type {
+ /** the constant for audio types. */
AUDIO("audio"),
+ /** the constant for image types. */
IMAGE("image"),
+ /** the constant for video types. */
VIDEO("video");
+ /**
+ * The field type.
+ */
private final String jsonString;
+ /**
+ * Construct a field type based on the name.
+ *
+ * @param jsonString
+ */
private Type(String jsonString) {
this.jsonString = jsonString;
}
@@ -59,16 +86,46 @@
}
}
+ /**
+ * Get the mime type for this Media item.
+ *
+ * @return the mime type.
+ */
String getMimeType();
+ /**
+ * Set the mimetype for this Media Item.
+ *
+ * @param mimeType the mimeType
+ */
void setMimeType(String mimeType);
+ /**
+ * Get the Type of this media item, either audio, image or video.
+ *
+ * @return the Type of this media item
+ */
Type getType();
+ /**
+ * Get the Type of this media item, either audio, image or video.
+ *
+ * @param the type of this media item
+ */
void setType(Type type);
+ /**
+ * Get a URL for the media item.
+ *
+ * @return the url of the media item
+ */
String getUrl();
+ /**
+ * Set a URL for the media item.
+ *
+ * @param url the media item URL
+ */
void setUrl(String url);
}
Modified: incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Message.java
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Message.java?rev=689497&r1=689496&r2=689497&view=diff
==============================================================================
--- incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Message.java (original)
+++ incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Message.java Wed Aug 27 08:06:03 2008
@@ -34,13 +34,26 @@
public interface Message {
+ /**
+ * An enumeration of field names in a message.
+ */
public static enum Field {
+ /** the field name for body. */
BODY("body"),
+ /** the field name for title. */
TITLE("title"),
+ /** the field name for type. */
TYPE("type");
+ /**
+ * the name of the field.
+ */
private final String jsonString;
+ /**
+ * Create a field based on a name.
+ * @param jsonString the name of the field
+ */
private Field(String jsonString) {
this.jsonString = jsonString;
}
@@ -51,18 +64,28 @@
}
}
+ /**
+ * The type of a message
+ */
public enum Type {
- /* An email */
+ /** An email. */
EMAIL("EMAIL"),
- /* A short private message */
+ /** A short private message. */
NOTIFICATION("NOTIFICATION"),
- /* A message to a specific user that can be seen only by that user */
+ /** A message to a specific user that can be seen only by that user. */
PRIVATE_MESSAGE("PRIVATE_MESSAGE"),
- /* A message to a specific user that can be seen by more than that user */
+ /** A message to a specific user that can be seen by more than that user. */
PUBLIC_MESSAGE("PUBLIC_MESSAGE");
+ /**
+ * The type of message.
+ */
private final String jsonString;
+ /**
+ * Create a message type based on a string token.
+ * @param jsonString the type of message
+ */
private Type(String jsonString) {
this.jsonString = jsonString;
}
Modified: incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Organization.java
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Organization.java?rev=689497&r1=689496&r2=689497&view=diff
==============================================================================
--- incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Organization.java (original)
+++ incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Organization.java Wed Aug 27 08:06:03 2008
@@ -23,32 +23,59 @@
import java.util.Date;
/**
- * see
- * http://code.google.com/apis/opensocial/docs/0.7/reference/opensocial.Organization.Field.html
+ * Describes a current or past organizational affiliation of this contact. Service Providers that
+ * support only a single Company Name and Job Title field should represent them with a single
+ * organization element with name and title properties, respectively.
+ *
+ * see http://code.google.com/apis/opensocial/docs/0.7/reference/opensocial.Organization.Field.html
*
*/
@ImplementedBy(OrganizationImpl.class)
-
public interface Organization {
+ /**
+ * An Enumberation of field names for Organization.
+ */
public static enum Field {
+ /** the name of the address field. */
ADDRESS("address"),
+ /** the name of the description field. */
DESCRIPTION("description"),
+ /** the name of the endDate field. */
END_DATE("endDate"),
+ /** the name of the field field. */
FIELD("field"),
+ /** the name of the name field. */
NAME("name"),
+ /** the name of the salary field. */
SALARY("salary"),
+ /** the name of the startDate field. */
START_DATE("startDate"),
+ /** the name of the subField field. */
SUB_FIELD("subField"),
+ /** the name of the title field. */
TITLE("title"),
+ /** the name of the webpage field. */
WEBPAGE("webpage"),
- /** Should have the value of "job" or "school" to be put in the right js fields */
+ /**
+ * the name of the type field, Should have the value of "job" or "school" to be put in the right
+ * js fields.
+ */
TYPE("type"),
+ /** the name of the primary field. */
PRIMARY("primary");
+ /**
+ * the name of this field.
+ */
private final String jsonString;
+ /**
+ * Construct a field based on the name of the field.
+ *
+ * @param jsonString the name of the field
+ */
private Field(String jsonString) {
this.jsonString = jsonString;
}
@@ -59,52 +86,202 @@
}
}
+ /**
+ * Get the address of the organization, specified as an Address. Container support for this field
+ * is OPTIONAL.
+ *
+ * @return the Address of the organization
+ */
Address getAddress();
+ /**
+ * Set the address of the organization, specified as an Address. Container support for this field
+ * is OPTIONAL.
+ *
+ * @param address the address of the organization
+ */
void setAddress(Address address);
+ /**
+ * Get a description or notes about the person's work in the organization, specified as a string.
+ * This could be the courses taken by a student, or a more detailed description about a
+ * Organization role. Container support for this field is OPTIONAL.
+ *
+ * @return a description about the persons work in the organization
+ */
String getDescription();
+ /**
+ * Set a description or notes about the person's work in the organization, specified as a string.
+ * This could be the courses taken by a student, or a more detailed description about a
+ * Organization role. Container support for this field is OPTIONAL.
+ *
+ * @param description a description about the persons work in the organization
+ */
void setDescription(String description);
+ /**
+ * Get the date the person stopped at the organization, specified as a Date. A null date indicates
+ * that the person is still involved with the organization. Container support for this field is
+ * OPTIONAL.
+ *
+ * @return the date the person stopped at the organization
+ */
Date getEndDate();
+ /**
+ * Set the date the person stopped at the organization, specified as a Date. A null date indicates
+ * that the person is still involved with the organization. Container support for this field is
+ * OPTIONAL.
+ *
+ * @param endDate the date the person stopped at the organization
+ */
void setEndDate(Date endDate);
+ /**
+ * Get the field the organization is in, specified as a string. This could be the degree pursued
+ * if the organization is a school. Container support for this field is OPTIONAL.
+ *
+ * @return the field the organization is in
+ */
String getField();
+ /**
+ * Set the field the organization is in, specified as a string. This could be the degree pursued
+ * if the organization is a school. Container support for this field is OPTIONAL.
+ *
+ * @param field the field the organization is in
+ */
void setField(String field);
+ /**
+ * Get the name of the organization, specified as a string. For example, could be a school name or
+ * a job company. Container support for this field is OPTIONAL.
+ *
+ * @return the name of the organization
+ */
String getName();
+ /**
+ * Set the name of the organization, specified as a string. For example, could be a school name or
+ * a job company. Container support for this field is OPTIONAL.
+ *
+ * @param name the name of the organization
+ */
void setName(String name);
+ /**
+ * Get the salary the person receives from the organization, specified as a string. Container
+ * support for this field is OPTIONAL.
+ *
+ * @return the salary the person receives
+ */
String getSalary();
+ /**
+ * Set the salary the person receives from the organization, specified as a string. Container
+ * support for this field is OPTIONAL.
+ *
+ * @param salary the salary the person receives
+ */
void setSalary(String salary);
+ /**
+ * Get the date the person started at the organization, specified as a Date. Container support for
+ * this field is OPTIONAL.
+ *
+ * @return the start date at the organization
+ */
Date getStartDate();
+ /**
+ * Set the date the person started at the organization, specified as a Date. Container support for
+ * this field is OPTIONAL.
+ *
+ * @param startDate the start date at the organization
+ */
void setStartDate(Date startDate);
+ /**
+ * Get the subfield the Organization is in, specified as a string. Container support for this
+ * field is OPTIONAL.
+ *
+ * @return the subfield the Organization is in
+ */
String getSubField();
+ /**
+ * Set the subfield the Organization is in, specified as a string. Container support for this
+ * field is OPTIONAL.
+ *
+ * @param subField the subfield the Organization is in
+ */
void setSubField(String subField);
+ /**
+ * Get the title or role the person has in the organization, specified as a string. This could be
+ * graduate student, or software engineer. Container support for this field is OPTIONAL.
+ *
+ * @return the title or role the person has in the organization
+ */
String getTitle();
+ /**
+ * Set the title or role the person has in the organization, specified as a string. This could be
+ * graduate student, or software engineer. Container support for this field is OPTIONAL.
+ *
+ * @param title the title or role the person has in the organization
+ */
void setTitle(String title);
+ /**
+ * Get a webpage related to the organization, specified as a string. Container support for this
+ * field is OPTIONAL.
+ *
+ * @return the URL of a webpage related to the organization
+ */
String getWebpage();
+ /**
+ * Get a webpage related to the organization, specified as a string. Container support for this
+ * field is OPTIONAL.
+ *
+ * @param webpage the URL of a webpage related to the organization
+ */
void setWebpage(String webpage);
+ /**
+ * Get the type of field for this instance, usually used to label the preferred function of the
+ * given contact information. The type of organization, with Canonical Values <em>job</em> and
+ * <em>school</em>.
+ *
+ * @return the type of the field
+ */
String getType();
+ /**
+ * Set the type of field for this instance, usually used to label the preferred function of the
+ * given contact information. The type of organization, with Canonical Values <em>job</em> and
+ * <em>school</em>.
+ *
+ * @param type the type of the field
+ */
void setType(String type);
+ /**
+ * Get Boolean value indicating whether this instance of the Plural Field is the primary or
+ * preferred Organization.
+ *
+ * @return true if this is a primary or preferred value
+ */
Boolean getPrimary();
+ /**
+ * Set Boolean value indicating whether this instance of the Plural Field is the primary or
+ * preferred Organization.
+ *
+ * @param primary true if this is a primary or preferred value
+ */
void setPrimary(Boolean primary);
}
Modified: incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Person.java
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Person.java?rev=689497&r1=689496&r2=689497&view=diff
==============================================================================
--- incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Person.java (original)
+++ incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Person.java Wed Aug 27 08:06:03 2008
@@ -35,9 +35,19 @@
*/
@ImplementedBy(PersonImpl.class)
public interface Person {
+ /**
+ * The type of a profile url when represented as a list field.
+ */
public static final String PROFILE_URL_TYPE = "profile";
+
+ /**
+ * The type of thumbnail photo types when represented as list fields.
+ */
public static final String THUMBNAIL_PHOTO_TYPE = "thumbnail";
+ /**
+ * Enumeration of genders.
+ */
public enum Gender {
female, male
}
@@ -48,6 +58,7 @@
public static enum Field {
/** the json field for aboutMe. */
ABOUT_ME("aboutMe"),
+ /** the json field for accounts. */
ACCOUNTS("accounts"),
/** the json field for activities. */
ACTIVITIES("activities"),
@@ -65,6 +76,7 @@
CHILDREN("children"),
/** the json field for currentLocation. */
CURRENT_LOCATION("currentLocation"),
+ /** the json field for birthday. */
BIRTHDAY("birthday"),
/** the json field for drinker. */
DRINKER("drinker"),
@@ -88,6 +100,7 @@
HUMOR("humor"),
/** the json field for id. */
ID("id"),
+ /** the json field for IM accounts. */
IMS("ims"),
/** the json field for interests. */
INTERESTS("interests"),
@@ -111,11 +124,13 @@
NETWORKPRESENCE("networkPresence"),
/** the json field for nickname. */
NICKNAME("nickname"),
+ /** the json field for organiztions. */
ORGANIZATIONS("organizations"),
/** the json field for pets. */
PETS("pets"),
/** the json field for phoneNumbers. */
PHONE_NUMBERS("phoneNumbers"),
+ /** the json field for photos. */
PHOTOS("photos"),
/** the json field for politicalViews. */
POLITICAL_VIEWS("politicalViews"),
@@ -147,6 +162,7 @@
TAGS("tags"),
/** the json field for thumbnailUrl. */
THUMBNAIL_URL("thumbnailUrl"),
+ /** the json field for utcOffset. */
UTC_OFFSET("utcOffset"),
/** the json field for turnOffs. */
TURN_OFFS("turnOffs"),
@@ -169,10 +185,13 @@
THUMBNAIL_URL);
/**
- * The set of all fields
+ * The set of all fields.
*/
public static final Set<String> ALL_FIELDS = EnumUtil.getEnumStrings(Field.values());
+ /**
+ * a Map to convert json string to Field representations.
+ */
private static Map<String, Field> URL_STRING_TO_FIELD_MAP;
/**
@@ -228,8 +247,16 @@
*/
void setAboutMe(String aboutMe);
+ /**
+ * Get the list of online accounts held by this person.
+ * @return a list of Account objects
+ */
List<Account> getAccounts();
+ /**
+ * Set the list of online accounts held by this person.
+ * @param accounts a list of Account objects
+ */
void setAccounts(List<Account> accounts);
/**
@@ -454,14 +481,14 @@
void setFood(List<String> food);
/**
- * Get a person's gender, specified as an {@link Gender}
+ * Get a person's gender, specified as an {@link Gender}.
*
* @return the person's gender
*/
Gender getGender();
/**
- * Set a person's gender, specified as an {@link Gender}
+ * Set a person's gender, specified as an {@link Gender}.
*
* @param newGender the person's gender
*/
@@ -545,8 +572,28 @@
*/
void setId(String id);
+ /**
+ * Get a list of Instant messaging address for this Person. No official canonicalization rules
+ * exist for all instant messaging addresses, but Service Providers SHOULD remove all whitespace
+ * and convert the address to lowercase, if this is appropriate for the service this IM address is
+ * used for. Instead of the standard Canonical Values for type, this field defines the following
+ * Canonical Values to represent currently popular IM services: aim, gtalk, icq, xmpp, msn, skype,
+ * qq, and yahoo.
+ *
+ * @return A list of IM addresses
+ */
List<ListField> getIms();
+ /**
+ * Set a list of Instant messaging address for this Person. No official canonicalization rules
+ * exist for all instant messaging addresses, but Service Providers SHOULD remove all whitespace
+ * and convert the address to lowercase, if this is appropriate for the service this IM address is
+ * used for. Instead of the standard Canonical Values for type, this field defines the following
+ * Canonical Values to represent currently popular IM services: aim, gtalk, icq, xmpp, msn, skype,
+ * qq, and yahoo.
+ *
+ * @param ims a list ListFields representing IM addresses.
+ */
void setIms(List<ListField> ims);
/**
@@ -721,8 +768,16 @@
*/
void setNickname(String nickname);
+ /**
+ * Get a list of current or past organizational affiliations of this Person.
+ * @return a list of Organization objects
+ */
List<Organization> getOrganizations();
+ /**
+ * Set a list of current or past organizational affiliations of this Person.
+ * @param organizations a list of Organisation objects
+ */
void setOrganizations(List<Organization> organizations);
/**
@@ -753,8 +808,23 @@
*/
void setPhoneNumbers(List<ListField> phoneNumbers);
+ /**
+ * URL of a photo of this person. The value SHOULD be a canonicalized URL, and MUST point to an
+ * actual image file (e.g. a GIF, JPEG, or PNG image file) rather than to a web page containing an
+ * image. Service Providers MAY return the same image at different sizes, though it is recognized
+ * that no standard for describing images of various sizes currently exists. Note that this field
+ * SHOULD NOT be used to send down arbitrary photos taken by this user, but specifically profile
+ * photos of the contact suitable for display when describing the contact.
+ *
+ * @return a list of Photos
+ */
List<ListField> getPhotos();
+ /**
+ * Set a list of Photos for the person.
+ * @see Person.getPhotos()
+ * @param photos a list of photos.
+ */
void setPhotos(List<ListField> photos);
/**
Modified: incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Url.java
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Url.java?rev=689497&r1=689496&r2=689497&view=diff
==============================================================================
--- incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Url.java (original)
+++ incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/opensocial/model/Url.java Wed Aug 27 08:06:03 2008
@@ -23,15 +23,32 @@
@ImplementedBy(UrlImpl.class)
+/**
+ * The base interface of all Url objects.
+ */
public interface Url extends ListField {
+ /**
+ * An enumeration of the field names used in Url objects.
+ */
public static enum Field {
+ /** the name of the value field. */
VALUE("value"),
+ /** the name of the linkText field. */
LINK_TEXT("linkText"),
+ /** the name of the type field. */
TYPE("type");
+ /**
+ * The name of this field
+ */
private final String jsonString;
+ /**
+ * Construct a new field based on a name.
+ *
+ * @param jsonString the name of the field
+ */
private Field(String jsonString) {
this.jsonString = jsonString;
}
@@ -42,7 +59,15 @@
}
}
+ /**
+ * Get the text associated with the link.
+ * @return the link text
+ */
String getLinkText();
+ /**
+ * Set the Link text associated with the link.
+ * @param linkText the link text
+ */
void setLinkText(String linkText);
}
Added: incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/sample/oauth/package.html
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/sample/oauth/package.html?rev=689497&view=auto
==============================================================================
--- incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/sample/oauth/package.html (added)
+++ incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/sample/oauth/package.html Wed Aug 27 08:06:03 2008
@@ -0,0 +1,11 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Social Package</title>
+</head>
+<body>
+<h1>Sample OAuth implementation package</h1>
+<p>A Sample implementation of OAuth for the sample container.</p>
+</body>
+</html>
\ No newline at end of file