メモ代わり。てきとーに。 いや、ですからてきとーですって。 2年前ぐらいにPythonあたりでメールくれた方、ごめんなさい。メール紛失してしまい無視した形になってしまいました。。。

2009年7月18日土曜日

[Apache Shindig][お勉強][OpenSocial] メモ55 supportsFieldしながら全項目出力するガジェット

Personオブジェクトの全項目を、いちいちsupportsFieldしながら出力するうんこみたいなガジェット。


<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="OWNER全情報取得">
<Require feature="opensocial-0.8" />
<Require feature="dynamic-height" />
</ModulePrefs>
<Content type="html" view="home,profile,canvas"><![CDATA[
<div id='owner_profile'></div>
<script type="text/javascript">

function requestGetOwnerProfile() {
var params = {};
params[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS] = [
opensocial.Person.Field.ID,
opensocial.Person.Field.NAME,
opensocial.Person.Field.NICKNAME,
opensocial.Person.Field.THUMBNAIL_URL,
opensocial.Person.Field.PROFILE_URL,
opensocial.Person.Field.CURRENT_LOCATION,
opensocial.Person.Field.ADDRESSES,
opensocial.Person.Field.EMAILS,
opensocial.Person.Field.PHONE_NUMBERS,
opensocial.Person.Field.ABOUT_ME,
opensocial.Person.Field.STATUS,
opensocial.Person.Field.PROFILE_SONG,
opensocial.Person.Field.PROFILE_VIDEO,
opensocial.Person.Field.GENDER,
opensocial.Person.Field.SEXUAL_ORIENTATION,
opensocial.Person.Field.RELATIONSHIP_STATUS,
opensocial.Person.Field.AGE,
opensocial.Person.Field.DATE_OF_BIRTH,
opensocial.Person.Field.BODY_TYPE,
opensocial.Person.Field.ETHNICITY,
opensocial.Person.Field.SMOKER,
opensocial.Person.Field.DRINKER,
opensocial.Person.Field.CHILDREN,
opensocial.Person.Field.PETS,
opensocial.Person.Field.LIVING_ARRANGEMENT,
opensocial.Person.Field.TIME_ZONE,
opensocial.Person.Field.LANGUAGES_SPOKEN,
opensocial.Person.Field.JOBS,
opensocial.Person.Field.JOB_INTERESTS,
opensocial.Person.Field.SCHOOLS,
opensocial.Person.Field.INTERESTS,
opensocial.Person.Field.URLS,
opensocial.Person.Field.MUSIC,
opensocial.Person.Field.MOVIES,
opensocial.Person.Field.TV_SHOWS,
opensocial.Person.Field.BOOKS,
opensocial.Person.Field.ACTIVITIES,
opensocial.Person.Field.SPORTS,
opensocial.Person.Field.HEROES,
opensocial.Person.Field.QUOTES,
opensocial.Person.Field.CARS,
opensocial.Person.Field.FOOD,
opensocial.Person.Field.TURN_ONS,
opensocial.Person.Field.TURN_OFFS,
opensocial.Person.Field.TAGS,
opensocial.Person.Field.ROMANCE,
opensocial.Person.Field.SCARED_OF,
opensocial.Person.Field.HAPPIEST_WHEN,
opensocial.Person.Field.FASHION,
opensocial.Person.Field.HUMOR,
opensocial.Person.Field.LOOKING_FOR,
opensocial.Person.Field.RELIGION,
opensocial.Person.Field.POLITICAL_VIEWS,
opensocial.Person.Field.HAS_APP,
opensocial.Person.Field.NETWORK_PRESENCE
];
var req = opensocial.newDataRequest();
req.add(req.newFetchPersonRequest(
opensocial.IdSpec.PersonId.OWNER,
params),
"get_owner");
req.send(handleRequestGetOwnerProfile);
};

function handleRequestGetOwnerProfile(data) {
var owner = data.get("get_owner");
if (owner.hadError()) {
//Handle error using viewer.getError()...
document.getElementById('owner_profile').innerHTML = 'エラーだよーん';
return;
}
var data = owner.getData();
var html = 'displayName:' + data.getDisplayName() + '<br />';
var env = opensocial.getEnvironment();
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.ID)) {
var id = data.getField(opensocial.Person.Field.ID);
var idHtml = '<h2>opensocial.Person.Field.ID</h2><br />';
if (id) {
idHtml = idHtml + id + '<br />';
}
else {
idHtml = idHtml + 'UNDEFINED<br />';
}
document.getElementById('view_ID').innerHTML = idHtml;
}
// Name
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.NAME)) {
var name = data.getField(opensocial.Person.Field.NAME);
var nameHtml = '<h2>opensocial.Person.Field.NAME</h2><br />';
if (name) {
if (env.supportsField(opensocial.Environment.ObjectType.NAME, opensocial.Name.Field.ADDITIONAL_NAME)) {
nameHtml = nameHtml + '<h3>opensocial.Name.Field.ADDITIONAL_NAME</h3><br />';
nameHtml = nameHtml + name.getField(opensocial.Name.Field.ADDITIONAL_NAME) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.NAME, opensocial.Name.Field.FAMILY_NAME)) {
nameHtml = nameHtml + '<h3>opensocial.Name.Field.FAMILY_NAME</h3><br />';
nameHtml = nameHtml + name.getField(opensocial.Name.Field.FAMILY_NAME) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.NAME, opensocial.Name.Field.GIVEN_NAME)) {
nameHtml = nameHtml + '<h3>opensocial.Name.Field.GIVEN_NAME</h3><br />';
nameHtml = nameHtml + name.getField(opensocial.Name.Field.GIVEN_NAME) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.NAME, opensocial.Name.Field.HONORIFIC_PREFIX)) {
nameHtml = nameHtml + '<h3>opensocial.Name.Field.HONORIFIC_PREFIX</h3><br />';
nameHtml = nameHtml + name.getField(opensocial.Name.Field.HONORIFIC_PREFIX) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.NAME, opensocial.Name.Field.HONORIFIC_SUFFIX)) {
nameHtml = nameHtml + '<h3>opensocial.Name.Field.HONORIFIC_SUFFIX</h3><br />';
nameHtml = nameHtml + name.getField(opensocial.Name.Field.HONORIFIC_SUFFIX) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.NAME, opensocial.Name.Field.UNSTRUCTURED)) {
nameHtml = nameHtml + '<h3>opensocial.Name.Field.UNSTRUCTURED</h3><br />';
nameHtml = nameHtml + name.getField(opensocial.Name.Field.UNSTRUCTURED) + '<br />';
}
}
else {
nameHtml = nameHtml + 'UNDEFINED<br />';
}
document.getElementById('view_NAME').innerHTML = nameHtml;
}
else {
document.getElementById('view_NAME').innerHTML = '未対応';
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.NICKNAME)) {
var nickname = data.getField(opensocial.Person.Field.NICKNAME);
var nicknameHtml = '<h2>opensocial.Person.Field.NICKNAME</h2><br />';
if (nickname) {
nicknameHtml = nicknameHtml + nickname + '<br />';
}
else {
nicknameHtml = nicknameHtml + 'UNDEFINED<br />';
}
document.getElementById('view_NICKNAME').innerHTML = nicknameHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.THUMBNAIL_URL)) {
var thumbnailUrl = data.getField(opensocial.Person.Field.THUMBNAIL_URL);
var thumbnailUrlHtml = '<h2>opensocial.Person.Field.THUMBNAIL_URL</h2><br />';
if (thumbnailUrl) {
thumbnailUrlHtml = thumbnailUrlHtml + thumbnailUrl + '<br />';
}
else {
thumbnailUrlHtml = thumbnailUrlHtml + 'UNDEFINED<br />';
}
document.getElementById('view_THUMBNAIL_URL').innerHTML = thumbnailUrlHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.PROFILE_URL)) {
var profileUrl = data.getField(opensocial.Person.Field.PROFILE_URL);
var profileUrlHtml = '<h2>opensocial.Person.Field.PROFILE_URL</h2><br />';
if (profileUrl) {
profileUrlHtml = profileUrlHtml + profileUrl + '<br />';
}
else {
profileUrlHtml = profileUrlHtml + 'UNDEFINED<br />';
}
document.getElementById('view_PROFILE_URL').innerHTML = profileUrlHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.CURRENT_LOCATION)) {
var currentLocation = data.getField(opensocial.Person.Field.CURRENT_LOCATION);
var currentLocationHtml = '<h2>opensocial.Person.Field.CURRENT_LOCATION</h2><br />';
if (currentLocation) {
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.COUNTRY)) {
currentLocationHtml = currentLocationHtml + '<h3>opensocial.Address.Field.COUNTRY</h3><br />';
currentLocationHtml = currentLocationHtml + currentLocation.getField(opensocial.Address.Field.COUNTRY) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.EXTENDED_ADDRESS)) {
currentLocationHtml = currentLocationHtml + '<h3>opensocial.Address.Field.EXTENDED_ADDRESS</h3><br />';
currentLocationHtml = currentLocationHtml + currentLocation.getField(opensocial.Address.Field.EXTENDED_ADDRESS) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.LATITUDE)) {
currentLocationHtml = currentLocationHtml + '<h3>opensocial.Address.Field.LATITUDE</h3><br />';
currentLocationHtml = currentLocationHtml + currentLocation.getField(opensocial.Address.Field.LATITUDE) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.LOCALITY)) {
currentLocationHtml = currentLocationHtml + '<h3>opensocial.Address.Field.LOCALITY</h3><br />';
currentLocationHtml = currentLocationHtml + currentLocation.getField(opensocial.Address.Field.LOCALITY) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.LONGITUDE)) {
currentLocationHtml = currentLocationHtml + '<h3>opensocial.Address.Field.LONGITUDE</h3><br />';
currentLocationHtml = currentLocationHtml + currentLocation.getField(opensocial.Address.Field.LONGITUDE) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.PO_BOX)) {
currentLocationHtml = currentLocationHtml + '<h3>opensocial.Address.Field.PO_BOX</h3><br />';
currentLocationHtml = currentLocationHtml + currentLocation.getField(opensocial.Address.Field.PO_BOX) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.POSTAL_CODE)) {
currentLocationHtml = currentLocationHtml + '<h3>opensocial.Address.Field.POSTAL_CODE</h3><br />';
currentLocationHtml = currentLocationHtml + currentLocation.getField(opensocial.Address.Field.POSTAL_CODE) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.REGION)) {
currentLocationHtml = currentLocationHtml + '<h3>opensocial.Address.Field.REGION</h3><br />';
currentLocationHtml = currentLocationHtml + currentLocation.getField(opensocial.Address.Field.REGION) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.STREET_ADDRESS)) {
currentLocationHtml = currentLocationHtml + '<h3>opensocial.Address.Field.STREET_ADDRESS</h3><br />';
currentLocationHtml = currentLocationHtml + currentLocation.getField(opensocial.Address.Field.STREET_ADDRESS) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.TYPE)) {
currentLocationHtml = currentLocationHtml + '<h3>opensocial.Address.Field.TYPE</h3><br />';
currentLocationHtml = currentLocationHtml + currentLocation.getField(opensocial.Address.Field.TYPE) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.UNSTRUCTURED_ADDRESS)) {
currentLocationHtml = currentLocationHtml + '<h3>opensocial.Address.Field.UNSTRUCTURED_ADDRESS</h3><br />';
currentLocationHtml = currentLocationHtml + currentLocation.getField(opensocial.Address.Field.UNSTRUCTURED_ADDRESS) + '<br />';
}
}
else {
currentLocationHtml = currentLocationHtml + 'UNDEFINED<br />';
}
document.getElementById('view_CURRENT_LOCATION')
.innerHTML = currentLocationHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.ADDRESSES)) {
var addresses = data.getField(opensocial.Person.Field.ADDRESSES);
var addressHtml = '<h2>opensocial.Person.Field.ADDRESSES</h2><br />';
if (addresses) {
for (xx in addresses) {
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.COUNTRY)) {
addressHtml = addressHtml + '<h3>opensocial.Address.Field.COUNTRY</h3><br />';
addressHtml = addressHtml + addresses[xx].getField(opensocial.Address.Field.COUNTRY) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.EXTENDED_ADDRESS)) {
addressHtml = addressHtml + '<h3>opensocial.Address.Field.EXTENDED_ADDRESS</h3><br />';
addressHtml = addressHtml + addresses[xx].getField(opensocial.Address.Field.EXTENDED_ADDRESS) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.LATITUDE)) {
addressHtml = addressHtml + '<h3>opensocial.Address.Field.LATITUDE</h3><br />';
addressHtml = addressHtml + addresses[xx].getField(opensocial.Address.Field.LATITUDE) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.LOCALITY)) {
addressHtml = addressHtml + '<h3>opensocial.Address.Field.LOCALITY</h3><br />';
addressHtml = addressHtml + addresses[xx].getField(opensocial.Address.Field.LOCALITY) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.LONGITUDE)) {
addressHtml = addressHtml + '<h3>opensocial.Address.Field.LONGITUDE</h3><br />';
addressHtml = addressHtml + addresses[xx].getField(opensocial.Address.Field.LONGITUDE) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.PO_BOX)) {
addressHtml = addressHtml + '<h3>opensocial.Address.Field.PO_BOX</h3><br />';
addressHtml = addressHtml + addresses[xx].getField(opensocial.Address.Field.PO_BOX) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.POSTAL_CODE)) {
addressHtml = addressHtml + '<h3>opensocial.Address.Field.POSTAL_CODE</h3><br />';
addressHtml = addressHtml + addresses[xx].getField(opensocial.Address.Field.POSTAL_CODE) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.REGION)) {
addressHtml = addressHtml + '<h3>opensocial.Address.Field.REGION</h3><br />';
addressHtml = addressHtml + addresses[xx].getField(opensocial.Address.Field.REGION) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.STREET_ADDRESS)) {
addressHtml = addressHtml + '<h3>opensocial.Address.Field.STREET_ADDRESS</h3><br />';
addressHtml = addressHtml + addresses[xx].getField(opensocial.Address.Field.STREET_ADDRESS) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.TYPE)) {
addressHtml = addressHtml + '<h3>opensocial.Address.Field.TYPE</h3><br />';
addressHtml = addressHtml + addresses[xx].getField(opensocial.Address.Field.TYPE) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.UNSTRUCTURED_ADDRESS)) {
addressHtml = addressHtml + '<h3>opensocial.Address.Field.UNSTRUCTURED_ADDRESS</h3><br />';
addressHtml = addressHtml + addresses[xx].getField(opensocial.Address.Field.UNSTRUCTURED_ADDRESS) + '<br />';
}

addressHtml = addressHtml + xx + '番目終わり----------------------------------------------------------<br />';
}
}
else {
addressHtml = addressHtml + 'UNDEFINED<br />';
}
document.getElementById('view_ADDRESSES').innerHTML = addressHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.EMAILS)) {
var emails = data.getField(opensocial.Person.Field.EMAILS);
var emailHtml = '<h2>opensocial.Person.Field.EMAILS</h2><br />';
if (emails) {
for (xx in emails) {
if (env.supportsField(opensocial.Environment.ObjectType.EMAIL, opensocial.Email.Field.ADDRESS)) {
emailHtml = emailHtml + '<h3>opensocial.Email.Field.ADDRESS</h3><br />';
emailHtml = emailHtml + emails[xx].getField(opensocial.Email.Field.ADDRESS) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.EMAIL, opensocial.Email.Field.TYPE)) {
emailHtml = emailHtml + '<h3>opensocial.Email.Field.TYPE</h3><br />';
emailHtml = emailHtml + emails[xx].getField(opensocial.Email.Field.TYPE) + '<br />';
}
emailHtml = emailHtml + xx + '番目終了 --------------------------------------<br />';
}
}
else {
emailHtml = emailHtml + 'UNDEFINED<br />';
}
document.getElementById('view_EMAILS').innerHTML = emailHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.PHONE_NUMBERS)) {
var phones = data.getField(opensocial.Person.Field.PHONE_NUMBERS);
var phoneHtml = '<h2>opensocial.Person.Field.PHONE_NUMBERS</h2><br />';
if (phones) {
for (xx in phones) {
if (env.supportsField(opensocial.Environment.ObjectType.PHONE, opensocial.Phone.Field.NUMBER)) {
phoneHtml = phoneHtml + '<h3>opensocial.Phone.Field.NUMBER</h3><br />';
phoneHtml = phoneHtml + phones[xx].getField(opensocial.Phone.Field.NUMBER) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.PHONE, opensocial.Phone.Field.TYPE)) {
phoneHtml = phoneHtml + '<h3>opensocial.Phone.Field.TYPE</h3><br />';
phoneHtml = phoneHtml + phones[xx].getField(opensocial.Phone.Field.TYPE) + '<br />';
}
phoneHtml = phoneHtml + xx + '番目終了 --------------------------------------<br />';
}
}
else {
phoneHtml = phoneHtml + 'UNDEFINED<br />';
}
document.getElementById('view_PHONE_NUMBERS').innerHTML = phoneHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.ABOUT_ME)) {
var aboutMe = data.getField(opensocial.Person.Field.ABOUT_ME);
var aboutMeHtml = '<h2>opensocial.Person.Field.ABOUT_ME</h2><br />';
if (aboutMe) {
aboutMeHtml = aboutMeHtml + aboutMe + '<br />';
}
else {
aboutMeHtml = aboutMeHtml + 'UNDEFINED<br />';
}
document.getElementById('view_ABOUT_ME').innerHTML = aboutMeHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.STATUS)) {
var status = data.getField(opensocial.Person.Field.STATUS);
var statusHtml = '<h2>opensocial.Person.Field.STATUS</h2><br />';
if (status) {
statusHtml = statusHtml + status + '<br />';
}
else {
statusHtml = statusHtml + 'UNDEFINED<br />';
}
document.getElementById('view_STATUS').innerHTML = statusHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.PROFILE_SONG)) {
var profileSong = data.getField(opensocial.Person.Field.PROFILE_SONG);
var profileSongHtml = '<h2>opensocial.Person.Field.PROFILE_SONG</h2><br />';
if (profileSong) {
if (env.supportsField(opensocial.Environment.ObjectType.URL, opensocial.Url.Field.ADDRESS)) {
profileSongHtml = profileSongHtml + '<h3>opensocial.Url.Field.ADDRESS</h3><br />';
profileSongHtml = profileSongHtml + profileSong.getField(opensocial.Url.Field.ADDRESS) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.URL, opensocial.Url.Field.LINK_TEXT)) {
profileSongHtml = profileSongHtml + '<h3>opensocial.Url.Field.LINK_TEXT</h3><br />';
profileSongHtml = profileSongHtml + profileSong.getField(opensocial.Url.Field.LINK_TEXT) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.URL, opensocial.Url.Field.TYPE)) {
profileSongHtml = profileSongHtml + '<h3>opensocial.Url.Field.TYPE</h3><br />';
profileSongHtml = profileSongHtml + profileSong.getField(opensocial.Url.Field.TYPE) + '<br />';
}
}
else {
profileSongHtml = profileSongHtml + 'UNDEFINED<br />';
}
document.getElementById('view_PROFILE_SONG').innerHTML = profileSongHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.PROFILE_VIDEO)) {
var profileVideo = data.getField(opensocial.Person.Field.PROFILE_VIDEO);
var profileVideoHtml = '<h2>opensocial.Person.Field.PROFILE_VIDEO</h2><br />';
if (profileVideo) {
if (env.supportsField(opensocial.Environment.ObjectType.URL, opensocial.Url.Field.ADDRESS)) {
profileVideoHtml = profileVideoHtml + '<h3>opensocial.Url.Field.ADDRESS</h3><br />';
profileVideoHtml = profileVideoHtml + profileVideo.getField(opensocial.Url.Field.ADDRESS) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.URL, opensocial.Url.Field.LINK_TEXT)) {
profileVideoHtml = profileVideoHtml + '<h3>opensocial.Url.Field.LINK_TEXT</h3><br />';
profileVideoHtml = profileVideoHtml + profileVideo.getField(opensocial.Url.Field.LINK_TEXT) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.URL, opensocial.Url.Field.TYPE)) {
profileVideoHtml = profileVideoHtml + '<h3>opensocial.Url.Field.TYPE</h3><br />';
profileVideoHtml = profileVideoHtml + profileVideo.getField(opensocial.Url.Field.TYPE) + '<br />';
}
}
else {
profileVideoHtml = profileVideoHtml + 'UNDEFINED<br />';
}
document.getElementById('view_PROFILE_VIDEO').innerHTML = profileVideoHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.GENDER)) {
var gender = data.getField(opensocial.Person.Field.GENDER);
var genderHtml = '<h2>opensocial.Person.Field.GENDER</h2><br />';
if (gender) {
genderHtml = genderHtml + gender.getDisplayValue() + '<br />';
}
else {
genderHtml = genderHtml + 'UNDEFINED<br />';
}
document.getElementById('view_GENDER').innerHTML = genderHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.SEXUAL_ORIENTATION)) {
var sexualOrientation = data.getField(opensocial.Person.Field.SEXUAL_ORIENTATION);
var sexualOrientationHtml = '<h2>opensocial.Person.Field.SEXUAL_ORIENTATION</h2><br />';
if (sexualOrientation) {
sexualOrientationHtml = sexualOrientationHtml + sexualOrientation + '<br />';
}
else {
sexualOrientationHtml = sexualOrientationHtml + 'UNDEFINED<br />';
}
document.getElementById('view_SEXUAL_ORIENTATION').innerHTML = sexualOrientationHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.RELATIONSHIP_STATUS)) {
var relationshipStatus = data.getField(opensocial.Person.Field.RELATIONSHIP_STATUS);
var relationshipStatusHtml = '<h2>opensocial.Person.Field.RELATIONSHIP_STATUS</h2><br />';
if (relationshipStatus) {
relationshipStatusHtml = relationshipStatusHtml + relationshipStatus + '<br />';
}
else {
relationshipStatusHtml = relationshipStatusHtml + 'UNDEFINED<br />';
}
document.getElementById('view_RELATIONSHIP_STATUS').innerHTML = relationshipStatusHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.AGE)) {
var age = data.getField(opensocial.Person.Field.AGE);
var ageHtml = '<h2>opensocial.Person.Field.AGE</h2><br />';
if (age) {
ageHtml = ageHtml + age + '<br />';
}
else {
ageHtml = ageHtml + 'UNDEFINED<br />';
}
document.getElementById('view_AGE').innerHTML = ageHtml;

}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.DATE_OF_BIRTH)) {
var dateOfBirth = data.getField(opensocial.Person.Field.DATE_OF_BIRTH);
var dateOfBirthHtml = '<h2>opensocial.Person.Field.DATE_OF_BIRTH</h2><br />';
if (dateOfBirth) {
dateOfBirthHtml = dateOfBirthHtml + dateOfBirth + '<br />';
}
else {
dateOfBirthHtml = dateOfBirthHtml + 'UNDEFINED<br />';
}
document.getElementById('view_DATE_OF_BIRTH').innerHTML = dateOfBirthHtml;

}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.BODY_TYPE)) {
var bodyType = data.getField(opensocial.Person.Field.BODY_TYPE);
var bodyTypeHtml = '<h2>opensocial.Person.Field.BODY_TYPE</h2><br />';
if (bodyType) {
if (env.supportsField(opensocial.Environment.ObjectType.BODY_TYPE, opensocial.BodyType.Field.BUILD)) {
var build = bodyType.getField(opensocial.BodyType.Field.BUILD);
var buildHtml = '<h3>opensocial.BodyType.Field.BUILD</h3><br />';
if (build) {
buildHtml = buildHtml + build + '<br />';
}
else {
buildHtml = buildHtml + 'UNDEFINED<br />';
}
bodyTypeHtml = bodyTypeHtml + buildHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.BODY_TYPE, opensocial.BodyType.Field.EYE_COLOR)) {
var eyeColor = bodyType.getField(opensocial.BodyType.Field.EYE_COLOR);
var eyeColorHtml = '<h3>opensocial.BodyType.Field.EYE_COLOR</h3><br />';
if (eyeColor) {
eyeColorHtml = eyeColorHtml + eyeColor + '<br />';
}
else {
eyeColorHtml = eyeColorHtml + 'UNDEFINED<br />';
}
bodyTypeHtml = bodyTypeHtml + eyeColorHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.BODY_TYPE, opensocial.BodyType.Field.HAIR_COLOR)) {
var hairColor = bodyType.getField(opensocial.BodyType.Field.HAIR_COLOR);
var hairColorHtml = '<h3>opensocial.BodyType.Field.HAIR_COLOR</h3><br />';
if (hairColor) {
hairColorHtml = hairColorHtml + hairColor + '<br />';
}
else {
hairColorHtml = hairColorHtml + 'UNDEFINED<br />';
}
bodyTypeHtml = bodyTypeHtml + hairColorHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.BODY_TYPE, opensocial.BodyType.Field.HEIGHT)) {
var height = bodyType.getField(opensocial.BodyType.Field.HEIGHT);
var heightHtml = '<h3>opensocial.BodyType.Field.HEIGHT</h3><br />';
if (! isNaN(height)) {
heightHtml = heightHtml + height + '<br />';
}
else {
heightHtml = heightHtml + 'UNDEFINED<br />';
}
bodyTypeHtml = bodyTypeHtml + heightHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.BODY_TYPE, opensocial.BodyType.Field.WEIGHT)) {
var weight = bodyType.getField(opensocial.BodyType.Field.WEIGHT);
var weightHtml = '<h3>opensocial.BodyType.Field.WEIGHT</h3><br />';
if (! isNaN(weight)) {
weightHtml = weightHtml + weight + '<br />';
}
else {
weightHtml = weightHtml + 'UNDEFINED<br />';
}
bodyTypeHtml = bodyTypeHtml + weightHtml;
}
}
else {
bodyTypeHtml = bodyTypeHtml + 'UNDEFINED<br />';
}
document.getElementById('view_BODY_TYPE').innerHTML = bodyTypeHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.ETHNICITY)) {
var ethnicity = data.getField(opensocial.Person.Field.ETHNICITY);
var ethnicityHtml = '<h2>opensocial.Person.Field.ETHNICITY</h2><br />';
if (ethnicity) {
ethnicityHtml = ethnicityHtml + ethnicity;
}
else {
ethnicityHtml = ethnicityHtml + 'UNDEFINED<br />';
}
document.getElementById('view_ETHNICITY').innerHTML = ethnicityHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.SMOKER)) {
var smoker = data.getField(opensocial.Person.Field.SMOKER);
var smokerHtml = '<h2>opensocial.Person.Field.SMOKER</h2><br />';
if (smoker) {
smokerHtml = smokerHtml + smoker.getDisplayValue();
}
else {
smokerHtml = smokerHtml + 'UNDEFINED<br />';
}
document.getElementById('view_SMOKER').innerHTML = smokerHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.DRINKER)) {
var drinker = data.getField(opensocial.Person.Field.DRINKER);
var drinkerHtml = '<h2>opensocial.Person.Field.DRINKER</h2><br />';
if (drinker) {
drinkerHtml = drinkerHtml + drinker.getDisplayValue();
}
else {
drinkerHtml = drinkerHtml + 'UNDEFINED<br />';
}
document.getElementById('view_DRINKER').innerHTML = drinkerHtml;

}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.CHILDREN)) {
var children = data.getField(opensocial.Person.Field.CHILDREN);
var childrenHtml = '<h2>opensocial.Person.Field.CHILDREN</h2><br />';
if (children) {
childrenHtml = childrenHtml + children + '<br />';
}
else {
childrenHtml = childrenHtml + 'UNDEFINED<br />';
}
document.getElementById('view_CHILDREN').innerHTML = childrenHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.PETS)) {
var pets = data.getField(opensocial.Person.Field.PETS);
var petsHtml = '<h2>opensocial.Person.Field.PETS</h2><br />';
if (pets) {
petsHtml = petsHtml + pets + '<br />';
}
else {
petsHtml = petsHtml + 'UNDEFINED<br />';
}
document.getElementById('view_PETS').innerHTML = petsHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.LIVING_ARRANGEMENT)) {
var livingArrangement = data.getField(opensocial.Person.Field.LIVING_ARRANGEMENT);
var livingArrangementHtml = '<h2>opensocial.Person.Field.LIVING_ARRANGEMENT</h2><br />';
if (livingArrangement) {
livingArrangementHtml = livingArrangementHtml + livingArrangement + '<br />';
}
else {
livingArrangementHtml = livingArrangementHtml + 'UNDEFINED<br />';
}
document.getElementById('view_LIVING_ARRANGEMENT').innerHTML = livingArrangementHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.TIME_ZONE)) {
var timeZone = data.getField(opensocial.Person.Field.TIME_ZONE);
var timeZoneHtml = '<h2>opensocial.Person.Field.TIME_ZONE</h2><br />';
if (timeZone) {
timeZoneHtml = timeZoneHtml + timeZone + '<br />';
}
else {
timeZoneHtml = timeZoneHtml + 'UNDEFINED<br />';
}
document.getElementById('view_TIME_ZONE').innerHTML = timeZoneHtml;

}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.LANGUAGE_SPOKEN)) {
var languagesSpoken = data.getField(opensocial.Person.Field.LANGUAGES_SPOKEN);
var languagesSpokenHtml = '<h2>opensocial.Person.Field.LANGUAGES_SPOKEN</h2><br />';
if (languagesSpoken) {
languagesSpokenHtml = languagesSpokenHtml + languagesSpoken + '<br />';
}
else {
languagesSpokenHtml = languagesSpokenHtml + 'UNDEFINED<br />';
}
document.getElementById('view_LANGUAGES_SPOKEN').innerHTML = languagesSpokenHtml;

}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.JOBS)) {
var jobs = data.getField(opensocial.Person.Field.JOBS);
var jobsHtml = '<h2>opensocial.Person.Field.JOBS</h2><br />';
if (jobs) {
for (xx in jobs) {
if (env.supportsField(opensocial.Environment.ObjectType.ORGANIZATION, opensocial.Organization.Field.NAME)) {
jobsHtml = jobsHtml + '<h3>opensocial.Organization.Field.NAME</h3>';
jobsHtml = jobsHtml + jobs[xx].getField(opensocial.Organization.Field.NAME) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ORGANIZATION, opensocial.Organization.Field.ADDRESS)) {
var address = jobs[xx].getField(opensocial.Organization.Field.ADDRESS);
jobsHtml = jobsHtml + '<h3>opensocial.Organization.Field.ADDRESS</h3>';

if (address) {
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.COUNTRY)) {
jobsHtml = jobsHtml + '<h4>opensocial.Address.Field.COUNTRY</h4>';
jobsHtml = jobsHtml + address.getField(opensocial.Address.Field.COUNTRY) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.EXTENDED_ADDRESS)) {
jobsHtml = jobsHtml + '<h4>opensocial.Address.Field.EXTENDED_ADDRESS</h4>';
jobsHtml = jobsHtml + address.getField(opensocial.Address.Field.EXTENDED_ADDRESS) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.LATITUDE)) {
jobsHtml = jobsHtml + '<h4>opensocial.Address.Field.LATITUDE</h4>';
jobsHtml = jobsHtml + address.getField(opensocial.Address.Field.LATITUDE) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.LOCALITY)) {
jobsHtml = jobsHtml + '<h4>opensocial.Address.Field.LOCALITY</h4>';
jobsHtml = jobsHtml + address.getField(opensocial.Address.Field.LOCALITY) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.LONGITUDE)) {
jobsHtml = jobsHtml + '<h4>opensocial.Address.Field.LONGITUDE</h4>';
jobsHtml = jobsHtml + address.getField(opensocial.Address.Field.LONGITUDE) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.PO_BOX)) {
jobsHtml = jobsHtml + '<h4>opensocial.Address.Field.PO_BOX</h4>';
jobsHtml = jobsHtml + address.getField(opensocial.Address.Field.PO_BOX) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.POSTAL_CODE)) {
jobsHtml = jobsHtml + '<h4>opensocial.Address.Field.POSTAL_CODE</h4>';
jobsHtml = jobsHtml + address.getField(opensocial.Address.Field.POSTAL_CODE) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.REGION)) {
jobsHtml = jobsHtml + '<h4>opensocial.Address.Field.REGION</h4>';
jobsHtml = jobsHtml + address.getField(opensocial.Address.Field.REGION) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.STREET_ADDRESS)) {
jobsHtml = jobsHtml + '<h4>opensocial.Address.Field.STREET_ADDRESS</h4>';
jobsHtml = jobsHtml + address.getField(opensocial.Address.Field.STREET_ADDRESS) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.TYPE)) {
jobsHtml = jobsHtml + '<h4>opensocial.Address.Field.TYPE</h4>';
jobsHtml = jobsHtml + address.getField(opensocial.Address.Field.TYPE) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.UNSTRUCTURED_ADDRESS)) {
jobsHtml = jobsHtml + '<h4>opensocial.Address.Field.UNSTRUCTURED_ADDRESS</h4>';
jobsHtml = jobsHtml + address.getField(opensocial.Address.Field.UNSTRUCTURED_ADDRESS) + '<br />';
}
}
}
if (env.supportsField(opensocial.Environment.ObjectType.ORGANIZATION, opensocial.Organization.Field.DESCRIPTION)) {
jobsHtml = jobsHtml + '<h3>opensocial.Organization.Field.DESCRIPTION</h3>';
jobsHtml = jobsHtml + jobs[xx].getField(opensocial.Organization.Field.DESCRIPTION) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ORGANIZATION, opensocial.Organization.Field.END_DATE)) {
jobsHtml = jobsHtml + '<h3>opensocial.Organization.Field.END_DATE</h3>';
jobsHtml = jobsHtml + jobs[xx].getField(opensocial.Organization.Field.END_DATE) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ORGANIZATION, opensocial.Organization.Field.FIELD)) {
jobsHtml = jobsHtml + '<h3>opensocial.Organization.Field.FIELD</h3>';
jobsHtml = jobsHtml + jobs[xx].getField(opensocial.Organization.Field.FIELD) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ORGANIZATION, opensocial.Organization.Field.SALARY)) {
jobsHtml = jobsHtml + '<h3>opensocial.Organization.Field.SALARY</h3>';
jobsHtml = jobsHtml + jobs[xx].getField(opensocial.Organization.Field.SALARY) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ORGANIZATION, opensocial.Organization.Field.START_DATE)) {
jobsHtml = jobsHtml + '<h3>opensocial.Organization.Field.START_DATE</h3>';
jobsHtml = jobsHtml + jobs[xx].getField(opensocial.Organization.Field.START_DATE) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ORGANIZATION, opensocial.Organization.Field.SUB_FIELD)) {
jobsHtml = jobsHtml + '<h3>opensocial.Organization.Field.SUB_FIELD</h3>';
jobsHtml = jobsHtml + jobs[xx].getField(opensocial.Organization.Field.SUB_FIELD) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ORGANIZATION, opensocial.Organization.Field.TITLE)) {
jobsHtml = jobsHtml + '<h3>opensocial.Organization.Field.TITLE</h3>';
jobsHtml = jobsHtml + jobs[xx].getField(opensocial.Organization.Field.TITLE) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ORGANIZATION, opensocial.Organization.Field.WEBPAGE)) {
jobsHtml = jobsHtml + '<h3>opensocial.Organization.Field.WEBPAGE</h3>';
jobsHtml = jobsHtml + jobs[xx].getField(opensocial.Organization.Field.WEBPAGE) + '<br />';
}
}
}
else {
jobsHtml = jobsHtml + 'UNDEFINED<br />';
}
document.getElementById('view_JOBS').innerHTML = jobsHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.JOB_INTEREST)) {
var jobInterests = data.getField(opensocial.Person.Field.JOB_INTERESTS);
var jobInterestsHtml = '<h2>opensocial.Person.Field.JOB_INTERESTS</h2><br />';
if (jobInterests) {
jobInterestsHtml = jobInterestsHtml + jobInterests + '<br />';
}
else {
jobInterestsHtml = jobInterestsHtml + 'UNDEFINED<br />';
}
document.getElementById('view_JOB_INTERESTS').innerHTML = jobInterestsHtml;

}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.SCHOOLS)) {
var schools = data.getField(opensocial.Person.Field.SCHOOLS);
var schoolsHtml = '<h2>opensocial.Person.Field.SCHOOLS</h2><br />';
if (schools) {
for (xx in schools) {
if (env.supportsField(opensocial.Environment.ObjectType.ORGANIZATION, opensocial.Organization.Field.NAME)) {
schoolsHtml = schoolsHtml + '<h3>opensocial.Organization.Field.NAME</h3>';
schoolsHtml = schoolsHtml + schools[xx].getField(opensocial.Organization.Field.NAME) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ORGANIZATION, opensocial.Organization.Field.ADDRESS)) {
var address = schools[xx].getField(opensocial.Organization.Field.ADDRESS);
schoolsHtml = schoolsHtml + '<h3>opensocial.Organization.Field.ADDRESS</h3>';

if (address) {
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.COUNTRY)) {
schoolsHtml = schoolsHtml + '<h4>opensocial.Address.Field.COUNTRY</h4>';
schoolsHtml = schoolsHtml + address.getField(opensocial.Address.Field.COUNTRY) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.EXTENDED_ADDRESS)) {
schoolsHtml = schoolsHtml + '<h4>opensocial.Address.Field.EXTENDED_ADDRESS</h4>';
schoolsHtml = schoolsHtml + address.getField(opensocial.Address.Field.EXTENDED_ADDRESS) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.LATITUDE)) {
schoolsHtml = schoolsHtml + '<h4>opensocial.Address.Field.LATITUDE</h4>';
schoolsHtml = schoolsHtml + address.getField(opensocial.Address.Field.LATITUDE) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.LOCALITY)) {
schoolsHtml = schoolsHtml + '<h4>opensocial.Address.Field.LOCALITY</h4>';
schoolsHtml = schoolsHtml + address.getField(opensocial.Address.Field.LOCALITY) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.LONGITUDE)) {
schoolsHtml = schoolsHtml + '<h4>opensocial.Address.Field.LONGITUDE</h4>';
schoolsHtml = schoolsHtml + address.getField(opensocial.Address.Field.LONGITUDE) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.PO_BOX)) {
schoolsHtml = schoolsHtml + '<h4>opensocial.Address.Field.PO_BOX</h4>';
schoolsHtml = schoolsHtml + address.getField(opensocial.Address.Field.PO_BOX) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.POSTAL_CODE)) {
schoolsHtml = schoolsHtml + '<h4>opensocial.Address.Field.POSTAL_CODE</h4>';
schoolsHtml = schoolsHtml + address.getField(opensocial.Address.Field.POSTAL_CODE) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.REGION)) {
schoolsHtml = schoolsHtml + '<h4>opensocial.Address.Field.REGION</h4>';
schoolsHtml = schoolsHtml + address.getField(opensocial.Address.Field.REGION) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.STREET_ADDRESS)) {
schoolsHtml = schoolsHtml + '<h4>opensocial.Address.Field.STREET_ADDRESS</h4>';
schoolsHtml = schoolsHtml + address.getField(opensocial.Address.Field.STREET_ADDRESS) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.TYPE)) {
schoolsHtml = schoolsHtml + '<h4>opensocial.Address.Field.TYPE</h4>';
schoolsHtml = schoolsHtml + address.getField(opensocial.Address.Field.TYPE) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ADDRESS, opensocial.Address.Field.UNSTRUCTURED_ADDRESS)) {
schoolsHtml = schoolsHtml + '<h4>opensocial.Address.Field.UNSTRUCTURED_ADDRESS</h4>';
schoolsHtml = schoolsHtml + address.getField(opensocial.Address.Field.UNSTRUCTURED_ADDRESS) + '<br />';
}
}
}
if (env.supportsField(opensocial.Environment.ObjectType.ORGANIZATION, opensocial.Organization.Field.DESCRIPTION)) {
schoolsHtml = schoolsHtml + '<h3>opensocial.Organization.Field.DESCRIPTION</h3>';
schoolsHtml = schoolsHtml + schools[xx].getField(opensocial.Organization.Field.DESCRIPTION) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ORGANIZATION, opensocial.Organization.Field.END_DATE)) {
schoolsHtml = schoolsHtml + '<h3>opensocial.Organization.Field.END_DATE</h3>';
schoolsHtml = schoolsHtml + schools[xx].getField(opensocial.Organization.Field.END_DATE) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ORGANIZATION, opensocial.Organization.Field.FIELD)) {
schoolsHtml = schoolsHtml + '<h3>opensocial.Organization.Field.FIELD</h3>';
schoolsHtml = schoolsHtml + schools[xx].getField(opensocial.Organization.Field.FIELD) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ORGANIZATION, opensocial.Organization.Field.SALARY)) {
schoolsHtml = schoolsHtml + '<h3>opensocial.Organization.Field.SALARY</h3>';
schoolsHtml = schoolsHtml + schools[xx].getField(opensocial.Organization.Field.SALARY) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ORGANIZATION, opensocial.Organization.Field.START_DATE)) {
schoolsHtml = schoolsHtml + '<h3>opensocial.Organization.Field.START_DATE</h3>';
schoolsHtml = schoolsHtml + schools[xx].getField(opensocial.Organization.Field.START_DATE) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ORGANIZATION, opensocial.Organization.Field.SUB_FIELD)) {
schoolsHtml = schoolsHtml + '<h3>opensocial.Organization.Field.SUB_FIELD</h3>';
schoolsHtml = schoolsHtml + schools[xx].getField(opensocial.Organization.Field.SUB_FIELD) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ORGANIZATION, opensocial.Organization.Field.TITLE)) {
schoolsHtml = schoolsHtml + '<h3>opensocial.Organization.Field.TITLE</h3>';
schoolsHtml = schoolsHtml + schools[xx].getField(opensocial.Organization.Field.TITLE) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.ORGANIZATION, opensocial.Organization.Field.WEBPAGE)) {
schoolsHtml = schoolsHtml + '<h3>opensocial.Organization.Field.WEBPAGE</h3>';
schoolsHtml = schoolsHtml + schools[xx].getField(opensocial.Organization.Field.WEBPAGE) + '<br />';
}
}
}
else {
schoolsHtml = schoolsHtml + 'UNDEFINED<br />';
}
document.getElementById('view_SCHOOLS').innerHTML = schoolsHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.INTERESTS)) {
var interests = data.getField(opensocial.Person.Field.INTERESTS);
var interestsHtml = '<h2>opensocial.Person.Field.INTERESTS</h2><br />';
if (interests) {
interestsHtml = interestsHtml + interests + '<br />';
}
else {
interestsHtml = interestsHtml + 'UNDEFINED<br />';
}
document.getElementById('view_INTERESTS').innerHTML = interestsHtml;

}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.URLS)) {
var urls = data.getField(opensocial.Person.Field.URLS);
var urlsHtml = '<h2>opensocial.Person.Field.URLS</h2><br />';
if (urls) {
for (xx in urls) {
if (env.supportsField(opensocial.Environment.ObjectType.URL, opensocial.Url.Field.ADDRESS)) {
urlsHtml = urlsHtml + '<h3>opensocial.Url.Field.ADDRESS</h3><br />';
urlsHtml = urlsHtml + urls[xx].getField(opensocial.Url.Field.ADDRESS) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.URL, opensocial.Url.Field.LINK_TEXT)) {
urlsHtml = urlsHtml + '<h3>opensocial.Url.Field.LINK_TEXT</h3><br />';
urlsHtml = urlsHtml + urls[xx].getField(opensocial.Url.Field.LINK_TEXT) + '<br />';
}
if (env.supportsField(opensocial.Environment.ObjectType.URL, opensocial.Url.Field.TYPE)) {
urlsHtml = urlsHtml + '<h3>opensocial.Url.Field.TYPE</h3><br />';
urlsHtml = urlsHtml + urls[xx].getField(opensocial.Url.Field.TYPE) + '<br />';
}
}
}
else {
urlsHtml = urlsHtml + 'UNDEFINED<br />';
}
document.getElementById('view_URLS').innerHTML = urlsHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.MUSIC)) {
var music = data.getField(opensocial.Person.Field.MUSIC);
var musicHtml = '<h2>opensocial.Person.Field.MUSIC</h2><br />';
if (music) {
for (xx in music) {
musicHtml = musicHtml + music[xx] + '<br />';
}
}
else {
musicHtml = musicHtml + 'UNDEFINED<br />';
}
document.getElementById('view_MUSIC').innerHTML = musicHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.MOVIES)) {
var movie = data.getField(opensocial.Person.Field.MOVIES);
var movieHtml = '<h2>opensocial.Person.Field.MOVIES</h2><br />';
if (movie) {
for (xx in movie) {
movieHtml = movieHtml + movie[xx] + '<br />';
}
}
else {
movieHtml = movieHtml + 'UNDEFINED<br />';
}
document.getElementById('view_MOVIES').innerHTML = movieHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.TV_SHOWS)) {
var tvShow = data.getField(opensocial.Person.Field.TV_SHOWS);
var tvShowHtml = '<h2>opensocial.Person.Field.TV_SHOWS</h2><br />';
if (tvShow) {
for (xx in tvShow) {
tvShowHtml = tvShowHtml + tvShow[xx] + '<br />';
}
}
else {
tvShowHtml = tvShowHtml + 'UNDEFINED<br />';
}
document.getElementById('view_TV_SHOWS').innerHTML = tvShowHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.BOOKS)) {
var book = data.getField(opensocial.Person.Field.BOOKS);
var bookHtml = '<h2>opensocial.Person.Field.BOOKS</h2><br />';
if (book) {
for (xx in book) {
bookHtml = bookHtml + book[xx] + '<br />';
}
}
else {
bookHtml = bookHtml + 'UNDEFINED<br />';
}
document.getElementById('view_BOOKS').innerHTML = bookHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.ACTIVITIES)) {
var activities = data.getField(opensocial.Person.Field.ACTIVITIES);
var activitiesHtml = '<h2>opensocial.Person.Field.ACTIVITIES</h2><br />';
if (activities) {
for (xx in activities) {
activitiesHtml = activitiesHtml + activities[xx] + '<br />';
}
}
else {
activitiesHtml = activitiesHtml + 'UNDEFINED<br />';
}
document.getElementById('view_ACTIVITIES').innerHTML = activitiesHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.SPORTS)) {
var sports = data.getField(opensocial.Person.Field.SPORTS);
var sportsHtml = '<h2>opensocial.Person.Field.SPORTS</h2><br />';
if (sports) {
for (xx in sports) {
sportsHtml = sportsHtml + sports[xx] + '<br />';
}
}
else {
sportsHtml = sportsHtml + 'UNDEFINED<br />';
}
document.getElementById('view_SPORTS').innerHTML = sportsHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.HEROES)) {
var heroes = data.getField(opensocial.Person.Field.HEROES);
var heroesHtml = '<h2>opensocial.Person.Field.HEROES</h2><br />';
if (heroes) {
for (xx in heroes) {
heroesHtml = heroesHtml + heroes[xx] + '<br />';
}
}
else {
heroesHtml = heroesHtml + 'UNDEFINED<br />';
}
document.getElementById('view_HEROES').innerHTML = heroesHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.QUOTES)) {
var quotes = data.getField(opensocial.Person.Field.QUOTES);
var quotesHtml = '<h2>opensocial.Person.Field.QUOTES</h2><br />';
if (quotes) {
for (xx in quotes) {
quotesHtml = quotesHtml + quotes[xx] + '<br />';
}
}
else {
quotesHtml = quotesHtml + 'UNDEFINED<br />';
}
document.getElementById('view_QUOTES').innerHTML = quotesHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.CARS)) {
var cars = data.getField(opensocial.Person.Field.CARS);
var carsHtml = '<h2>opensocial.Person.Field.CARS</h2><br />';
if (cars) {
for (xx in cars) {
carsHtml = carsHtml + cars[xx] + '<br />';
}
}
else {
carsHtml = carsHtml + 'UNDEFINED<br />';
}
document.getElementById('view_CARS').innerHTML = carsHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.FOOD)) {
var food = data.getField(opensocial.Person.Field.FOOD);
var foodHtml = '<h2>opensocial.Person.Field.FOOD</h2><br />';
if (food) {
for (xx in food) {
foodHtml = foodHtml + food[xx] + '<br />';
}
}
else {
foodHtml = foodHtml + 'UNDEFINED<br />';
}
document.getElementById('view_FOOD').innerHTML = foodHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.TURN_ONS)) {
var turnOns = data.getField(opensocial.Person.Field.TURN_ONS);
var turnOnsHtml = '<h2>opensocial.Person.Field.TURN_ONS</h2><br />';
if (turnOns) {
for (xx in turnOns) {
turnOnsHtml = turnOnsHtml + turnOns[xx] + '<br />';
}
}
else {
turnOnsHtml = turnOnsHtml + 'UNDEFINED<br />';
}
document.getElementById('view_TURN_ONS').innerHTML = turnOnsHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.TURN_OFFS)) {
var turnOffs = data.getField(opensocial.Person.Field.TURN_OFFS);
var turnOffsHtml = '<h2>opensocial.Person.Field.TURN_OFFS</h2><br />';
if (turnOffs) {
for (xx in turnOffs) {
turnOffsHtml = turnOffsHtml + turnOffs[xx] + '<br />';
}
}
else {
turnOffsHtml = turnOffsHtml + 'UNDEFINED<br />';
}
document.getElementById('view_TURN_OFFS').innerHTML = turnOffsHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.TAGS)) {
var tags = data.getField(opensocial.Person.Field.TAGS);
var tagsHtml = '<h2>opensocial.Person.Field.TAGS</h2><br />';
if (tags) {
for (xx in tags) {
tagsHtml = tagsHtml + tags[xx] + '<br />';
}
}
else {
tagsHtml = tagsHtml + 'UNDEFINED<br />';
}
document.getElementById('view_TAGS').innerHTML = tagsHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.ROMANCE)) {
var romance = data.getField(opensocial.Person.Field.ROMANCE);
var romanceHtml = '<h2>opensocial.Person.Field.ROMANCE</h2><br />';
if (romance) {
romanceHtml = romanceHtml + romance + '<br />';
}
else {
romanceHtml = romanceHtml + 'UNDEFINED<br />';
}
document.getElementById('view_ROMANCE').innerHTML = romanceHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.SCARED_OF)) {
var scaredOf = data.getField(opensocial.Person.Field.SCARED_OF);
var scaredOfHtml = '<h2>opensocial.Person.Field.SCARED_OF</h2><br />';
if (scaredOf) {
scaredOfHtml = scaredOfHtml + scaredOf + '<br />';
}
else {
scaredOfHtml = scaredOfHtml + 'UNDEFINED<br />';
}
document.getElementById('view_SCARED_OF').innerHTML = scaredOfHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.HAPPIEST_WHEN)) {
var happiestWhen = data.getField(opensocial.Person.Field.HAPPIEST_WHEN);
var happiestWhenHtml = '<h2>opensocial.Person.Field.HAPPIEST_WHEN</h2><br />';
if (happiestWhen) {
happiestWhenHtml = happiestWhenHtml + happiestWhen + '<br />';
}
else {
happiestWhenHtml = happiestWhenHtml + 'UNDEFINED<br />';
}
document.getElementById('view_HAPPIEST_WHEN').innerHTML = happiestWhenHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.FASHION)) {
var fashion = data.getField(opensocial.Person.Field.FASHION);
var fashionHtml = '<h2>opensocial.Person.Field.FASHION</h2><br />';
if (fashion) {
fashionHtml = fashionHtml + fashion + '<br />';
}
else {
fashionHtml = fashionHtml + 'UNDEFINED<br />';
}
document.getElementById('view_FASHION').innerHTML = fashionHtml;

}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.HUMOR)) {
var humor = data.getField(opensocial.Person.Field.HUMOR);
var humorHtml = '<h2>opensocial.Person.Field.HUMOR</h2><br />';
if (humor) {
humorHtml = humorHtml + humor + '<br />';
}
else {
humorHtml = humorHtml + 'UNDEFINED<br />';
}
document.getElementById('view_HUMOR').innerHTML = humorHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.LOOKING_FOR)) {
var lookingFor = data.getField(opensocial.Person.Field.LOOKING_FOR);
var lookingForHtml = '<h2>opensocial.Person.Field.LOOKING_FOR</h2><br />';
if (lookingFor) {
for (xx in lookingFor) {
if (lookingFor[xx]) {
lookingForHtml = lookingForHtml + lookingFor[xx].getDisplayValue() + '<br />';
}
}
}
else {
lookingForHtml = lookingForHtml + 'UNDEFINED<br />';
}
document.getElementById('view_LOOKING_FOR').innerHTML = lookingForHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.RELIGION)) {
var religion = data.getField(opensocial.Person.Field.RELIGION);
var religionHtml = '<h2>opensocial.Person.Field.RELIGION</h2><br />';
if (religion) {
religionHtml = religionHtml + religion + '<br />';
}
else {
religionHtml = religionHtml + 'UNDEFINED<br />';
}
document.getElementById('view_RELIGION').innerHTML = religionHtml;
}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.POLITICAL_VIEWS)) {
var politicalViews = data.getField(opensocial.Person.Field.POLITICAL_VIEWS);
var politicalViewsHtml = '<h2>opensocial.Person.Field.POLITICAL_VIEWS</h2><br />';
if (politicalViews) {
politicalViewsHtml = politicalViewsHtml + politicalViews + '<br />';
}
else {
politicalViewsHtml = politicalViewsHtml + 'UNDEFINED<br />';
}
document.getElementById('view_POLITICAL_VIEWS').innerHTML = politicalViewsHtml;

}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.HAS_APP)) {
var hasApp = data.getField(opensocial.Person.Field.HAS_APP);
var hasAppHtml = '<h2>opensocial.Person.Field.HAS_APP</h2><br />';
if (hasApp) {
hasAppHtml = hasAppHtml + hasApp + '<br />';
}
else {
hasAppHtml = hasAppHtml + 'UNDEFINED<br />';
}
document.getElementById('view_HAS_APP').innerHTML = hasAppHtml;

}
if (env.supportsField(opensocial.Environment.ObjectType.PERSON, opensocial.Person.Field.NETWORK_PRESENCE)) {
var networkPresence = data.getField(opensocial.Person.Field.NETWORK_PRESENCE);
var networkPresenceHtml = '<h2>opensocial.Person.Field.NETWORK_PRESENCE</h2><br />';
if (networkPresence) {
networkPresenceHtml = networkPresenceHtml + networkPresence.getDisplayValue() + '<br />';
}
else {
networkPresenceHtml = networkPresenceHtml + 'UNDEFINED<br />';
}
document.getElementById('view_NETWORK_PRESENCE').innerHTML = networkPresenceHtml;

}

// 自動調節
gadgets.window.adjustHeight();
};

gadgets.util.registerOnLoadHandler(requestGetOwnerProfile);

</script>
<div id='view_ID'></div>
<div id='view_NAME'></div>
<div id='view_NICKNAME'></div>
<div id='view_THUMBNAIL_URL'></div>
<div id='view_PROFILE_URL'></div>
<div id='view_CURRENT_LOCATION'></div>
<div id='view_ADDRESSES'></div>
<div id='view_EMAILS'></div>
<div id='view_PHONE_NUMBERS'></div>
<div id='view_ABOUT_ME'></div>
<div id='view_STATUS'></div>
<div id='view_PROFILE_SONG'></div>
<div id='view_PROFILE_VIDEO'></div>
<div id='view_GENDER'></div>
<div id='view_SEXUAL_ORIENTATION'></div>
<div id='view_RELATIONSHIP_STATUS'></div>
<div id='view_AGE'></div>
<div id='view_DATE_OF_BIRTH'></div>
<div id='view_BODY_TYPE'></div>
<div id='view_ETHNICITY'></div>
<div id='view_SMOKER'></div>
<div id='view_DRINKER'></div>
<div id='view_CHILDREN'></div>
<div id='view_PETS'></div>
<div id='view_LIVING_ARRANGEMENT'></div>
<div id='view_TIME_ZONE'></div>
<div id='view_LANGUAGES_SPOKEN'></div>
<div id='view_JOBS'></div>
<div id='view_JOB_INTERESTS'></div>
<div id='view_SCHOOLS'></div>
<div id='view_INTERESTS'></div>
<div id='view_URLS'></div>
<div id='view_MUSIC'></div>
<div id='view_MOVIES'></div>
<div id='view_TV_SHOWS'></div>
<div id='view_BOOKS'></div>
<div id='view_ACTIVITIES'></div>
<div id='view_SPORTS'></div>
<div id='view_HEROES'></div>
<div id='view_QUOTES'></div>
<div id='view_CARS'></div>
<div id='view_FOOD'></div>
<div id='view_TURN_ONS'></div>
<div id='view_TURN_OFFS'></div>
<div id='view_TAGS'></div>
<div id='view_ROMANCE'></div>
<div id='view_SCARED_OF'></div>
<div id='view_HAPPIEST_WHEN'></div>
<div id='view_FASHION'></div>
<div id='view_HUMOR'></div>
<div id='view_LOOKING_FOR'></div>
<div id='view_RELIGION'></div>
<div id='view_POLITICAL_VIEWS'></div>
<div id='view_HAS_APP'></div>
<div id='view_NETWORK_PRESENCE'></div>
]]>
</Content>
</Module>




えらく疲れた。。。
コード出力にはFireBugのconsole.logを使った。。
けど、、ねぇ。。

.

0 コメント: