Platform as a Service Applications Cloud Platform l

  • Slides: 43
Download presentation
Platform as a Service Applications

Platform as a Service Applications

Cloud Platform l Cloud platform acts as run-time enviroments that supports a set of

Cloud Platform l Cloud platform acts as run-time enviroments that supports a set of programming languages, compiled or interpreted. l Cloud platform may offer additional services such as reusable components and libraries. l Typically, cloud platform will offer plug-ins into common development environments, such as Eclipse, to facilitate development, testing, and deployment

l Paa. S examples: - Google App Engine - Microsoft Windows Azure - Force.

l Paa. S examples: - Google App Engine - Microsoft Windows Azure - Force. com

Google App Engine - Functions l Google App Engine enables developers to build web

Google App Engine - Functions l Google App Engine enables developers to build web applications on the same scalable systems that power google’s own applications l It means that, by using Google App Engine, you can easily design scalable applications that grow from one user to millions of users without infrastructure headaches

Set Development Environment for Google App Engine

Set Development Environment for Google App Engine

Install the Java SE l Go to http: //www. oracle. com/technetwork/javase/ downloads/index. html to

Install the Java SE l Go to http: //www. oracle. com/technetwork/javase/ downloads/index. html to get the most updated Java SE

Install Eclipse Luna l Go to https: //www. eclipse. org/downloads/ to get the most

Install Eclipse Luna l Go to https: //www. eclipse. org/downloads/ to get the most updated Eclipse

Old Way:

Old Way:

Install the App Engine SDK l l l We will develop and deploy Java

Install the App Engine SDK l l l We will develop and deploy Java application for Google App Engine using the App Engine Java software development kit (SDK). The SDK includes software for a web server that you can run on your own computer to test your Java applications. The server simulates all of the App Engine services, including a local version of the datastore, Google Accounts, and the ability to fetch URLs and send email from your computer using the App Engine APIs.

Install Google App Engine Plugin l l l Eclipse->Help->Install New Software Type in https:

Install Google App Engine Plugin l l l Eclipse->Help->Install New Software Type in https: //dl. google. com/eclipse/plugin/4. 4 Select Google Plugin for Eclipse Select GWT Designer for GPE Select SDKs

Install Data. Nucleus Plugin l Data. Nucleus provides open source products supporting data access

Install Data. Nucleus Plugin l Data. Nucleus provides open source products supporting data access using all standardised APIs (JDO, JPA) to a very wide-range of datastores (RDBMS, ODBMS, Map-based, Web -based, documents, etc) supporting querying using a range of query languages

l l Eclipse->Help->Install New Software Type in http: //www. datanucleus. org/downloads/eclipseupdate/

l l Eclipse->Help->Install New Software Type in http: //www. datanucleus. org/downloads/eclipseupdate/

l l l App Engine Java applications use the Java Servlet standard for interacting

l l l App Engine Java applications use the Java Servlet standard for interacting with the web server environment. An application's files, including compiled classes, JARs, static files and configuration files, are arranged in a directory structure using the WAR standard layout for Java web applications. A WAR file (or Web application ARchive) is a JAR file used to distribute a collection of Java. Server Pages, Java Servlets, Java classes, XML files, tag libraries, static web pages (HTML and related files) and other resources that together constitute a web application.

Create a project My. Project l Create a new project by clicking the New

Create a project My. Project l Create a new project by clicking the New Web Application Project button in the toolbar: Ø Ø Give the project a "Project name" of My. Project and a "Package" of myproject. Uncheck "Use Google Web Toolkit, " and ensure "Use Google App Engine" is checked.

Java Servlet l l App Engine Java applications use the Java Servlet API to

Java Servlet l l App Engine Java applications use the Java Servlet API to interact with the web server. An HTTP servlet is an application class that can process and respond to web requests. My. Project. Servlet. java package myproject; import java. io. IOException; import javax. servlet. http. *; @Suppress. Warnings("serial") public class My. Project. Servlet extends Http. Servlet { public void do. Get(Http. Servlet. Request req, Http. Servlet. Response resp) throws IOException { resp. set. Content. Type("text/plain"); resp. get. Writer(). println("Hello, world"); } }

web. xml <? xml version="1. 0" encoding="utf-8"? > <web-app xmlns: xsi="http: //www. w 3.

web. xml <? xml version="1. 0" encoding="utf-8"? > <web-app xmlns: xsi="http: //www. w 3. org/2001/XMLSchema-instance" xmlns="http: //java. sun. com/xml/ns/javaee" xmlns: web="http: //java. sun. com/xml/ns/javaee/web-app_2_5. xsd" xsi: schema. Location="http: //java. sun. com/xml/ns/javaee/web-app_2_5. xsd" version="2. 5"> <servlet-name>My. Project</servlet-name> <servlet-class>myproject. My. Project. Servlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>My. Project</servlet-name> <url-pattern>/myproject</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index. html</welcome-file> </welcome-file-list> </web-app>

appengine-web. xml l App Engine needs this file to figure out how to deploy

appengine-web. xml l App Engine needs this file to figure out how to deploy and run the application <? xml version="1. 0" encoding="utf-8"? > <appengine-web-app xmlns="http: //appengine. google. com/ns/1. 0"> <application></application> <version>1</version> …

Test the application locally

Test the application locally

Deploy your application to Google App Engine l You create and manage App Engine

Deploy your application to Google App Engine l You create and manage App Engine web applications from the App Engine Administration Console, at the following URL: https: //appengine. google. com/ l Sign in to App Engine using your Google account.

l l To create a new application, click the "Create an Application" button. Follow

l l To create a new application, click the "Create an Application" button. Follow the instructions to register an application ID, a name unique to this application. Edit the appengine-web. xml file, then change the value of the <application> element to be your registered application ID. Go to projectname->property->Google->App Engine to check the Application ID and version Go to projectname->Google->Deploy to App Engine to deploy your application

l The. URL for your website begins with your application ID: http: //your_app_id. appspot.

l The. URL for your website begins with your application ID: http: //your_app_id. appspot. com/

Current Way:

Current Way:

Install Google Cloud Tools for Eclipse l l l The old Google App Engine

Install Google Cloud Tools for Eclipse l l l The old Google App Engine Plugin has been replaced by the new “Google Cloud Tools for Eclipse” plugin It functions much like the old plugin, but with several improvements Importantly, it also uses the server functionality of Eclipse in order to use the same app engine tools to test with localhost

Install Google Cloud Tools for Eclipse l l Eclipse->Help->Eclipse Marketplace Search for “Google Cloud”

Install Google Cloud Tools for Eclipse l l Eclipse->Help->Eclipse Marketplace Search for “Google Cloud” Select Google Cloud Tools for Eclipse and install it Restart Eclipse

Create a New Project l Create a new Google App Engine project: Ø Ø

Create a New Project l Create a new Google App Engine project: Ø Ø l l File->New->Project Select “Google App Engine Standard Java Project” from the “Google Cloud Platform” folder Give the new project a name, such as “My. Project” Give the new project a package name, such as “myproject” Ensure that “App Engine API” is checked Select “Finish” to create the project

Your New Project l l l The new project will have several automatically generated

Your New Project l l l The new project will have several automatically generated files These files are the same as previously described in the “old way” instructions The files can be found in the following places: Ø Ø Ø The. java source file is located in “src/main/java” The index. html file is located in “src/main/webapp” The web. xml and appengine-web. xml files are located in “src/main/webapp/WEB-INF”

Test the Application Locally l l The Google Cloud Tools for Eclipse plugin allows

Test the Application Locally l l The Google Cloud Tools for Eclipse plugin allows you to test your application locally by hosting it through localhost In order to do this, you need to select your project, and then select “Run on App Engine” from the Google Cloud Tools Dropdown

Using the Servers View to Manage localhost l l l The Google Cloud Tools

Using the Servers View to Manage localhost l l l The Google Cloud Tools for Eclipse plugin uses Eclipse’s built in server management view in order to test with localhost In order to turn off localhost, update the files on localhost, or do many other tasks; you need to use the Servers View To turn on this View: Ø Ø l Eclipse->Window->Show View->Other Then select “Servers” from the “Server” folder The view will then appear next to ‘Console” on the lower window

Deploy Your Application to Google App Engine l The first step is to create

Deploy Your Application to Google App Engine l The first step is to create a new Project: Ø Ø l Go to https: //appengine. google. com/ Log in with your Google account Follow the prompts to create a Project Make sure to note your Project ID Once your Project is created we need to add an Application: Ø Ø After creating a Project there should be a prompt to create an Application Follow the prompts, but make sure to select “Java” as your Language and “Standard” as your Environment

Deploy Your Application to Google App Engine l l l Now that you’ve created

Deploy Your Application to Google App Engine l l l Now that you’ve created a project, we can deploy to it Inside of Eclipse, select your project, and then select “Deploy to App Engine Standard” from the Google Cloud Tools Dropdown Select the Account dropdown, and sign into your Google account Your project should now appear in the project list Select it and then click Deploy

Deploy Your Application to Google App Engine l l l First Eclipse will upload

Deploy Your Application to Google App Engine l l l First Eclipse will upload the files, and then it will take a little while for the actual project to publish After some time (you can follow the progress in the bottom right corner) a web browser window will appear in Eclipse with your new application open The URL will begin with your Application ID from earlier Ø l http: //your_app_id. appspot. com/ Your project is now live!

Force. com l l Force. com is a cloud platform for building and runing

Force. com l l Force. com is a cloud platform for building and runing - apps that automate and extend your business process - apps with workfolow and analytics - mobile apps - social apps The application running on Force. com is more data-oriented than code-oriended.

l Force. com provides a cloud platform that integrates: - infrastructure - software stack

l Force. com provides a cloud platform that integrates: - infrastructure - software stack - backup and storages - performance optimizations - security

l External Programmatic Access - Force. com exposes all customer specific configurations (forms, reports,

l External Programmatic Access - Force. com exposes all customer specific configurations (forms, reports, workflows, user privileges, customization, business logic) as metadata with is programmatically accessible. - A Web Services API (SOAP) allows access to all Force. com application data from any environment. - In addition to conventional database access, Force. com employs an external search engine that provides full-indexing of unstructured data.

l Apex - Force. com uses Apex to code business logics. - Apex is

l Apex - Force. com uses Apex to code business logics. - Apex is a proprietary programming language that uses a Java-like syntax but acts much more like database stored procedures. - It allows developers to add business logic to events, such as button clicks or record updates

l User Interface Two tools are available for building the user interface for on-demand

l User Interface Two tools are available for building the user interface for on-demand applications: UI builder and Visualforce - UI Builder is the simpler approach. It generates a default user interface based on the data properties of the application. For instance, the defined data types will influence input display components and options.

- Visualforce is much more powerful and can be used to create almost any

- Visualforce is much more powerful and can be used to create almost any user interface. -- It implements the MVC paradigm to enforce strict separation of logic from presentation and storage. -- The user interface can leverage dynamic, client-side disply functionality, such as CSS, DHTML, AJAX or Adobe Flex, in addition to ordinary HTML.

l App. Exchange - Force. com provides a marketplace called App. Exchange for buying

l App. Exchange - Force. com provides a marketplace called App. Exchange for buying and selling Saa. S service - Once developers have completed and tested their applications, they can request publication on App. Exchange providing a description of the services along with details of the pricing and support model.

Hands-on experience on Force. com l https: //developer. salesforce. com/

Hands-on experience on Force. com l https: //developer. salesforce. com/

Hands-on experience on Force. com l l l In your browser, go to http:

Hands-on experience on Force. com l l l In your browser, go to http: //sforce. co/Yr. ZZJ 3. Fill in the fields about you and your company. In the Email Address field, make sure to use a public address you can easily check from a Web browser. Type a unique Username. Note that this field is also in the form of an email address, but it does not have to be the same as your email address, and in fact, it’s usually better if they aren’t the same. Your username is your login and your identity on developer. salesforce. com, so you’re often better served by choosing a username such as firstname@lastname. com. Read and then select the checkbox for the Master Subscription Agreement and then click Submit Registration. In a moment you’ll receive an email with a login link. Click the link and change your password.

Hands-on experience on Force. com l l l When you create an app, you

Hands-on experience on Force. com l l l When you create an app, you automatically create a data object that keeps track of all the elements of a particular item, such as its name, description, and price data objects are called custom objects. If you’re familiar with databases, you can think of them as a table An object comes with standard fields and screens that allow you to list, view, and edit information about the object. But you can also add your own fields to track or list just about anything you can think of

Hands-on experience on Force. com l l Create an App Access the App from

Hands-on experience on Force. com l l Create an App Access the App from a Mobile Device Ø Ø Most things you create in Salesforce are available via a mobile device, giving your users full access to the information they need, no matter where they are Everything you do in the full site is reflected in the Salesforce 1 mobile app Go to www. salesforce. com/mobile, select the appropriate platform, and download Salesforce 1 From Setup click Mobile Administration | Salesforce 1 | Settings, and then Enable the Salesforce mobile browser app

Hands-on experience on Force. com l Add an Field to your Object Ø Ø

Hands-on experience on Force. com l Add an Field to your Object Ø Ø Ø From Setup, click Create | Objects Scroll down to Custom Fields and Relationships, and click New Try Out the App