AgileApps Support Wiki Pre Release

Difference between revisions of "Lab B.1: Hello World"

From AgileApps Support Wiki
imported>Aeric
imported>Aeric
Line 7: Line 7:
:*Read the [[Application Architecture]] overview.
:*Read the [[Application Architecture]] overview.


==Exercise==
==Overview of JSP Pages==
===Overview: JSP Pages===
A Java Server Page (JSP) is an HTML file that contains Java code. If no Java code happens to be present, then the "JSP" page contains nothing but HTML. (In the platform, they are called simply [[Page]]s, since they can be either HTML pages or JSP pages.)
A Java Server Page (JSP) is an HTML file that contains Java code. If no Java code happens to be present, then the "JSP" page contains nothing but HTML. (In the platform, they are called simply [[Page]]s, since they can be either HTML pages or JSP pages.)


====The Many Uses of JSP Pages====
===The Many Uses of JSP Pages===
Interact with the Platform
[[Objects]] contain your data, but work with your data and interact with the platform using JSP Pages. In fact, the platform itself is mostly a giant collection of JSP Pages that you use to interact with the underlying database.
Work with your data�


Once you know how to create JSP Pages, you will be able to do extensive front-end customization for your users:
:; By visiting the page URL:
:: <tt>https://{domain}/networking/pages/xyz.jsp</tt>


====JSP Basics====
:; As a Dashboard Widget:
::
 
:; As a Sidebar:
::
 
:; As a Web Tab:
::
 
:; In a Site:
::
 
:; For a Custom Form:
::
 
:; As a Custom Lookup:
:: 
 
===JSP Basics===
The are only a few patterns you need to know to do some serious work with JSP pages:
The are only a few patterns you need to know to do some serious work with JSP pages:
:* <tt><nowiki><% … code … %></nowiki></tt>  -- execute some code
:* <tt><nowiki><% … code … %></nowiki></tt>  -- execute some code
Line 33: Line 52:
<tt><nowiki><% } %></nowiki></tt>
<tt><nowiki><% } %></nowiki></tt>
|}
|}
==Exercise==


===Set up a development environment===
===Set up a development environment===

Revision as of 23:06, 3 August 2012

Goals
  • Set up a development environment
  • Create a JSP page
  • Visit the page in the platform
Prerequisites

Overview of JSP Pages

A Java Server Page (JSP) is an HTML file that contains Java code. If no Java code happens to be present, then the "JSP" page contains nothing but HTML. (In the platform, they are called simply Pages, since they can be either HTML pages or JSP pages.)

The Many Uses of JSP Pages

Objects contain your data, but work with your data and interact with the platform using JSP Pages. In fact, the platform itself is mostly a giant collection of JSP Pages that you use to interact with the underlying database.

Once you know how to create JSP Pages, you will be able to do extensive front-end customization for your users:

By visiting the page URL
https://{domain}/networking/pages/xyz.jsp
As a Dashboard Widget
As a Sidebar
As a Web Tab
In a Site
For a Custom Form
As a Custom Lookup

JSP Basics

The are only a few patterns you need to know to do some serious work with JSP pages:

  • <% … code … %> -- execute some code
  • <%= variable %> -- insert data into the HTML stream
Conditional display of HTML Loops for repeated HTML

<% if (…) { %>
  ... HTML ...
<% } %>

<% for (item:List) { %>
  ... HTML ...
<% } %>

Exercise

Set up a development environment

  1. In the navigation pane, click Setup.
  2. If you don't see an entry called Develop, then:

Create a JSP Page

  1. Click Designer > Pages > [New Page]

Notepad.png

Note: If this is the first development activity to occur, you may see an error message like the following at the top of the screen:

    To create a new class, page, or execute Java code in Data Policies,
    namespace needs to be set in Company Information. Click here ...

The link takes you to the Developer Configuration page, where you can specify your organization's namespace--typically, the company name or an abbreviation of it that corresponds to the company URL. (The lab exercises use "demo".)

  1. Enter the page name: HelloWorld.jsp
    Note: It is necessary to add the .jsp extension when specifying the page name.
  2. Add content for the page:
    <h1 align="center">Hello World!</h1>
    
  3. Click [Save]

Visit the page to confirm that it exists

The page you created appears.
Next
Lab B.2: Simple Interaction