Today's Special Events in Cottbus

From Wiki

Jump to: navigation, search

An annotated Google Map[1] with (entertainment) announcements. The server-side component is EJB-based and uses the default JBoss support for databases. Registered users can define events which are to be rendered on the Google Map.


Contents

The Story

Users may want to embed the map in their web site therefore must provide the following information to generate a Script:

  • The Google Maps Key (provided by Google for the specific web site). Otherwise the script will be generated with a stub for the key parameter and user have to insert the key manually during the embedding in its site.
  • Their events list.
  • The desired size of their map i.e. height and weight (in pixels). The main event (to be the center of the map). Otherwise a default will be applied.

Whenever the user update its event list the corresponding generated script will be updated too.

Events will use the Google Calendar java API. You may check the javadoc for the com.google.gdata.data.calendar.CalendarEventEntry. A basic code for creating quick events might be:

// Set up the URL and the object that will handle the connection:
URL feedUrl = new URL("http://www.google.com/calendar/feeds/johndoe@gmail.com/private/full");
CalendarService myService = new CalendarService("CottbusEvents");
myService.setUserCredentials("johndoe@gmail.com", "mypassword");

CalendarEventEntry myEntry = new CalendarEventEntry();
myEntry.setContent(new XhtmlTextConstruct("<p>Meeting  with <a href='http://www.johndoe.com'>John</a> November 11 3pm-3:30pm</p>"));
myEntry.setQuickAdd(true);

// Send the request and receive the response:
CalendarEventEntry insertedEntry = myService.insert(postUrl, myEntry);


Optionally an event may have the following properties (if they do not overlap with other properties of CalendarEventEntry):

  • event icon - an URL to a specific icon for the event. There is a fixed set of available icons.
  • preferred image - an URL to the preferred image.
  • requirements - similar with description
  • related events - a list of related event names


See also: Printing calendar names of a Google Calendar User

Activities that must be supported

User Related Activities

This component should allow the following functionality:

  • Users must be always registered. They register by an user name and a valid email account. The user account will be confirmed via a confirmation link in the welcome email.
  • An user can always create/update/delete its events list and generate a new script link for the map to be embedded in his website.
  • Users can choose a specific icon for an an event. The users can provide an URL for a picture related to a specific event.
  • The user can access and update any private data.
  • Users should be able to choose the datetime of an event.

Administrator related activities

  • All system maintenance, including user management.

Implementation Requirements


Client-side JavaScript code

The code for script embedding should look like:

<div id="5sd23" style="width:640px; height: 400px">
 Loading...
</div>
<div>
 <script type="text/javascript" src="http://www.example.com/maps/index.jsp?id=5sd23&ke=ABQIAAavQ"y>
</script>
</div>

Therefore whenever the script code updates on the server the embedded one updates too.

  • id=5sd23 is the div id where the map will be embedded.
  • key=ABQIAAavQ is the GoogleMaps key of the specific web site where the map has to be embedded.

References

  1. Google Maps API
Personal tools