Submitted By: Abhilash Manne

marlinlineInternet and Web Development

Oct 31, 2013 (3 years and 9 months ago)

73 views

Tutorial on Creation of ASK Application with Oracle Jdeveloper 10.1.3

for partial completion of
CIS 764
-

Database Design course
Submitted By: Abhilash Manne
.

“ASK”: Ask server is a component that enabl
es messaging devices to interact with web applications. It provides a
way for users of messaging devices to ask for information.

‘ASK’ Server Architecture:

Oracle Application Server Wireless presents a framework and a runtime environment for developing wir
eless and
voice applications accessed through a browser
-
based device such as a device with a WAP or XHTML browser, or
through messaging
-
protocol
-
based devices such as mobile phones with SMS. Ask Server is the wireless component
that enables the messaging p
rotocol
-
based devices to access these wireless applications.

Conventionally, the entry point into an application server is through the HTTP protocol. This limits applications
built on an application server to only clients with web capability. This server r
estriction is a problem for mobile
market users, because the vast majority of mobile users does not have web access. These users, however, are almost
certain to have some kind of message capability (such as e
-
mail or SMS). With the introduction of Ask Serv
er,
applications can also be accessed through messaging protocols other than HTTP, such as e
-
mail or SMS. The
developers the build only the application logic, while Oracle Application Server Wireless establishes the proper
connection, performs session mana
gement, and interprets user requests. An application is invoked the same way
regardless of which protocol handles the incoming requests, offering complete transparency to application
developers to allow access to their services.

Begin Tutorial:

NOTE: This
tutorial considers the user to be well versed in using JDeveloper.

All the user
-
help
-
snap
-
shots are provided after the steps involved.

Refer snapshots of the steps involved at the end
of steps describing every sub
-
module.

Create an application and project.

1.

O
pen the New Gallery by choosing File

-
> New
.

2.

In the New Gallery, in the Categories

tree, select
General
.

3.

In the Items

list, double
-
click
Application
.

4.

In the Create Application dialog, enter
HelloApp

as the application name and click
OK
.

5.

In the Create Pro
ject dialog, enter
HelloPrj

as the project name and click
OK
.

Create a JSF JSP file.

1.

In the Applications Navigator, right
-
click the project you just created and select
N
ew
.

2.

In the New Gallery, expand the
Web Tier

node and select the
JSF

category.

3.

In the
I
t
ems

list, double
-
click
JSF JSP
.

4.

On the Welcome page, click Next
.

5.

On the Web Application page, select
S
e
rvlet 2.4
\
JSP 2.0 (J2EE 1.4)

and click
N
ext
.

6.

On the JSP File page, select
JSP D
o
cument
, enter
Hello.jspx

as the filename, and click
N
ext
.

7.

On the Componen
t Binding page, select
D
o Not Automatically Expose UI Components in a Managed
Bean
, and click
N
ext
.

8.

On the Error Page Options page, click
N
ext
.

9.

On the Tag Libraries page, use the
button to move
ADF Faces Components

and
ADF Faces HTML

from the
A
vailable Libraries

list to the
S
elected Libraries

list, and click
F
inish
.

10.

On the HTML Options page, click
N
ext.

11.

On the Finish page, click
F
inish to

create the JSF JSP file.





Create a Java Bean, to store the input name.

1.

In the Applications Navigator, right
-
click the project you just created and select
N
ew.

2.

In the New Gallery, expand the General node and select the JavaBeans category.

3.

In the
I
tem
s list, double
-
click Bean.

4.

In the Create Bean dialog, enter
HelloBean

as the name, select
java.lang.Object

from the
E
xtends

dropdown list, and click
OK
.

5.

In the source editor for the
HelloBean.java

file, add the following code after the bean constructor:

pu
blic String getName()

{

return name;

}

public void setName(String name)

{

this.name = name;

}

private String name;






Create a managed bean inside the ADF Faces configuration.

1.

In the Applications Navigator, expand the Web Content tree under the project

you created.

2.

Expand the WEB
-
INF tree and select the faces
-
config.xml node.

The structure of the faces
-
config.xml file will appear in the Structure window.


3.

In the Structure window, right
-
click
Faces Config

and choose
I
nsert inside Faces Config

mana
g
ed
-
bean
.

4.

In the Create Managed Bean dialog, enter
Hello

as the name and
mypackage.HelloBean

as the class, and
click
OK
.

5.

In the Structure window,

expand the managed bean node and right
-
click
Scope
.

6.

Choose
Insert
a
fter Scope
m
a
naged
-
property
.

7.

In the Create Managed Property dialog, ent
er
name

as the name and
java.lang.String

as the class, and click
OK
.

8.

In the Structure window, right
-
click the managed property node and select
Pr
o
perties
.

9.

In the managed
-
property Properties dialog, enter
#{param.name}

as the value and click
OK
.

Add ADF Com
ponents to the JSF JSP file.

1.

In the Applications Navigator, double
-
click Hello.jspx.

2.

In the Structure window, delete the jsp:output and html nodes.

3.

Right
-
click f:view and choose
I
nsert inside f:view
AD
F

Faces HTML
Ht
m
l.

4.

Right
-
click afh:html and choose
I
nsert inside afh:html
AD
F

Faces HTML
H
ead.

5.

Righ
t
-
click afh:head
-

Title 1 and choose Pr
o
perties.

6.

In the Head Properties dialog, enter
Hello App

as the title property and click
OK
.

7.

In the Structure window, right
-
click afh:html and choose
I
nsert inside afh:html
AD
F

Faces HTML
B
ody.

8.

Right
-
click afh:body and choose
I
nsert insid
e afh:body
A
DF Faces Core.

9.

In the Insert ADF Faces Core Item dialog, select Form and click OK.

10.

In the Structure window, right
-
click af:form

and choose
I
nsert inside af:form
ADF Faces Core.

11.

In the Insert ADF Faces Core Item dialog, select OutputText and click OK.

12.

In the Structur
e window, right
-
click af:outputText
-

outputText1 and choose Pr
o
perties.

13.

In the OutputText Properties dialog, enter Hello (with a trailing space) as the value property and click OK.

Note:

The trailing space is required to differentiate between the static o
utput text Hello and the subsequent
output parameter, which we will pass to the application.

14.

In the Structure window, right
-
click the output text node and choose Insert
a
fter af:outputText
-

Hello
A
DF Faces Core.

15.

In the Insert ADF Faces Core Item dialog, select OutputText and click OK.

16.

Right
-
click af:outputText
-

outputText2 and choose Pr
o
perties.

17.

In the OutputText Properties dialog, delete t
he default value and click
B
ind.

18.

In the Bind to Data dialog, in
V
ariables navigation tree, expand JSF Managed Beans and Hello, and select
name.

19.

Click the
button to create an EL expression using the variable and click OK.

20.

In the OutputText Properties dialog, click
OK
.







Configure a Renderkit onto
faces
-
config.xml
.

1.

In the Applications Navigator, select the
faces
-
config.xml

node.

The

structure of the faces
-
config.xml file will appear in the Structure window.

2.

In the Structure window, right
-
click the managed bean node and choose
Insert
a
fter managed
-
bean
-

Hello
r
ender
-
kit
.

3.

In the Create Render Kit dialog, enter
oracle.adf.async

as the ID and
oracle.adfinternal.view.faces.ask.renderkit.AsyncRenderKit

as the class, and click
OK
.

4.

In the Structure window, Double
-
click the
app
lication

node.

5.

In the application Properties dialog, enter
oracle.adfinternal.view.faces.ask.application.AsyncViewHandlerImpl

as the view handler.



Add the Ask render kit implementati on as part of the library.

1.

In the Applications Navigator, right
-
click th
e
HelloPrj

node and choose
Proj
e
ct Properties
.

2.

In the Project Properties dialog, in the navigation tree, click
Libraries
.

3.

On the Libraries page, Click
Add Li
b
rary
.

4.

In the Add Library dialog, click
N
ew
.

5.

In the Create Li brary di al og, cl i ck
Add
E
ntry
.

6.

In the
Sel ect Path Entry di al og, navi gate to
wi rel ess/l ib

under the JDevel oper home di rectory, sel ect
ask
-
adf
-
faces
-
i mpl.jar
, and cl i ck
Sel ect
.

7.

In the Create Library dialog, click
OK
.

8.

In the Add Library dialog, click
N
ew
.

R
epeat some steps to add the ADF Share li
brary.

9.

In the Create Library dialog, click
Add
E
ntry
.

10.

In the Select Path Entry dialog, navigate to
BC4J
\
lib

under the JDeveloper home directory, select
adfshare.jar
, and click
Select
.

11.

In the Create Library dialog, click
OK
.

12.

In the Add Library dialog, click

OK
.

13.

In the Project Properties dialog, click
OK
.















Create a deployment profile for the application.

1.

From the main menu, choose
R
un

-
>
Deplo
y

-
>
N
ew Deployment Profile
.

2.

In the New Gallery, expand the
General

node and select the
Deployment Pr
ofiles

category.

3.

In the
I
tems
, double
-
click
WAR File
.

4.

In the Create Deployment Profile
--

WAR File dialog, enter
HelloApp

as the name and click
OK
.

5.

In the WAR Deployment Profile Properties dialog, in the navigation tree, expand the
File Groups

node,
expand

the
WEB
-
INF/lib

node and select
Contributors
.

6.

On the Contributors page, select the
ADF Common Runtime
,
Adfshare.jar

and
Adfshare.jar

checkboxes,
and click
OK
.






`