Skip to content

Writing a Custom Widget for Google Calendars

2011 August 14
by Eddie

The amount of users who rely on Google Calendars to organize their personal and professional lives is staggering.   Seeing as most clients are comfortable and proficient with the technology, there is little reason to point them elsewhere when they ask for a custom widget to display upcoming events on their site.

google calendar final1 Writing a Custom Widget for Google Calendars

Google Calendars are easy and everywhere, with a robust API we can leverage

In fact, the only trouble is that Google’s provided widget layouts are all – er, well they are all quite lame, and likely won’t match your current theme.

No worries!  We can easily leverage Google’s calendar API  and Javascript to create a fully customized Calendar widget showing the next N upcoming events in chronological order.

read more…

Verify file Checksum in Windows with context menu

2011 June 6
by Eddie

Checking the integrity of a file on a unix node is simple thanks to a confusingly named “checksum” utility. It, oddly enough gives you the checksum of a file.

If your stuck on (or just love) windows, you can give yourself the ability to check any files checksum with the click of a mouse.

Capture Verify file Checksum in Windows with context menu

Right-Click any file to validate the checksum integrity

 

1. read more…

Authenticate Facebook Users in MOdx, and Build a User Profile

2011 May 12
tags: modx
by Eddie

Although still very new, and with much to learn I am loving Modx as a tool to quickly build out robust sites.

Recently a client wanted to add Facebook Integration to their MODx site. I’ve used Facebook’s API before, and know it makes authentication pretty easy, but I had to figure out to insert that authorized user into Modx’s web context. And it was actually quite easy as well.

The user becomes a full blown member, and can be treated the same as any user that registered. (you can also treat them differently)

Read on to learn how two simple snippets allow Facebooks users to add themselves to your site in the provided member groups.

The extra also creates a full user profile in modx based on Facebook‘s info, complete with:

  • Name
  • Username
  • Email
  • Hometown
  • Photo

read more…

Link to element IDs inside a jQuery tabs – read “Stateless”

2011 April 26
by Eddie

I recently implemented JQuery’s Tabs feature into a site I am building for a client.  My first though was “wow, that was easy.”  And then the usability issues starting making themselves apparent.

 I like stateless web. Everything is linkable and bookmarkable, and once you have something the way you want, you should be able to share it with nothing more then the unique and repeatable url.

WHat do I mean by usability issues, let me explain with a few scenarios.

Problems

Problem 1: Switching tabs is not reflected by the URL, making the page stateful

Ugh, we hate stateful web sites!

  1. Your visitor lands on PageA that has 3 tabs: Main content, Dynamic Map, and User comments.
  2. To see the maps, user clicks on “Tab2″. (URL remains unchanged)
  3. User wants to share map, and sends link to a friend, but all they see is the welcome content – OOps!

In this case user A would need to supply User B with a link, and instructions to get to the right tab. This violates the principle that the web should be stateless, and repeatable.  If content changes, the URL should too.

Problem 2:  Elements inside hidden tabs are not reachable by URL alone

  1. User A is reading the comments tab “Tab3″ and decides she wants to add her own.
  2. After supplying her info, and the CAPTCHA she submits the form
  3. Let’s suppose the user forgot to add her actual comment, and the form tries to re-render with the validation message – OOps!

Here User A expected to see the comment form again, and instead sees the page re-rendered, but Tab1, the default tab, is shown. She has no awareness that the form (on Tab3) failed, and assumes her comment was submitted.

But what if she had successfully submitted her comment? The same problem will crop up when the comment widget tries to redirect our user to her submitted comment (mysite.com/pageA#YourNewComment) Because the ID “YourNewComment” is part of the hidden content of Tab3, the page will just load Tab1, and leave our user curious.

 

Solution

Fortunately it only takes a few lines of clever jQuery code to solve these usability issues.

  1. If the current tab changes, we update the URL with the correct anchor (mysite.com/PageA#Tab2)
  2. If a URL contains the anchor of a tab, we make that tab active
  3. <The icing> If the URL contains an anchor for an element that resides inside a tab, we make the parent tab active and scroll to the specified element

I need to thank Mark Yoon for numbers 1&2 that are based on a comment he left somewhere (i;ve been googling this issue alot!)

Number 3 was my own addition, and the most critical to me, because it allows existing widgets to work inside the tabs, and makes the tabs transparent from a URLs perspective.

 

read more…

Linux Turns 20!

2011 April 12
by Eddie

lf linux20 webbadge Linux Turns 20!

I was only 6 when Linus shared his first offering to the world, but I do remember the linux superbowl ad by IBM.

Will MODx Revolution bring about change?

2011 April 4
tags: cms, modx
by Eddie

Somewhere between CMS and Scaffolding Framework

MODx is a PHP based, mm.. tool, for publishing websites.  I don’t want to call it a CMS, though If you read MODx documentation, they’ll call it a Content Management System.  But in my experience products labeled CMS tend to be inflexible tools that require lots of effort to place widgets on custom templates.  I remember using one tool in which you could not have a publicly accessible page not belong to a menu. We ended up building a hidden menu for all such pages – absurd!

At the other end of the spectrum are highly flexible frameworks. These are much more flexible, and let you run wild, but leave a good chunk of work to setup decent content management, authorization, etc. before you even get to the site at hand.

Well MODx sit nicely between a CMS and a framework in my opinion. You get user management, admin panel, powerful configuration, etc.  But you are not forced into any mold.  In face the default install (without sample content) is literally an empty page!  Uncomfortable at first,  but once you spend a few hours with it you begin to love the freedom.   It is intended for sites that are heavy content focused, but provides full CRUD application abilities as well.

read more…

Manual Update for Nexus One

2011 February 28
by Eddie

I am writing this as the release for Gingerbread (2.3) is being slowly released OTA, but the same steps apply regardless of the rom version you are eagerly awaiting.

This is safe and repeatable, and I have done it for 3 updates on 2 devices now, so I am very confident nothing will go wrong. Even so, I waive any responsibility if something goes wrong.

For the details and pictures, read below the fold.
read more…

Google TV with the Logitech Revue – First Look and Thoughts

2010 December 6
by Eddie
Logitech Revue

It’s Here ! Google TV powered Revue from Logitech

I’ll admit before I go any further that I am a Google fan, and Android developer. When Google sent me the free Logitech Revue I was eager to dig in!

But honestly, I’ll do my best to stay neutral.

And before I go any further I want to make sure we’re all on the same page about what Google TV actually is or does.

  • GoogleTV is not a subscription dependent content provider. (Rather Google TV aggregates existing sources of media into one source)
  • You can use your existing TV (HD with HDMI inputs required).
  • You should keep your current cable or satellite feed.

renue e1291686751679 300x170 Google TV with the Logitech Revue   First Look and Thoughts
read more…

Custom JSF Input Validation Styling for any Component

2010 October 29
by Eddie

We didn’t have room on our pages for individual message boxes, and also had the need to style specific fields on our JSF pages whenever validation failed on the server, with user friendly field names in the message.

Example:  ”User Name is Required” , and the field for User Name is highlighted red.

jsf jquery validation 300x68 Custom JSF Input Validation Styling for any Component

Custom field styling and nicer field names for JSF validation

Unfortunately there are times when jsf insists on inserting field ids into the message.

1. Here’s the scenario;

  • If any jsf converter validation fails (like a string in an int field) JSF will throw a warning like “jid17:jid34: Values must be type numeric” – The form id and page id prepend any internal messages – gross.
  • If any page custom validation fails (like min and max lengths) JSF will throw our custom message
  • If custom validators fail(like the format of a zip code based on the province as US or CA) throw  a custom message
  • If any DB rule issues fail (like name in use by other user) then our Manager throws a custom message (but it is not hooked to any component)

The troubles is that without overriding JSF components or classes we do not have access to the component when every message is thrown, and would be unable to change its style class.

Rather than relying on some tricky JSF or Java code to intercept and update classes I decided to take a simpler approach (or so I think).  Using jQuery, the preprendId=”false” attribute, and specific Messages for every field we can do ANY custimaztion we want to ANY failed field, input, checkbox, etc on the page.

read more…

A complex data model with JPA – Inheritance, Stateful Join Tables, and More

2010 September 13
tags: jpa, JSF
by Eddie

I’ve had the recent pleasure/pain of implementing JPA  a new Java web application. After reading many misleading blog posts and dead-end mailing list threads I have worked out the major kinks, and thought I would share.

A few things first:

  • This not using Hibernate API, or the Hibernate implementation of Java Persistence API
  • The project runs on Websphere 6.1 (WAS6.1), using OpenJPA implemenation of JPA 1
  • Although our application is new, the data model is fixed as it must align with the enterprises larger customer focused data model.
  • I’m not saying anything contained herein is correct, but it works.

Topics

  • Multi-Level Inheritance with different Primary Key columns (id, org id, client id)
  • Custom Inheritance discriminators
  • Stateful Join Tables (ManyToMany relationship with additional payload in the associative table)
  • Boolean to Char mapping (code sees true/false, DB sees Y/N)
  • Managed Id’s

read more…

Pages: 1 2