- •Contents
- •Practice №1 The study of cloud services Google. Gmail.
- •1.1 About Gmail
- •1.2 Why choose Gmail
- •1.3 Creating an account
- •1.4 Gmail as a Google Account
- •2. Gmail’s Interface
- •2.1 Inbox
- •2.2 Compose Mail
- •2.3 Drafts
- •2.4 Sent Mail
- •2.5 More
- •2.6 Report Spam
- •2.7 Delete
- •2.8 Keyboard Shortcuts
- •3. Organizing your Gmail
- •3.1 Contacts
- •3.2 Stars
- •3.3 Labels
- •4. Advanced Settings
- •4.1 General Settings
- •4.2 Accounts and Import
- •4.3 Filters
- •4.4 Forwarding and Pop/imap
- •4.5 Offline
- •5. The Fun Stuff
- •5.1 Buzz
- •5.2 Chat
- •5.3 Web Clips
- •5.4 Labs
- •5.5 Themes
- •5.6 Gmail Mobile
- •5.7 Google Docs
- •5.8 Google Calendar
- •5.9 Tasks
- •6. Conclusion
- •Practice №2 The study of cloud services Google Talk.
- •2.1 Use the native Gmail Talk option
- •2.2 Installing the voice/video chat plugin
- •Practice №3 The study of cloud services Google Calendar
- •3.1 Interface
- •3.2 Create an event
- •3.3 Add location
- •3.4 Invite people
- •3.5 Share meeting materials
- •3.6 Meet online
- •Invite guests, add attachments, and meet online.
- •3.7 New committee? New (shared) calendar.
- •Practice №4 Editing of electronic documents Google Apps
- •4.1 Creating new files
- •4.2 Using templates
- •Practice №5 The study of functions Google App Engine
- •5.1 Google App Engine Docs
- •5.2 Download the App Engine sdk for php
- •5.3 Creating the Configuration File
- •Practice №6 Creating a data warehouse environment Google App Engine
- •6.1 Setting up Objectify
- •6.2 Creating the data model classes
- •6.3 Adding the greetings and the form to the jsp template
- •6.4 Creating the form handling servlet
- •6.5 Testing the app
- •6.6 Creating required indexes
- •Practice №7 The study of cloud services Google Apps
- •7.1 Gmail
- •Google Drive
- •Google Docs, Sheets, Slides, and Forms
- •7.4 Google Sites
- •7.5 Google Calendar
- •7.6 Google Hangouts
- •7.8 Google Apps Vault
- •7.9 Usage
- •Practice №8 Microsoft Office Live Workspace
- •8.1 Setting up Microsoft Live Workspace
- •8.2 Features Available with Office Live Workspace
- •Practice №9 The study of cloud services Microsoft SkyDrive
- •9.1 Creating a Microsoft account
- •9.2 Getting to know OneDrive
- •9.3 Installing the Microsoft OneDrive app
- •9.4 OneDrive for mobile devices
- •Practice №10 Network services for the mobile user. Wi-Fi technology
- •10.1 What is Wi-Fi ?
- •Practice №11 Search engines in Internet
- •Veronica & Jughead:
- •Improve Your Searching Skills:
- •Infoseek:
- •Inktomi:
- •Vertical Search
- •Verticals Galore!
- •Information Retrieval as a Game of Mind Control
- •Increasing The Rate of Algorithmic Change
- •Practice №12 Search graphic information in Internet. Comparative analysis of search engines. Internet image search
- •Study Guide
- •3 55029, Stavropol, Pushkina, 1
6.2 Creating the data model classes
With Objectify, you create classes whose instances will represent datastore entities in your code. Objectify does the work of translating these Java objects to datastore entities.
Create a Greeting class to represent a message posted by a user. In guestbook/src/main/java/com/example/guestbook/, create a file named Greeting.java with the following contents:
package com.example.guestbook; import com.googlecode.objectify.Key; import com.googlecode.objectify.annotation.Entity; import com.googlecode.objectify.annotation.Id; import com.googlecode.objectify.annotation.Index; import com.googlecode.objectify.annotation.Parent; import java.lang.String; import java.util.Date; import java.util.List; /** * The @Entity tells Objectify about our entity. We also register it in {@link OfyHelper} * Our primary key @Id is set automatically by the Google Datastore for us. * * We add a @Parent to tell the object about its ancestor. We are doing this to support many * guestbooks. Objectify, unlike the AppEngine library requires that you specify the fields you * want to index using @Index. Only indexing the fields you need can lead to substantial gains in * performance -- though if not indexing your data from the start will require indexing it later. * * NOTE - all the properties are PUBLIC so that can keep the code simple. **/ @Entity public class Greeting { @Parent Key<Guestbook> theBook; @Id public Long id; public String author_email; public String author_id; public String content; @Index public Date date; /** * Simple constructor just sets the date **/ public Greeting() { date = new Date(); } /** * A convenience constructor **/ public Greeting(String book, String content) { this(); if( book != null ) { theBook = Key.create(Guestbook.class, book); // Creating the Ancestor key } else { theBook = Key.create(Guestbook.class, "default"); } this.content = content; } /** * Takes all important fields **/ public Greeting(String book, String content, String id, String email) { this(book, content); author_email = email; author_id = id; } }
We also need a Guestbook class to represent an entire guestbook. While this example doesn't explicitly create a Guestbook object in the datastore, it uses this class as part of the datastore key for the Greeting objects. This demonstrates how you might define keys so that all of the greetings in a guestbook could be updated in a single datastore transaction.
Create a file named Guestbook.java with the following contents:
package com.example.guestbook; import com.googlecode.objectify.annotation.Entity; import com.googlecode.objectify.annotation.Id; /** * The @Entity tells Objectify about our entity. We also register it in * OfyHelper.java -- very important. * * This is never actually created, but gives a hint to Objectify about our Ancestor key. */ @Entity public class Guestbook { @Id public String book; }
