Wednesday, December 19, 2012

ADF Mobile: Displaying error, warning, info messages


Every application will have scenarios to display different kinds of error and information messages on the screen. ADF Messages on mobile devices are displayed as a popup with a single close button

This demo application RedstackLogicMessagesDemo.rar has simple code to throw different kind of messages on to the screen when some buttons are clicked.

to create an error that is thrown onto the screen you can throw a new oracle.adfmf.framework.exception.AdfException. This lets you throw either of  FATAL, ERROR, WARNING, INFO messages on to the screen.

for e.g. to show messages you can create exceptions like this


image




Below is how messages will look in the mobile






image
imageimage
image



Tuesday, December 18, 2012

Creating a weblogic domain and a cluster in windows


1. Go to Configuration Wizard
image
2. Select Create new Domain
image
3. Select required technologies and click next
image

4.  Give a Domain Name and click next
image

5. give a Username and password and click next
image
6.Select the required mode and click Next
image

7. If you are not creating a MDS Schema click next . If it asks for a password, Check the box and enter some text in the password box and uncheck the box and click next.
image
8. hit next.
If you get a warning, click OK
image

9. select the required setting you want to configure and click next.
image
10. You can leave the defaults here
image




11.
image

12. Create the managed servers for the cluster
image

13. give a cluster name . If required, You can also setup multicast here. hit next
 image

14.
Shuffle both the managed servers created in step 12 to the cluster.
image
15. give a machine name
 image


16.

Add the server you want to configure on this machine. hit next
image
17. Add the libraries and application you want to configure on this servers
image

18.  Select required services and hit Next.
image
19.  Hit Create

image

ADF Mobile : Consuming a Restful service



Simple way to consume a restful service in ADF Mobile is to create a URL Service Data Control.

I have created two applications. The first one RestServices.rar is a simple restful service which does a begins with search of Employees. The second one RedStackMobileRestfulDemo.rar is a ADF mobile application to consume the restful service.

First I create an XSD locally in the project to represent the response. We can also refer this remotely. But this will cause the mobile application to make a call every time the application runs.


Employees.xsd
<?xml version="1.0" encoding="windows-1252" ?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="employees">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="employee" maxOccurs="unbounded" minOccurs="0">
          <xs:complexType>
            <xs:sequence>
              <xs:element type="xs:string" name="department"/>
              <xs:element type="xs:byte" name="employeeId"/>
              <xs:element type="xs:string" name="name"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>







We can now create a URL Service Data Control. Below are the steps to create a URL service data control

1

image

2 give the
URL Endpoint : get url without the query
Source: give the query with param values in ## ## as illustrated below

image

3 Here it mandates the query to have a defaultvalue

image

4 Select the Employees.xsd and finish

image

You can now see the data control in the data control pallet

image





You can now drag and drop  loaddata Action into the amx page as ADF Mobile Parameter Form . Drag and drop employee as ADF Mobile List View.

image

image















You can now preview and run the app. For reference you can also download the source code