You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by Jordan Zimmerman <jo...@shop.com> on 2009/04/17 00:15:59 UTC

BasicHttpFetcher.CONNECT_TIMEOUT_MS

The timeout in BasicHttpFetcher is hard-coded to 5 seconds. It would be
much better to have this be changeable. Yes? 

It could be done by adding a new method to HttpFetcher - something like
setProperties() or setConstants(). There are two hard coded values now
(timeout and the currently unused connection timeout). This new method
would allow changing of either of these values and any future values. 

Alternatively, it could be done via Guice named parameters. But that has
the downside of making it difficult to change as the HttpFetcher
singleton is created very early by the DefaultGuiceModule.

Jordan Zimmerman
Principal Software Architect
831.647.4712
831.214.2990 (cell)
jordanz@shop.com 

SHOP*COMTM
Shop Smart, Save Big(tm)
www.shop.com


This message (including any attachments) is intended only for
the use of the individual or entity to which it is addressed and
may contain information that is non-public, proprietary,
privileged, confidential, and exempt from disclosure under
applicable law or may constitute as attorney work product.
If you are not the intended recipient, you are hereby notified
that any use, dissemination, distribution, or copying of this
communication is strictly prohibited. If you have received this
communication in error, notify us immediately by telephone and
(i) destroy this message if a facsimile or (ii) delete this 
message
immediately if this is an electronic communication.

Thank you.

Re: Shindig and Activities

Posted by Rodrigo Gallardo <ro...@nul-unu.com>.
On Fri, Apr 17, 2009 at 03:26:42PM -0700, Jordan Zimmerman wrote:
> 2) The specs I've seen state that "it is usually beneficial to create
> activities using Message Templates." But, I don't see where Message
> Templates are defined or how they relate to Activities. Does Shindig
> support Message Templates? If so, where are they defined/documented?

Apart from
http://code.google.com/apis/opensocial/docs/0.8/reference/#opensocial.Activity
(which I guess is the spec you are quoting) there is some more info on
templates in
http://code.google.com/apis/gadgets/docs/i18n.html#Bundles

In a nutshell, using titleId/bodyId in an activity allows it to have
its text come from the gadget's bundle of translated messages, instead
of having it hardcoded. This enables things like localizing them on
the fly to the locale of the user viewing it and summarizing repeated
activities by grouping on one of the parameters present in the template.

shindig "supports" message templates in that it will receive templateIds
and template parameters for an activity and will forward them to the
ActivityService for storage. As it is the container, and not shindig,
that will eventually display those activities, it is up to it to
actually do something with the templates, presumably querying the IDs
from the gadget xml and performing the substitutions into the template.

Re: Shindig and Activities

Posted by Louis Ryan <lr...@google.com>.
1. All the Java POJOs have get/set as the data binders use that rather than
fields

2. A hole in the spec that no one has been clamoring to fix IMHO

On Fri, Apr 17, 2009 at 3:26 PM, Jordan Zimmerman <jo...@shop.com> wrote:

> 1) Why does the Shindig Activity object break out all the fields of the
> activity as separate getters/setters? It seems redundant with the Field
> enum.
>
> 2) The specs I've seen state that "it is usually beneficial to create
> activities using Message Templates." But, I don't see where Message
> Templates are defined or how they relate to Activities. Does Shindig
> support Message Templates? If so, where are they defined/documented?
>
> Jordan Zimmerman
> Principal Software Architect
> 831.647.4712
> 831.214.2990 (cell)
> jordanz@shop.com
>
> SHOP*COMTM
> Shop Smart, Save Big(tm)
> www.shop.com
>
> This message (including any attachments) is intended only for
> the use of the individual or entity to which it is addressed and
> may contain information that is non-public, proprietary,
> privileged, confidential, and exempt from disclosure under
> applicable law or may constitute as attorney work product.
> If you are not the intended recipient, you are hereby notified
> that any use, dissemination, distribution, or copying of this
> communication is strictly prohibited. If you have received this
> communication in error, notify us immediately by telephone and
> (i) destroy this message if a facsimile or (ii) delete this
> message
> immediately if this is an electronic communication.
>
> Thank you.
>

Shindig and Activities

Posted by Jordan Zimmerman <jo...@shop.com>.
1) Why does the Shindig Activity object break out all the fields of the
activity as separate getters/setters? It seems redundant with the Field
enum.

2) The specs I've seen state that "it is usually beneficial to create
activities using Message Templates." But, I don't see where Message
Templates are defined or how they relate to Activities. Does Shindig
support Message Templates? If so, where are they defined/documented?

Jordan Zimmerman
Principal Software Architect
831.647.4712
831.214.2990 (cell)
jordanz@shop.com 

SHOP*COMTM
Shop Smart, Save Big(tm)
www.shop.com

This message (including any attachments) is intended only for
the use of the individual or entity to which it is addressed and
may contain information that is non-public, proprietary,
privileged, confidential, and exempt from disclosure under
applicable law or may constitute as attorney work product.
If you are not the intended recipient, you are hereby notified
that any use, dissemination, distribution, or copying of this
communication is strictly prohibited. If you have received this
communication in error, notify us immediately by telephone and
(i) destroy this message if a facsimile or (ii) delete this 
message
immediately if this is an electronic communication.

Thank you.

Re: Another Shindig OAuth example

Posted by Mark D Weitzel <we...@us.ibm.com>.
Chris,

Done.
https://issues.apache.org/jira/browse/SHINDIG-1020

-Mark W.



From:
Chris Chabot <ch...@google.com>
To:
shindig-dev@incubator.apache.org
Date:
04/17/2009 11:53 AM
Subject:
Re: Another Shindig OAuth example



Hey Mark,

Great news to hear you got it up and running!

From a pure formalities point of view, could you possible add that zipfile
to a JIRA issue (see
http://incubator.apache.org/shindig/issue-tracking.htmlfor details).
The checkbox that states that your contributing this under the
APL 2.0 is required for us to consider including it.

Thanks for sharing your feedback and resources, OAuth is quite tricky to 
get
working for many, so I'm sure this will be very useful to a lot of people!

   -- Chris

On Fri, Apr 17, 2009 at 4:44 PM, Mark D Weitzel <we...@us.ibm.com> 
wrote:

> I’ve been working with OAuth a bit lately. Since there has been a bunch 
of
> work on the OAuth support in Shindig, I wanted to be able to use the 
OAuth
> example and leverage Shindig as the provider. To create this example, I
> simply took the existing sample app from the OAuth project and added a
> Shindig consumer.
>
> Here’s what I did to get this working. I’ve attached all the files here 
if
> other people want to try this out.
> OAUTH:
> * Created ShindigConsumer.java. This was based off of 
SampleProvider.java.
> I just removed the “echo” code and changed the invocation to use the 
social
> api.
> * Added entries to consumer properties for shindig. As a side note, I 
also
> changed the sample provider to look on port 9090 just to be consistent 
with
> the oauth example in shindig.
> * Added the Shindig servlet to web.xml and index.jsp
>
> SHINDIG:
> * Added an entry to OAuth.json
> * Added entries to canonicaldb.json
>
> If this example makes sense, would it be possible to consider making 
this
> one of the “out of the box” providers with both projects? I can add a 
page
> to the wiki to explain how to get this up and running....
> Thanks a bunch,
> -Mark W.
>




Re: Another Shindig OAuth example

Posted by Chris Chabot <ch...@google.com>.
Hey Mark,

Great news to hear you got it up and running!

>From a pure formalities point of view, could you possible add that zipfile
to a JIRA issue (see
http://incubator.apache.org/shindig/issue-tracking.htmlfor details).
The checkbox that states that your contributing this under the
APL 2.0 is required for us to consider including it.

Thanks for sharing your feedback and resources, OAuth is quite tricky to get
working for many, so I'm sure this will be very useful to a lot of people!

   -- Chris

On Fri, Apr 17, 2009 at 4:44 PM, Mark D Weitzel <we...@us.ibm.com> wrote:

> I’ve been working with OAuth a bit lately. Since there has been a bunch of
> work on the OAuth support in Shindig, I wanted to be able to use the OAuth
> example and leverage Shindig as the provider. To create this example, I
> simply took the existing sample app from the OAuth project and added a
> Shindig consumer.
>
> Here’s what I did to get this working. I’ve attached all the files here if
> other people want to try this out.
> OAUTH:
> * Created ShindigConsumer.java. This was based off of SampleProvider.java.
> I just removed the “echo” code and changed the invocation to use the social
> api.
> * Added entries to consumer properties for shindig. As a side note, I also
> changed the sample provider to look on port 9090 just to be consistent with
> the oauth example in shindig.
> * Added the Shindig servlet to web.xml and index.jsp
>
> SHINDIG:
> * Added an entry to OAuth.json
> * Added entries to canonicaldb.json
>
> If this example makes sense, would it be possible to consider making this
> one of the “out of the box” providers with both projects? I can add a page
> to the wiki to explain how to get this up and running....
> Thanks a bunch,
> -Mark W.
>

Another Shindig OAuth example

Posted by Mark D Weitzel <we...@us.ibm.com>.
I’ve been working with OAuth a bit lately. Since there has been a bunch of 
work on the OAuth support in Shindig, I wanted to be able to use the OAuth 
example and leverage Shindig as the provider. To create this example, I 
simply took the existing sample app from the OAuth project and added a 
Shindig consumer. 

Here’s what I did to get this working. I’ve attached all the files here if 
other people want to try this out.
OAUTH: 
* Created ShindigConsumer.java. This was based off of SampleProvider.java. 
I just removed the “echo” code and changed the invocation to use the 
social api.
* Added entries to consumer properties for shindig. As a side note, I also 
changed the sample provider to look on port 9090 just to be consistent 
with the oauth example in shindig.
* Added the Shindig servlet to web.xml and index.jsp

SHINDIG:
* Added an entry to OAuth.json
* Added entries to canonicaldb.json

If this example makes sense, would it be possible to consider making this 
one of the “out of the box” providers with both projects? I can add a page 
to the wiki to explain how to get this up and running....
Thanks a bunch, 
-Mark W.


Re: OAuth problem (400) with disallowed content type

Posted by Kevin Brown <et...@google.com>.
The content type can (and should) be specified in the request headers.

You probably want something like this:

gadgets.io.makeRequest("localhost:7070/social/api", callback, {
  METHOD: "POST",
  AUTHORIZATION: "OAUTH",
  CONTENT_TYPE: "JSON", // This refers to the expected result type
  POST_DATA: gadgets.io.encodeValues(jsonRpcRequest),
  HEADERS: { "Content-Type",  "text/json"}
});

On Fri, Apr 17, 2009 at 8:28 PM, Mark D Weitzel <we...@us.ibm.com> wrote:

> Quick question regarding the recent work with Shindig's OAuth support.
> Here's the scenario: I've got two instances of Shindig running, one on
> port 7070 the other on 8080. What I'd like to be able to do is a
> makeRequest(restURL) from a gadget on 8080 to 7070. This would cause the
> OAuth to kick in and I should see the oauthpopup and the login screen from
> the second shindig. The goal is to easily see the "end-to-end" behavior of
> what shindig does for OAuth. For convenience, I'm just hitting the social
> api on the second (7070) shindig.
>
> So all was working great until.... I loaded the latest code from trunk.
> Now, when I do the make request from the gadget rendered from shindig on
> 8080, I get a null pointer exception because line 203 of
> OAuthAuthenticationHandler returns null and I get the error:
> "Cannot use disallowed Content-Type application/x-www-form-urlencoded
> description The request sent by the client was syntactically incorrect
> (Cannot use disallowed Content-Type application/x-www-form-urlencoded)"
>
> I saw the post on why x-www-form-urlencoded is no longer allowed, but my
> question is, how can I set the content type to application/json on the
> makeRequest? It seems like it should be pretty easy to have two shindigs
> talking to each other but somehow they started tripping over in the last
> week. Is there another secret setting on the OAuth decoder ring that I
> need to be aware of?
>
> Thanks (again) for all the help.
>
> -Mark W.
>
>

OAuth problem (400) with disallowed content type

Posted by Mark D Weitzel <we...@us.ibm.com>.
Quick question regarding the recent work with Shindig's OAuth support.
Here's the scenario: I've got two instances of Shindig running, one on 
port 7070 the other on 8080. What I'd like to be able to do is a 
makeRequest(restURL) from a gadget on 8080 to 7070. This would cause the 
OAuth to kick in and I should see the oauthpopup and the login screen from 
the second shindig. The goal is to easily see the "end-to-end" behavior of 
what shindig does for OAuth. For convenience, I'm just hitting the social 
api on the second (7070) shindig.

So all was working great until.... I loaded the latest code from trunk. 
Now, when I do the make request from the gadget rendered from shindig on 
8080, I get a null pointer exception because line 203 of 
OAuthAuthenticationHandler returns null and I get the error: 
"Cannot use disallowed Content-Type application/x-www-form-urlencoded 
description The request sent by the client was syntactically incorrect 
(Cannot use disallowed Content-Type application/x-www-form-urlencoded)"

I saw the post on why x-www-form-urlencoded is no longer allowed, but my 
question is, how can I set the content type to application/json on the 
makeRequest? It seems like it should be pretty easy to have two shindigs 
talking to each other but somehow they started tripping over in the last 
week. Is there another secret setting on the OAuth decoder ring that I 
need to be aware of?

Thanks (again) for all the help.

-Mark W.


RE: BasicHttpFetcher.CONNECT_TIMEOUT_MS

Posted by Jordan Zimmerman <jo...@shop.com>.
> I'd throw some setters on BasicHttpFetcher

https://issues.apache.org/jira/browse/SHINDIG-1018

Jordan Zimmerman
Principal Software Architect
831.647.4712
831.214.2990 (cell)
jordanz@shop.com 

SHOP*COMTM
Shop Smart, Save Big(tm)
www.shop.com

This message (including any attachments) is intended only for
the use of the individual or entity to which it is addressed and
may contain information that is non-public, proprietary,
privileged, confidential, and exempt from disclosure under
applicable law or may constitute as attorney work product.
If you are not the intended recipient, you are hereby notified
that any use, dissemination, distribution, or copying of this
communication is strictly prohibited. If you have received this
communication in error, notify us immediately by telephone and
(i) destroy this message if a facsimile or (ii) delete this 
message
immediately if this is an electronic communication.

Thank you.

Re: BasicHttpFetcher.CONNECT_TIMEOUT_MS

Posted by Adam Winer <aw...@google.com>.
I'd throw some setters on BasicHttpFetcher, and call those setters
from a Guice Provider (instead of just binding HttpFetcher directly to
BasicHttpFetcher).  Patches welcome for the first half.

On Fri, Apr 17, 2009 at 9:52 AM, Jordan Zimmerman <jo...@shop.com> wrote:
> *bump*
>
> This needs a solution.
>
> Jordan Zimmerman
> Principal Software Architect
> 831.647.4712
> 831.214.2990 (cell)
> jordanz@shop.com
>
> SHOP*COMTM
> Shop Smart, Save Big(tm)
> www.shop.com
>
> -----Original Message-----
> From: Jordan Zimmerman [mailto:jordanz@shop.com]
> Sent: Thursday, April 16, 2009 3:20 PM
> To: shindig-dev@incubator.apache.org
> Subject: RE: BasicHttpFetcher.CONNECT_TIMEOUT_MS
>
> Doh - the second hard-cdoe is the unused max bytes
>
> Jordan Zimmerman
> Principal Software Architect
> 831.647.4712
> 831.214.2990 (cell)
> jordanz@shop.com
>
> SHOP*COMTM
> Shop Smart, Save Big(tm)
> www.shop.com
>
>
> -----Original Message-----
> From: Jordan Zimmerman [mailto:jordanz@shop.com]
> Sent: Thursday, April 16, 2009 3:16 PM
> To: shindig-dev@incubator.apache.org
> Subject: BasicHttpFetcher.CONNECT_TIMEOUT_MS
>
> The timeout in BasicHttpFetcher is hard-coded to 5 seconds. It would be
> much better to have this be changeable. Yes?
>
> It could be done by adding a new method to HttpFetcher - something like
> setProperties() or setConstants(). There are two hard coded values now
> (timeout and the currently unused connection timeout). This new method
> would allow changing of either of these values and any future values.
>
> Alternatively, it could be done via Guice named parameters. But that has
> the downside of making it difficult to change as the HttpFetcher
> singleton is created very early by the DefaultGuiceModule.
>
> Jordan Zimmerman
> Principal Software Architect
> 831.647.4712
> 831.214.2990 (cell)
> jordanz@shop.com
>
> SHOP*COMTM
> Shop Smart, Save Big(tm)
> www.shop.com
>
>
>
> This message (including any attachments) is intended only for
> the use of the individual or entity to which it is addressed and
> may contain information that is non-public, proprietary,
> privileged, confidential, and exempt from disclosure under
> applicable law or may constitute as attorney work product.
> If you are not the intended recipient, you are hereby notified
> that any use, dissemination, distribution, or copying of this
> communication is strictly prohibited. If you have received this
> communication in error, notify us immediately by telephone and
> (i) destroy this message if a facsimile or (ii) delete this
> message
> immediately if this is an electronic communication.
>
> Thank you.
>

RE: BasicHttpFetcher.CONNECT_TIMEOUT_MS

Posted by Jordan Zimmerman <jo...@shop.com>.
*bump*

This needs a solution.

Jordan Zimmerman
Principal Software Architect
831.647.4712
831.214.2990 (cell)
jordanz@shop.com 

SHOP*COMTM
Shop Smart, Save Big(tm)
www.shop.com

-----Original Message-----
From: Jordan Zimmerman [mailto:jordanz@shop.com] 
Sent: Thursday, April 16, 2009 3:20 PM
To: shindig-dev@incubator.apache.org
Subject: RE: BasicHttpFetcher.CONNECT_TIMEOUT_MS

Doh - the second hard-cdoe is the unused max bytes

Jordan Zimmerman
Principal Software Architect
831.647.4712
831.214.2990 (cell)
jordanz@shop.com 

SHOP*COMTM
Shop Smart, Save Big(tm)
www.shop.com


-----Original Message-----
From: Jordan Zimmerman [mailto:jordanz@shop.com] 
Sent: Thursday, April 16, 2009 3:16 PM
To: shindig-dev@incubator.apache.org
Subject: BasicHttpFetcher.CONNECT_TIMEOUT_MS

The timeout in BasicHttpFetcher is hard-coded to 5 seconds. It would be
much better to have this be changeable. Yes? 

It could be done by adding a new method to HttpFetcher - something like
setProperties() or setConstants(). There are two hard coded values now
(timeout and the currently unused connection timeout). This new method
would allow changing of either of these values and any future values. 

Alternatively, it could be done via Guice named parameters. But that has
the downside of making it difficult to change as the HttpFetcher
singleton is created very early by the DefaultGuiceModule.

Jordan Zimmerman
Principal Software Architect
831.647.4712
831.214.2990 (cell)
jordanz@shop.com 

SHOP*COMTM
Shop Smart, Save Big(tm)
www.shop.com



This message (including any attachments) is intended only for
the use of the individual or entity to which it is addressed and
may contain information that is non-public, proprietary,
privileged, confidential, and exempt from disclosure under
applicable law or may constitute as attorney work product.
If you are not the intended recipient, you are hereby notified
that any use, dissemination, distribution, or copying of this
communication is strictly prohibited. If you have received this
communication in error, notify us immediately by telephone and
(i) destroy this message if a facsimile or (ii) delete this 
message
immediately if this is an electronic communication.

Thank you.

Another Shindig OAuth example

Posted by Mark D Weitzel <we...@us.ibm.com>.
I’ve been working with OAuth a bit lately. Since there has been a bunch of 
work on the OAuth support in Shindig, I wanted to be able to use the OAuth 
example and leverage Shindig as the provider. To create this example, I 
simply took the existing sample app from the OAuth project and added a 
Shindig consumer. 

Here’s what I did to get this working. I’ve attached all the files here if 
other people want to try this out.
OAUTH: 
* Created ShindigConsumer.java. This was based off of SampleProvider.java. 
I just removed the “echo” code and changed the invocation to use the 
social api.
* Added entries to consumer properties for shindig. As a side note, I also 
changed the sample provider to look on port 9090 just to be consistent 
with the oauth example in shindig.
* Added the Shindig servlet to web.xml and index.jsp

SHINDIG:
* Added an entry to OAuth.json
* Added entries to canonicaldb.json

If this example makes sense, would it be possible to consider making this 
one of the “out of the box” providers with both projects? I can add a page 
to the wiki to explain how to get this up and running....
Thanks a bunch, 
-Mark W.


Another Shindig OAuth example

Posted by Mark D Weitzel <we...@us.ibm.com>.
I’ve been working with OAuth a bit lately. Since there has been a bunch of 
work on the OAuth support in Shindig, I wanted to be able to use the OAuth 
example and leverage Shindig as the provider. To create this example, I 
simply took the existing sample app from the OAuth project and added a 
Shindig consumer. 

Here’s what I did to get this working. I’ve attached all the files here if 
other people want to try this out.
OAUTH: 
* Created ShindigConsumer.java. This was based off of SampleProvider.java. 
I just removed the “echo” code and changed the invocation to use the 
social api.
* Added entries to consumer properties for shindig. As a side note, I also 
changed the sample provider to look on port 9090 just to be consistent 
with the oauth example in shindig.
* Added the Shindig servlet to web.xml and index.jsp

SHINDIG:
* Added an entry to OAuth.json
* Added entries to canonicaldb.json

If this example makes sense, would it be possible to consider making this 
one of the “out of the box” providers with both projects? I can add a page 
to the wiki to explain how to get this up and running....
Thanks a bunch, 
-Mark W.


RE: BasicHttpFetcher.CONNECT_TIMEOUT_MS

Posted by Jordan Zimmerman <jo...@shop.com>.
Doh - the second hard-cdoe is the unused max bytes

Jordan Zimmerman
Principal Software Architect
831.647.4712
831.214.2990 (cell)
jordanz@shop.com 

SHOP*COMTM
Shop Smart, Save Big(tm)
www.shop.com


-----Original Message-----
From: Jordan Zimmerman [mailto:jordanz@shop.com] 
Sent: Thursday, April 16, 2009 3:16 PM
To: shindig-dev@incubator.apache.org
Subject: BasicHttpFetcher.CONNECT_TIMEOUT_MS

The timeout in BasicHttpFetcher is hard-coded to 5 seconds. It would be
much better to have this be changeable. Yes? 

It could be done by adding a new method to HttpFetcher - something like
setProperties() or setConstants(). There are two hard coded values now
(timeout and the currently unused connection timeout). This new method
would allow changing of either of these values and any future values. 

Alternatively, it could be done via Guice named parameters. But that has
the downside of making it difficult to change as the HttpFetcher
singleton is created very early by the DefaultGuiceModule.

Jordan Zimmerman
Principal Software Architect
831.647.4712
831.214.2990 (cell)
jordanz@shop.com 

SHOP*COMTM
Shop Smart, Save Big(tm)
www.shop.com


This message (including any attachments) is intended only for
the use of the individual or entity to which it is addressed and
may contain information that is non-public, proprietary,
privileged, confidential, and exempt from disclosure under
applicable law or may constitute as attorney work product.
If you are not the intended recipient, you are hereby notified
that any use, dissemination, distribution, or copying of this
communication is strictly prohibited. If you have received this
communication in error, notify us immediately by telephone and
(i) destroy this message if a facsimile or (ii) delete this 
message
immediately if this is an electronic communication.

Thank you.