pombreda / gwt-google-apis

Automatically exported from code.google.com/p/gwt-google-apis
0 stars 0 forks source link

Using @ContentType(views = "card") don't add views = "card" to the <Content type="html" view="card"> in to the gadget spec XML file, is it error? #433

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Found in Release:

gwt-gadgets-1.2.0.zip

Detailed description:

Gmail contextual gadgets has several differences from usual 
gadgets. 
The main is spec XML file. It should begin like this: 
<Module> 
        <ModulePrefs title="Hello World"> 
                <Require feature="google.contentmatch"> 
                        <Param name="extractors"> 
                                google.com:MessageIDExtractor 
                </Param> 
                </Require> 
        </ModulePrefs> 
        <!-- Define the content type and display location. The settings 
"html" and 
                "card" are required for all Gmail contextual gadgets. --> 
        <Content type="html" view="card"> 
... 
The usual gadget can start like this: 
<Module> 
        <ModulePrefs title="Hello World" /> 
        <Content type="html"> 
In order to get desired context gadget specification I added some code 
to usual gadget class: 
... 
@ModulePrefs(title = "GmCGadget", author = "akolchin", author_email = 
"akolc...@gmail.com") 
@InjectModulePrefs (files = "inject.xml") 
@ContentType(views = "card") 
@UseLongManifestName(false) 
@AllowHtmlQuirksMode(false) 

public class GmCGadget extends Gadget<GmCGadget.Preferences> { 
The line @InjectModulePrefs (files = "inject.xml") works fine and adds 
desired elements to ModulePrefs node from inject.xml file. 

But the @ContentType(views = "card") didn't' produce any effect. (I 
wished to add 'view="card"' in the <Conten>) 

Could anybody help me? Maybe I have to add some other declarations to 
get desired effect?

Links to the relevant GWT Developer Forum posts:

http://groups.google.com/group/google-web-toolkit/browse_thread/thread/6486be059
043dd99

Original issue reported on code.google.com by akolchin on 3 Dec 2010 at 9:34

GoogleCodeExporter commented 9 years ago
Someone else on the list had a lot of trouble getting views to work, but I 
didn't diagnose it down to this level (with the Subject "@Gadget.Content" - I 
can't get it to come up right now)

In the code I see that the @ContentType actually takes an array of strings, so 
wouldn't the proper syntax be:

@ContentType(views={"card"})

http://download.oracle.com/javase/tutorial/java/javaOO/annotations.html

Original comment by zundel@google.com on 3 Dec 2010 at 1:46

GoogleCodeExporter commented 9 years ago
>>> In the code I see that the @ContentType actually takes an array of strings, 
so wouldn't the proper syntax be:

>>> @ContentType(views={"card"})

As I understand for just one element array the both syntaxes  are suitable. But 
any way this variant don't do what I expect too.

Original comment by akolchin on 6 Dec 2010 at 2:16

GoogleCodeExporter commented 9 years ago
Here is a skeleton example for using the view feature.  It does generate two 
different Content sections in the gadget.xml file.  Beyond that, I haven't 
tried uploading it to a gadget container.

http://gwt-code-reviews.appspot.com/1197801/show

Original comment by ericzun...@gmail.com on 8 Dec 2010 at 2:10

GoogleCodeExporter commented 9 years ago
Thank you, you give me idea  how I should use views and it is works now.

Original comment by akolchin on 8 Dec 2010 at 1:58

GoogleCodeExporter commented 9 years ago

Original comment by zundel@google.com on 28 Oct 2011 at 4:53