London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

Ruwen Jin
Oct 25, 2009
  7714
(2 votes)

Gadget Gadget Gadget

Description

This gadget make it possible use Google Gadget as EPiServer Site Center Gadget. Currently there are more than 170000 Google Gadgets and we can now use them in EPiServer Site Center.

Features

  • Select Google gadget by list or search.
  • Edit setting for each gadget. 

 

Screenshots

image image image image

 

Download

http://labs.episerver.com/en/Projects-and-Downloads/GoogleGadgets/

 

Installation

This module currently don’t support in virtual directory. Url for your site should look like http://someserver/ not start as http://someserver/andmore/

  • Unzip the files.
  • copy file to your site
  • add following lines in web.config:

    <modules autoDiscovery="Minimal">
     <add name="GoogleGadget">
                    <assemblies>
                         <add assembly="EPiServer.Research.Gadget.GoogleGadget"/>
                    </assemblies>
         </add>
    </modules>

 

2 minutes MVC for EPiServer Site Center gadget crash course:

  1. Model :
    • Create a class that presents object will needed in your gadget. i.e in this gadget we need GadgetSetting .
  2. View:
    • All UIs that you will need in your gadget. Most cases you will need one for view mode and one for edit mode. Views need have definition on which class ( Model ) they are using. In this gadget we have three views. One for view mode and other two for edit mode ( we created a wizard in edit mode ). A tips here for a beginner as me. If you want to see how a Model should be render in View. Just click “Add view” and choose “Create a partial view” and “Create a strongly-typed view” and choose your class and select right in “View Content”.
  3. Controller:
    • Create Controller that contains functions that you need. Important thing is all methods that will present as UI ( view ) should return ActionResult. And return value should be View(“<your view name>”, <data for your view>). One special things with Gadget APi is that it will always send the gadget id to your method so your method should take a Guid as first parameter. When gadget doesn’t configured the gadget id will be Guid.Empty.

Tips for using Dynamic Data Store:

  1. Create data store: the parameter should be false in production and true during the development. ( since you will change your data structure and want remapping the data schema ).
    • DynamicDataStore<Models.GadgetSetting> store = DynamicDataStore<Models.GadgetSetting>.CreateStore(false);
  2. Get data:
    • Models.GadgetSetting setting = store.Find("GadgetId", gadgetId).FirstOrDefault<Models.GadgetSetting>();
  3. Save data: It is a bit tricky if you didn’t have object that implements EPiServer.Data.Dynamic.IDynamicData . When you insert new data to datastore it is straight forward:
    • store.Save(setting2);
  4. When you update an existing data you need first get it from datastore and change it and save it back:
    • Models.GadgetSetting setting2 = LoadSetting(setting.GadgetId);
    • setting2.URL=”sfs”;
    • store.Save(setting2);

About the client script

In some samples scripts use live method to bind event. In most cases it works but if you have multiple step in settings you should use bind instead.

Function to get DOM objects in JavaScript is $(“object jquery expression”,gadgetContext.instance) which make sure selection is done inside the gadget not global.

 

Other resource to create gadget:

http://world.episerver.com/Documentation/Items/Tech-Notes/EPiServer-CMS-6/EPiServer-CMS-6-CTP2/Introduction-to-gadgets/

http://tednyberg.com/post/How-to-create-gadgets-for-EPiServer-6-using-ASPNET-MVC.aspx

http://world.episerver.com/Blogs/Johan-Sellberg/Dates/2009/10/Liveupdate-PollGadget/

 

Don’t forget join to contest

http://world.episerver.com/Download/EPiServer-CMS-6-Gadget-Contest-2009/

Oct 25, 2009

Comments

Sep 21, 2010 10:32 AM

Impressive and awesome idea Ruwen!
/ Joel Abrahamsson

Sep 21, 2010 10:32 AM

Cool! This was on my shortlist of ideas too, but you beat me to it :-) Great implementation.
Follow-up ideas: Gadget to hold web-form user controls, gadget to hold web parts and gadget to hold other gadgets (like a composer layout block).
/ Allan

Please login to comment.
Latest blogs
Routing to a page in SaaS CMS

More early findings from using a SaaS CMS instance; setting up Graph queries that works for both visitor pageviews and editor previews.

Johan Kronberg | Apr 14, 2025 |

Developer Meetup - London, 24th April 2025

Next Thursday, 24th April will be Candyspace 's first Optimizely Developer Meetup, and the first one held in London this year! We've have some...

Gavin_M | Apr 14, 2025

Successful Digitalization for SMEs: How Optimizely One can Revolutionize Your Business Processes

"Achieve digital excellence with Optimizely One: Boost efficiency, delight customers, secure growth." In today's digital world, it's crucial for...

Frank Hohmeyer | Apr 11, 2025

Personalized Optimizely CMS Website Search Experiences Azure AI Search & Personalizer

In the last blog, we discussed Integrating the Optimizely CMS website with Azure AI search. Now let’s take a bit more advanced topic to serve...

Naveed Ul-Haq | Apr 10, 2025 |

Integrating Optimizely CMS with Azure AI Search – A Game-Changer for Site Search

Want to elevate your Optimizely PaaS CMS site’s search capabilities? Azure AI Search could be just the tool you need! In this blog, I’ll discuss......

Naveed Ul-Haq | Apr 9, 2025 |

Opensource release: New Package Explorer for Optimizely CMS

The import/export ".episerverdata" packages have been around as far as I can remember - and even though they might seem a bit outdated, it's still...

Allan Thraen | Apr 9, 2025 |