SlideShare uma empresa Scribd logo
1 de 23
Baixar para ler offline
Best Practices in Widget Development
Examples and Counterexamples


Daniel Dahrendorf (IMC)

ROLE Developer Camp,
Lausanne, Switzerland
August 23, 2010



                               © www.role-project.eu
Dr Stephen Dann from flickr.com   jbvkoos from flickr.com




23.08.2010                                       © www.role-project.eu
DESIGN AND USABILITY



23.08.2010                   © www.role-project.eu
In General

• Focus on a single task
     – Give your end user a single functionality
• Own added Value
     – Do not create a Widget which requires a second widget
• Self explanatory interface
     – There should be no need for help text or support




23.08.2010                                                     © www.role-project.eu
Size of Widgets

• Use a standard height
• The widget should scale between 250px and 500px
     – Use a width of 100% for the main elements of the widget
     – Center elements
• Use views
     – Canvas, home and profile views




23.08.2010                                                   © www.role-project.eu
Customization

• Let the user customize the widget
     – Color
     – Background
     – Content
• Provide always default or sample values
  and include a “welcome mode”
• Use the user preferences feature
  of Google Gadgets




23.08.2010                                  © www.role-project.eu
Use Space effectively

• Avoid scrollbars
• Use tabs
• Use paging




23.08.2010              © www.role-project.eu
User Account

• Content should be interesting even the user is not logged in
• State the benefits of creating an account
• Use OAuth if possible




23.08.2010                                          © www.role-project.eu
DEVELOPMENT



23.08.2010          © www.role-project.eu
Development Environment

• Own Apache Shindig Server
     – A web application which can be run e.g.
       in a Apache Tomcat


• OSDE
     – Eclipse plugin with built in Apache
       Shindig server


• Google Gadget Editor
     – A Google gadget which provides an editor
       and the possibility to save the widgets at
       iGoogle




23.08.2010                                          © www.role-project.eu
Development Environment

• Own Apache Shindig Server
     – A web application which can be run e.g.
       in a Apache Tomcat


     – Comfortable way to create complex
       interacting widgets




23.08.2010                                       © www.role-project.eu
Using the features provided by the gadget API

• The Gadget and OpenSocial API provides a lot of useful
  features:
     – fetch social data
     – provide UI element
     – Get data from external sources




• Only available for type=“html’’ widgets


23.08.2010                                       © www.role-project.eu
Selected Features:

• Tabs
     – Creates customizable tabs


• Setprefs
     – Allows setting of user preferences


• Pubsub (OpenSocial 0.8 only)
     – Inter-widget-communication
     – Use OpenApp instead
       (http://code.google.com/p/open-app/)


• Internationalization
     – Provides a mechanism to
       translate widgets



23.08.2010                                    © www.role-project.eu
makeRequest and the Same Origin Policy

• The gadget API provides a function to fetch
  HTML/XML/JSON content (OpenSocial 0.8):

    gadgets.io.makeRequest(url, callback, opt_params)




• As widgets run in iFrames this proxy approach allows to
  fetch data from other domains (same origin policy)
• Other approaches to solve cross domain problems are:
     – JSONP (retrieving JSON via Script Tags)
     – PMRPC (http://code.google.com/p/pmrpc/)


23.08.2010                                              © www.role-project.eu
Caching Problems




• If you are using makeRequest() to fetch content that is
  updated more than once an hour, such as feed data, you
  might not get the latest updates




23.08.2010                                       © www.role-project.eu
Refreshing the Content Cache

• Solution: create a wrapper with a refresh interval

 function makeCachedRequest(url, callback, params,
    refreshInterval) {

      var timestamp = new Date().getTime();
      var sep = "?";
      if (refreshInterval && refreshInterval > 0) {
         timestamp =
            Math.floor(timestamp / (refreshInterval * 1000));
      }
      if (url.indexOf("?") > -1) {
         sep = "&";
      }
      url = [ url, sep, "nocache=", timestamp ].join("");
      gadgets.io.makeRequest(url, callback, params);
 }


23.08.2010                                             © www.role-project.eu
Caching of external files

• Container caches:
     – JavaScript added with <script>
     – CSS added with <link>
     – Content got using the gadget API
• Further because of the widget infrastructure only absolute
  links are allowed




• External files are needed if the widget becomes more
  complex

23.08.2010                                          © www.role-project.eu
Loading JavaScript / CSS dynamically
                                                         http://www.bitsbythepound.com/include-
1. Determine the location of the xml                     external-javascript-and-css-files-with-a-
                                                         google-wave-gadget-249.html
function getModuleBase() {
    if (window.__moduleBase)
        return window.__moduleBase;
    if (_args){
        var moduleBase = _args()['url'];
        moduleBase = moduleBase.substring(0, moduleBase.lastIndexOf('/') + 1);
        window.__moduleBase = moduleBase;
        return window.__moduleBase;
    }
    alert('Can not find module base. Gadget may not work properly.');
    return '';
};

2. Create mechanism for loading JS and CSS
      jQuery provides a cross-browser require script plugin (requireScript)
3. Load the js/css in gadget init
function init() {
   var useCaching = false;
   addScript("js/default.js",useCaching);
   addStylesheet("css/style.css",useCaching);
};
gadgets.util.registerOnLoadHandler(init);

23.08.2010                                                            © www.role-project.eu
Performance

• Goal: Reduce size of the files and number of HTTP requests

• Minify JavaScript code
     – E.g. http://www.crockford.com/javascript/jsmin.html
• Pack all stuff in one XML file
     – Suggestion of Google
• Use the containers’ cache
     – gadgets.io.getProxyUrl
• More sources for optimization:
     – http://code.google.com/intl/de-DE/apis/gadgets/docs/publish.html
     – http://wiki.opensocial.org/index.php?title=OpenSocial_Latency_Meas
       urement

             Maintainability VS. Performance?
23.08.2010                                                   © www.role-project.eu
Performance Testing and debugging

• Use e.g. the Firebug extension of Firefox for debugging and
  measuring the performance




23.08.2010                                         © www.role-project.eu
Conclusions

• Guidelines are helping to provide a user friendly interface
• Customizations allows users to personalize their widgets
• An own Apache Shindig server can be used to develop
  interacting widgets
• Using the Gadget API prevents to “reinvent the wheel”
• Caching and cross domain problems can be handled with
  several methods
• A widget can be optimized regarding its performance
• Tools are available for debugging and performance
  measuring




23.08.2010                                           © www.role-project.eu
ROLE ALLIANCE PROGRAM


                  What is the Alliance Program?
       A partner network of strategic users, vendors and other
                             stakeholder

                Why should I become a member?
       As a member you have a lot of benefits e.g., access to our
         showcase platform, free visit of specific workshops, test
         of prototypes or attendance at Alliance Partner meetings

        How can I become part of the Alliance Program?
                        Please register under
              http://www.roleproject.eu/AllianceProgram


23.08.2010                                             © www.role-project.eu
References

• http://www.google.com/webmasters/gadgets/guidelines.html
• http://www.seoish.com/how-to-internationalize-google-
  gadgets/
• Lal, R. and Chava, L. C. 2010 Developing Web Widget with
  Html, Css, JSON and Ajax: a Complete Guide to Web
  Widget. CreateSpace.
• http://www.bitsbythepound.com/include-external-javascript-
  and-css-files-with-a-google-wave-gadget-249.html
• http://code.google.com/intl/de/apis/gadgets/docs/remote-
  content.html




23.08.2010                                        © www.role-project.eu

Mais conteúdo relacionado

Mais procurados

MozTW Jetpack Workshop: Taichung
MozTW Jetpack Workshop: TaichungMozTW Jetpack Workshop: Taichung
MozTW Jetpack Workshop: Taichunglittlebtc
 
Write a Google Closure Editor Plugin
Write a Google Closure Editor PluginWrite a Google Closure Editor Plugin
Write a Google Closure Editor Pluginyinhm .
 
Jetpack SDK: The new possibility of the extensions on browser
Jetpack SDK: The new possibility of the extensions on browserJetpack SDK: The new possibility of the extensions on browser
Jetpack SDK: The new possibility of the extensions on browserlittlebtc
 
MozTW Jetpack Workshop: Taipei
MozTW Jetpack Workshop: TaipeiMozTW Jetpack Workshop: Taipei
MozTW Jetpack Workshop: Taipeilittlebtc
 
Web Components the best marriage for a PWA
Web Components the best marriage for a PWAWeb Components the best marriage for a PWA
Web Components the best marriage for a PWAManuel Carrasco Moñino
 
Mobile ECM with JavaScript - JSE 2011
Mobile ECM with JavaScript - JSE 2011Mobile ECM with JavaScript - JSE 2011
Mobile ECM with JavaScript - JSE 2011Nuxeo
 
Building a Secure App with Google Polymer and Java / Spring
Building a Secure App with Google Polymer and Java / SpringBuilding a Secure App with Google Polymer and Java / Spring
Building a Secure App with Google Polymer and Java / Springsdeeg
 
Drupal in 5mins + Previewing Drupal 8.x
Drupal in 5mins + Previewing Drupal 8.xDrupal in 5mins + Previewing Drupal 8.x
Drupal in 5mins + Previewing Drupal 8.xWong Hoi Sing Edison
 
Drupal case study: Behind the scenes of website of University of Tartu
Drupal case study: Behind the scenes of website of University of TartuDrupal case study: Behind the scenes of website of University of Tartu
Drupal case study: Behind the scenes of website of University of TartuRené Lasseron
 

Mais procurados (11)

MozTW Jetpack Workshop: Taichung
MozTW Jetpack Workshop: TaichungMozTW Jetpack Workshop: Taichung
MozTW Jetpack Workshop: Taichung
 
Dojo (QCon 2007 Slides)
Dojo (QCon 2007 Slides)Dojo (QCon 2007 Slides)
Dojo (QCon 2007 Slides)
 
Write a Google Closure Editor Plugin
Write a Google Closure Editor PluginWrite a Google Closure Editor Plugin
Write a Google Closure Editor Plugin
 
Jetpack SDK: The new possibility of the extensions on browser
Jetpack SDK: The new possibility of the extensions on browserJetpack SDK: The new possibility of the extensions on browser
Jetpack SDK: The new possibility of the extensions on browser
 
MozTW Jetpack Workshop: Taipei
MozTW Jetpack Workshop: TaipeiMozTW Jetpack Workshop: Taipei
MozTW Jetpack Workshop: Taipei
 
Web Components the best marriage for a PWA
Web Components the best marriage for a PWAWeb Components the best marriage for a PWA
Web Components the best marriage for a PWA
 
Mobile ECM with JavaScript - JSE 2011
Mobile ECM with JavaScript - JSE 2011Mobile ECM with JavaScript - JSE 2011
Mobile ECM with JavaScript - JSE 2011
 
Building a Secure App with Google Polymer and Java / Spring
Building a Secure App with Google Polymer and Java / SpringBuilding a Secure App with Google Polymer and Java / Spring
Building a Secure App with Google Polymer and Java / Spring
 
Drupal in 5mins + Previewing Drupal 8.x
Drupal in 5mins + Previewing Drupal 8.xDrupal in 5mins + Previewing Drupal 8.x
Drupal in 5mins + Previewing Drupal 8.x
 
The Heron Mapping Client
The Heron Mapping ClientThe Heron Mapping Client
The Heron Mapping Client
 
Drupal case study: Behind the scenes of website of University of Tartu
Drupal case study: Behind the scenes of website of University of TartuDrupal case study: Behind the scenes of website of University of Tartu
Drupal case study: Behind the scenes of website of University of Tartu
 

Semelhante a Best Practices in Widget Development - Examples and Counterexamples

jQuery: The World's Most Popular JavaScript Library Comes to XPages
jQuery: The World's Most Popular JavaScript Library Comes to XPagesjQuery: The World's Most Popular JavaScript Library Comes to XPages
jQuery: The World's Most Popular JavaScript Library Comes to XPagesTeamstudio
 
Contributions: what they are and how to find them
Contributions: what they are and how to find themContributions: what they are and how to find them
Contributions: what they are and how to find themPedro Cambra
 
JEE Conf 2015: Less JS!
JEE Conf 2015: Less JS!JEE Conf 2015: Less JS!
JEE Conf 2015: Less JS!_Dewy_
 
Vincent Burckhardt - Exending Connections with OpenSocial Gadgets
Vincent Burckhardt - Exending Connections with OpenSocial GadgetsVincent Burckhardt - Exending Connections with OpenSocial Gadgets
Vincent Burckhardt - Exending Connections with OpenSocial GadgetsLetsConnect
 
Open social gadgets in ibm connections
Open social gadgets in ibm connectionsOpen social gadgets in ibm connections
Open social gadgets in ibm connectionsVincent Burckhardt
 
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...Anupam Ranku
 
Vuejs and Web components - current state
Vuejs and Web components - current stateVuejs and Web components - current state
Vuejs and Web components - current stateMikhail Kuznetcov
 
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Mack Hardy
 
Custom Activities in UiPath (Activity Builder)
Custom Activities in UiPath (Activity Builder)Custom Activities in UiPath (Activity Builder)
Custom Activities in UiPath (Activity Builder)Cristina Vidu
 
Google App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGoogle App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGuillaume Laforge
 
JIO and WebViewers: interoperability for Javascript and Web Applications
JIO and WebViewers: interoperability  for Javascript and Web ApplicationsJIO and WebViewers: interoperability  for Javascript and Web Applications
JIO and WebViewers: interoperability for Javascript and Web ApplicationsXWiki
 
TulsaTechFest - Maximize SharePoint UX with free jQuery libraries
TulsaTechFest - Maximize SharePoint UX with free jQuery librariesTulsaTechFest - Maximize SharePoint UX with free jQuery libraries
TulsaTechFest - Maximize SharePoint UX with free jQuery librariesMark Rackley
 
Writing an extensible web testing framework ready for the cloud slide share
Writing an extensible web testing framework ready for the cloud   slide shareWriting an extensible web testing framework ready for the cloud   slide share
Writing an extensible web testing framework ready for the cloud slide shareMike Ensor
 
Starting with jQuery
Starting with jQueryStarting with jQuery
Starting with jQueryAnil Kumar
 
Let's build Developer Portal with Backstage
Let's build Developer Portal with BackstageLet's build Developer Portal with Backstage
Let's build Developer Portal with BackstageOpsta
 
Developing Apps for SharePoint 2013
Developing Apps for SharePoint 2013Developing Apps for SharePoint 2013
Developing Apps for SharePoint 2013SPC Adriatics
 
Creating Modular Test-Driven SPAs with Spring and AngularJS
Creating Modular Test-Driven SPAs with Spring and AngularJSCreating Modular Test-Driven SPAs with Spring and AngularJS
Creating Modular Test-Driven SPAs with Spring and AngularJSGunnar Hillert
 

Semelhante a Best Practices in Widget Development - Examples and Counterexamples (20)

jQuery: The World's Most Popular JavaScript Library Comes to XPages
jQuery: The World's Most Popular JavaScript Library Comes to XPagesjQuery: The World's Most Popular JavaScript Library Comes to XPages
jQuery: The World's Most Popular JavaScript Library Comes to XPages
 
uMobile Development Strategies
uMobile Development StrategiesuMobile Development Strategies
uMobile Development Strategies
 
Contributions: what they are and how to find them
Contributions: what they are and how to find themContributions: what they are and how to find them
Contributions: what they are and how to find them
 
Html5 Future of WEB
Html5 Future of WEBHtml5 Future of WEB
Html5 Future of WEB
 
JEE Conf 2015: Less JS!
JEE Conf 2015: Less JS!JEE Conf 2015: Less JS!
JEE Conf 2015: Less JS!
 
Vincent Burckhardt - Exending Connections with OpenSocial Gadgets
Vincent Burckhardt - Exending Connections with OpenSocial GadgetsVincent Burckhardt - Exending Connections with OpenSocial Gadgets
Vincent Burckhardt - Exending Connections with OpenSocial Gadgets
 
Open social gadgets in ibm connections
Open social gadgets in ibm connectionsOpen social gadgets in ibm connections
Open social gadgets in ibm connections
 
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
 
Vuejs and Web components - current state
Vuejs and Web components - current stateVuejs and Web components - current state
Vuejs and Web components - current state
 
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
 
April 2012 uPortal Community Call
April 2012 uPortal Community CallApril 2012 uPortal Community Call
April 2012 uPortal Community Call
 
Custom Activities in UiPath (Activity Builder)
Custom Activities in UiPath (Activity Builder)Custom Activities in UiPath (Activity Builder)
Custom Activities in UiPath (Activity Builder)
 
Google App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGoogle App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and Gaelyk
 
JIO and WebViewers: interoperability for Javascript and Web Applications
JIO and WebViewers: interoperability  for Javascript and Web ApplicationsJIO and WebViewers: interoperability  for Javascript and Web Applications
JIO and WebViewers: interoperability for Javascript and Web Applications
 
TulsaTechFest - Maximize SharePoint UX with free jQuery libraries
TulsaTechFest - Maximize SharePoint UX with free jQuery librariesTulsaTechFest - Maximize SharePoint UX with free jQuery libraries
TulsaTechFest - Maximize SharePoint UX with free jQuery libraries
 
Writing an extensible web testing framework ready for the cloud slide share
Writing an extensible web testing framework ready for the cloud   slide shareWriting an extensible web testing framework ready for the cloud   slide share
Writing an extensible web testing framework ready for the cloud slide share
 
Starting with jQuery
Starting with jQueryStarting with jQuery
Starting with jQuery
 
Let's build Developer Portal with Backstage
Let's build Developer Portal with BackstageLet's build Developer Portal with Backstage
Let's build Developer Portal with Backstage
 
Developing Apps for SharePoint 2013
Developing Apps for SharePoint 2013Developing Apps for SharePoint 2013
Developing Apps for SharePoint 2013
 
Creating Modular Test-Driven SPAs with Spring and AngularJS
Creating Modular Test-Driven SPAs with Spring and AngularJSCreating Modular Test-Driven SPAs with Spring and AngularJS
Creating Modular Test-Driven SPAs with Spring and AngularJS
 

Mais de ROLE Project

Build your Responsive Open Learning Environment (Part II)
Build your Responsive Open Learning Environment (Part II)Build your Responsive Open Learning Environment (Part II)
Build your Responsive Open Learning Environment (Part II)ROLE Project
 
Build your Responsive Open Learning Environment (Part I)
Build your Responsive Open Learning Environment (Part I)Build your Responsive Open Learning Environment (Part I)
Build your Responsive Open Learning Environment (Part I)ROLE Project
 
Sharing Personal Learning Environments for Widget Based Systems using a Widge...
Sharing Personal Learning Environments for Widget Based Systems using a Widge...Sharing Personal Learning Environments for Widget Based Systems using a Widge...
Sharing Personal Learning Environments for Widget Based Systems using a Widge...ROLE Project
 
Towards self-regulated workplace learning
Towards self-regulated workplace learningTowards self-regulated workplace learning
Towards self-regulated workplace learningROLE Project
 
Personal Learning Management Systems: Concept, Classification, Evaluation
Personal Learning Management Systems: Concept, Classification, EvaluationPersonal Learning Management Systems: Concept, Classification, Evaluation
Personal Learning Management Systems: Concept, Classification, EvaluationROLE Project
 
Finding and using web widgets for self-regulated learning
Finding and using web widgets for self-regulated learningFinding and using web widgets for self-regulated learning
Finding and using web widgets for self-regulated learningROLE Project
 
Self-regulated learning in a PLMS
Self-regulated learning in a PLMSSelf-regulated learning in a PLMS
Self-regulated learning in a PLMSROLE Project
 
Context-specific ROLE visions: Formal higher education, Life Long Learning, ....
Context-specific ROLE visions: Formal higher education, Life Long Learning, ....Context-specific ROLE visions: Formal higher education, Life Long Learning, ....
Context-specific ROLE visions: Formal higher education, Life Long Learning, ....ROLE Project
 
English Learning Scenario
English Learning ScenarioEnglish Learning Scenario
English Learning ScenarioROLE Project
 
ROLE Project Status Meeting (January 2011)
ROLE Project Status Meeting (January 2011)ROLE Project Status Meeting (January 2011)
ROLE Project Status Meeting (January 2011)ROLE Project
 
From widgets to competencies
From widgets to competenciesFrom widgets to competencies
From widgets to competenciesROLE Project
 
Connecting the ROLE tools
Connecting the ROLE toolsConnecting the ROLE tools
Connecting the ROLE toolsROLE Project
 
A Single Sign-on mechanism for Widgets
A Single Sign-on mechanism for WidgetsA Single Sign-on mechanism for Widgets
A Single Sign-on mechanism for WidgetsROLE Project
 
Psycho pedagogical approach
Psycho pedagogical approachPsycho pedagogical approach
Psycho pedagogical approachROLE Project
 

Mais de ROLE Project (14)

Build your Responsive Open Learning Environment (Part II)
Build your Responsive Open Learning Environment (Part II)Build your Responsive Open Learning Environment (Part II)
Build your Responsive Open Learning Environment (Part II)
 
Build your Responsive Open Learning Environment (Part I)
Build your Responsive Open Learning Environment (Part I)Build your Responsive Open Learning Environment (Part I)
Build your Responsive Open Learning Environment (Part I)
 
Sharing Personal Learning Environments for Widget Based Systems using a Widge...
Sharing Personal Learning Environments for Widget Based Systems using a Widge...Sharing Personal Learning Environments for Widget Based Systems using a Widge...
Sharing Personal Learning Environments for Widget Based Systems using a Widge...
 
Towards self-regulated workplace learning
Towards self-regulated workplace learningTowards self-regulated workplace learning
Towards self-regulated workplace learning
 
Personal Learning Management Systems: Concept, Classification, Evaluation
Personal Learning Management Systems: Concept, Classification, EvaluationPersonal Learning Management Systems: Concept, Classification, Evaluation
Personal Learning Management Systems: Concept, Classification, Evaluation
 
Finding and using web widgets for self-regulated learning
Finding and using web widgets for self-regulated learningFinding and using web widgets for self-regulated learning
Finding and using web widgets for self-regulated learning
 
Self-regulated learning in a PLMS
Self-regulated learning in a PLMSSelf-regulated learning in a PLMS
Self-regulated learning in a PLMS
 
Context-specific ROLE visions: Formal higher education, Life Long Learning, ....
Context-specific ROLE visions: Formal higher education, Life Long Learning, ....Context-specific ROLE visions: Formal higher education, Life Long Learning, ....
Context-specific ROLE visions: Formal higher education, Life Long Learning, ....
 
English Learning Scenario
English Learning ScenarioEnglish Learning Scenario
English Learning Scenario
 
ROLE Project Status Meeting (January 2011)
ROLE Project Status Meeting (January 2011)ROLE Project Status Meeting (January 2011)
ROLE Project Status Meeting (January 2011)
 
From widgets to competencies
From widgets to competenciesFrom widgets to competencies
From widgets to competencies
 
Connecting the ROLE tools
Connecting the ROLE toolsConnecting the ROLE tools
Connecting the ROLE tools
 
A Single Sign-on mechanism for Widgets
A Single Sign-on mechanism for WidgetsA Single Sign-on mechanism for Widgets
A Single Sign-on mechanism for Widgets
 
Psycho pedagogical approach
Psycho pedagogical approachPsycho pedagogical approach
Psycho pedagogical approach
 

Último

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 

Último (20)

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 

Best Practices in Widget Development - Examples and Counterexamples

  • 1. Best Practices in Widget Development Examples and Counterexamples Daniel Dahrendorf (IMC) ROLE Developer Camp, Lausanne, Switzerland August 23, 2010 © www.role-project.eu
  • 2. Dr Stephen Dann from flickr.com jbvkoos from flickr.com 23.08.2010 © www.role-project.eu
  • 3. DESIGN AND USABILITY 23.08.2010 © www.role-project.eu
  • 4. In General • Focus on a single task – Give your end user a single functionality • Own added Value – Do not create a Widget which requires a second widget • Self explanatory interface – There should be no need for help text or support 23.08.2010 © www.role-project.eu
  • 5. Size of Widgets • Use a standard height • The widget should scale between 250px and 500px – Use a width of 100% for the main elements of the widget – Center elements • Use views – Canvas, home and profile views 23.08.2010 © www.role-project.eu
  • 6. Customization • Let the user customize the widget – Color – Background – Content • Provide always default or sample values and include a “welcome mode” • Use the user preferences feature of Google Gadgets 23.08.2010 © www.role-project.eu
  • 7. Use Space effectively • Avoid scrollbars • Use tabs • Use paging 23.08.2010 © www.role-project.eu
  • 8. User Account • Content should be interesting even the user is not logged in • State the benefits of creating an account • Use OAuth if possible 23.08.2010 © www.role-project.eu
  • 9. DEVELOPMENT 23.08.2010 © www.role-project.eu
  • 10. Development Environment • Own Apache Shindig Server – A web application which can be run e.g. in a Apache Tomcat • OSDE – Eclipse plugin with built in Apache Shindig server • Google Gadget Editor – A Google gadget which provides an editor and the possibility to save the widgets at iGoogle 23.08.2010 © www.role-project.eu
  • 11. Development Environment • Own Apache Shindig Server – A web application which can be run e.g. in a Apache Tomcat – Comfortable way to create complex interacting widgets 23.08.2010 © www.role-project.eu
  • 12. Using the features provided by the gadget API • The Gadget and OpenSocial API provides a lot of useful features: – fetch social data – provide UI element – Get data from external sources • Only available for type=“html’’ widgets 23.08.2010 © www.role-project.eu
  • 13. Selected Features: • Tabs – Creates customizable tabs • Setprefs – Allows setting of user preferences • Pubsub (OpenSocial 0.8 only) – Inter-widget-communication – Use OpenApp instead (http://code.google.com/p/open-app/) • Internationalization – Provides a mechanism to translate widgets 23.08.2010 © www.role-project.eu
  • 14. makeRequest and the Same Origin Policy • The gadget API provides a function to fetch HTML/XML/JSON content (OpenSocial 0.8): gadgets.io.makeRequest(url, callback, opt_params) • As widgets run in iFrames this proxy approach allows to fetch data from other domains (same origin policy) • Other approaches to solve cross domain problems are: – JSONP (retrieving JSON via Script Tags) – PMRPC (http://code.google.com/p/pmrpc/) 23.08.2010 © www.role-project.eu
  • 15. Caching Problems • If you are using makeRequest() to fetch content that is updated more than once an hour, such as feed data, you might not get the latest updates 23.08.2010 © www.role-project.eu
  • 16. Refreshing the Content Cache • Solution: create a wrapper with a refresh interval function makeCachedRequest(url, callback, params, refreshInterval) { var timestamp = new Date().getTime(); var sep = "?"; if (refreshInterval && refreshInterval > 0) { timestamp = Math.floor(timestamp / (refreshInterval * 1000)); } if (url.indexOf("?") > -1) { sep = "&"; } url = [ url, sep, "nocache=", timestamp ].join(""); gadgets.io.makeRequest(url, callback, params); } 23.08.2010 © www.role-project.eu
  • 17. Caching of external files • Container caches: – JavaScript added with <script> – CSS added with <link> – Content got using the gadget API • Further because of the widget infrastructure only absolute links are allowed • External files are needed if the widget becomes more complex 23.08.2010 © www.role-project.eu
  • 18. Loading JavaScript / CSS dynamically http://www.bitsbythepound.com/include- 1. Determine the location of the xml external-javascript-and-css-files-with-a- google-wave-gadget-249.html function getModuleBase() { if (window.__moduleBase) return window.__moduleBase; if (_args){ var moduleBase = _args()['url']; moduleBase = moduleBase.substring(0, moduleBase.lastIndexOf('/') + 1); window.__moduleBase = moduleBase; return window.__moduleBase; } alert('Can not find module base. Gadget may not work properly.'); return ''; }; 2. Create mechanism for loading JS and CSS jQuery provides a cross-browser require script plugin (requireScript) 3. Load the js/css in gadget init function init() { var useCaching = false; addScript("js/default.js",useCaching); addStylesheet("css/style.css",useCaching); }; gadgets.util.registerOnLoadHandler(init); 23.08.2010 © www.role-project.eu
  • 19. Performance • Goal: Reduce size of the files and number of HTTP requests • Minify JavaScript code – E.g. http://www.crockford.com/javascript/jsmin.html • Pack all stuff in one XML file – Suggestion of Google • Use the containers’ cache – gadgets.io.getProxyUrl • More sources for optimization: – http://code.google.com/intl/de-DE/apis/gadgets/docs/publish.html – http://wiki.opensocial.org/index.php?title=OpenSocial_Latency_Meas urement Maintainability VS. Performance? 23.08.2010 © www.role-project.eu
  • 20. Performance Testing and debugging • Use e.g. the Firebug extension of Firefox for debugging and measuring the performance 23.08.2010 © www.role-project.eu
  • 21. Conclusions • Guidelines are helping to provide a user friendly interface • Customizations allows users to personalize their widgets • An own Apache Shindig server can be used to develop interacting widgets • Using the Gadget API prevents to “reinvent the wheel” • Caching and cross domain problems can be handled with several methods • A widget can be optimized regarding its performance • Tools are available for debugging and performance measuring 23.08.2010 © www.role-project.eu
  • 22. ROLE ALLIANCE PROGRAM What is the Alliance Program? A partner network of strategic users, vendors and other stakeholder Why should I become a member? As a member you have a lot of benefits e.g., access to our showcase platform, free visit of specific workshops, test of prototypes or attendance at Alliance Partner meetings How can I become part of the Alliance Program? Please register under http://www.roleproject.eu/AllianceProgram 23.08.2010 © www.role-project.eu
  • 23. References • http://www.google.com/webmasters/gadgets/guidelines.html • http://www.seoish.com/how-to-internationalize-google- gadgets/ • Lal, R. and Chava, L. C. 2010 Developing Web Widget with Html, Css, JSON and Ajax: a Complete Guide to Web Widget. CreateSpace. • http://www.bitsbythepound.com/include-external-javascript- and-css-files-with-a-google-wave-gadget-249.html • http://code.google.com/intl/de/apis/gadgets/docs/remote- content.html 23.08.2010 © www.role-project.eu