Search This Blog

Wednesday 23 October 2013

Popular Aui:Validators - validating your form with Aui:Validations

Hereby i have Listed the Default-Form Validators provided by AUI ,alongwith a few examples showing their implementation in our Application:

DEFAULT AUI : FORM VALIDATORS :

DEFAULT: Liferay.Language.get(‘please-fix-this-field’),
acceptFiles: Liferay.Language.get(‘please-enter-a-file-with-a-valid-extension-x’),
alpha: Liferay.Language.get(‘please-enter-only-alpha-characters’),
alphanum: Liferay.Language.get(‘please-enter-only-alphanumeric-characters’),
date: Liferay.Language.get(‘please-enter-a-valid-date’),
digits: Liferay.Language.get(‘please-enter-only-digits’),
email: Liferay.Language.get(‘please-enter-a-valid-email-address’),
equalTo: Liferay.Language.get(‘please-enter-the-same-value-again’),
max: Liferay.Language.get(‘please-enter-a-value-less-than-or-equal-to-x’),
maxLength: Liferay.Language.get(‘please-enter-no-more-than-x-characters’),
min: Liferay.Language.get(‘please-enter-a-value-greater-than-or-equal-to-x’),
minLength: Liferay.Language.get(‘please-enter-at-list-x-characters’),
number: Liferay.Language.get(‘please-enter-a-valid-number’),
range: Liferay.Language.get(‘please-enter-a-value-between-x-and-x’),
rangeLength: Liferay.Language.get(‘please-enter-a-value-between-x-and-x-characters-long’),
required: Liferay.Language.get(‘this-field-is-required’),
url: Liferay.Language.get(‘please-enter-a-valid-url’)
---------------------------------------------------------------------------------------------------------------------

Please find the implementation examples of few of the Deafult Aui Validators listed above:

## alpha :
<aui:input name="firstName" label="first-name" id="firstName" maxLength="20" >
<aui:validator name="alpha" errorMessage="please-enter-only-alpha-characters" />
</aui:input>

## digits && rangeLength :

<aui:input name="primaryMobileNo" label="primary-mobile-no"
id="primaryMobileNo" maxLength="15">
      <aui:validator name="digits" errorMessage="please-enter-valid-mobile-number" />
     <aui:validator name="rangeLength"
errorMessage="please-enter-valid-mobile-number">[8,15]</aui:validator>
</aui:input>

## email :
<aui:input name="primaryEmail" label="primary-email" id="primaryEmail">
<aui:validator name="email" errorMessage="please-enter-valid-email" />
</aui:input>

## alphanum :
<aui:input name="crmNumber" label="crm-no" id="customerCRMNo">
<aui:validator name="alphanum"
errorMessage="please-enter-valid-customer-CRMNo" />
</aui:input>

## minLength :
 <aui:validator name="minLength" errorMessage="Phone number format as (xxx) xxx-xxxx" >10</aui:validator>


## maxLength : 
<aui:validator name="maxLength" errorMessage="Phone number format as (xxx) xxx-xxxx">10</aui:validator>



Note: AUI doesn't provide as such any default Validators for Dropdowns , in such a case you need to implement you custom form validations for dropdowns,etc  using AUI or jQuery,etc
reference:  

IMPORT A DUMP INTO MYSQL


IMPORT A DUMP INTO MYSQL

Incase you wanna import a mysql database dump follow the following steps:

Open command-promt in your system (Windows + cmd)...
Now, goto the file location and then run this command

G:\data\>mysql -u root -proot myNewDB< mydump.sql


where,
  • say my file was in G:Drive so G:\data\  & mysql- (username = root & password=root)
  • myNewDB is the DB(newly created/existing) where you wanna import the mysql dump.
  • mydump.sql is name of the mysql-dump file.


--
Plz : Do post your valuable comments in case this doesn't work for you. Thanks In Advance...!!! 

Tuesday 22 October 2013

Creating an Intent In Android , Starting activities Using Intents & Passing/Receiving data through Intent


-----------------------------------------------------------------------------------------------
Starting activities Using Intents :-
To start an activity use the method startActivity(intent). This method is defined on the Context object which Activity extends.
The following code demonstrates how you can start another activity via an intent.

say:   Activity1 (Sender Activity)

Button btn = (Button)findViewById(R.id.goBackBtn);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

//write an Intent to redirect to Activity2--
Intent gotoActivity2= new Intent();
gotoActivity2.setComponent(new ComponentName(Activity2_pkg_nameActivity2_class_name));
MainActivity.this.startActivity(gotoActivity2);  //the Current Activity(ie MainActivity) will start the Intent -'gotoActivity2'

      }
});

say:  Activity2 (Sub-Activity/ Target Activity/)
 Activities which are started by other Android activities are called sub-activities. 

public void onClick(View v){
//write an Intent to redirect to Activity1--
  Intent gotoActivity1= new Intent();
  gotoActivity1.setComponent(new ComponentName(Activity1_pkg_nameActivity1_class_name));
  this.startActivity(gotoActivity1);      //the Current Activity will start the Intent -'gotoActivity1'
}
So, as soon as the control comes to this onClick() method the current activity will start an Intent named-'gotoActivity1' which will take the control back to activity1.

Note: the text highlighted with green should be replaced by you in application. Something like this:
Activity1_pkg_name could be replaced by a package name of activity1 say: [com.blogs.prabhakar.activity1]
-----------------------------------------------------------------------------------------------

Passing/Receiving data through Intent ...

I am trying to pass data through my Intent into the next activity so I can receive it 

say: Sender Activity
Hereby , im sending the following three params [isLocationAvailable , latitude, longitude] alongwith the Intent & receiving the same in the Receiver Activity(Target Activity)...
Intent gotoActivity2= new Intent();
gotoActivity2 .setComponent(new ComponentName(Activity2_package_name, Activity2_class_name));
gotoActivity2 .putExtra(isLocationAvailable,true);
gotoActivity2 .putExtra(latitude ,dest_Coordinates.latitude);
gotoActivity2 .putExtra(longitude, dest_Coordinates.longitude);
this.startActivity(gotoActivity2 );

say: Receiver Activity
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    boolean isLocationAvailable = getIntent().getExtras().getBoolean("isLocationAvailable");
if(isLocationAvailable){
double dest_lat = getIntent().getExtras().getDouble("latitude");
double dest_lng = getIntent().getExtras().getDouble("longitude");
toPosition = new LatLng(dest_lat, dest_lng);
}
}
---------------------------------------------------------------------------------------------------

Tuesday 8 October 2013

Using checkbox in an Aui:Form

InCase you are facing an issue fetching the appropriate value of a checkbox field in an Aui-Form..this post is definetely going to of some help..

-----------------------------------------------------------------------------------------------------
Creating a Checkbox field using an Aui:form in a JSP..

<aui:form action="<%=submitUrl.toString() %>" type="post" >
 <aui:input name="view" id="view" type="checkbox" label="View" onchange="onChangeView(this);"/>
  <aui:button name="submit" type="submit" />
</aui:form>

-----------------------------------------------------------------------------------------------------
Retrieving the Checkbox field values in a JavaScript function..

function onChangeView(){

// Not Working Correctly
var viewChecked = document.getElementById("<portlet:namespace/>view").checked;  [X]

// Whenever i tried to check if the checkbox is checked or not it was always showing false even if it was
// checked.
// Later ,I came to know through some blogs/forums-post[courtsey - Atin Agarwal ..still remem the name] 
// that in AUI if the input type type is checkbox then it
// appends "Checkbox" to the name of the field.
// like hereby the name of the field was "view" but it was making : "viewCheckbox". It automatically adds this //redundant string "Checkbox" at the end of  the name you give.
// So ,in Case to execute it correctly we have to write something like :

//Works just as Expected
var viewChecked = document.getElementById("<portlet:namespace/>viewCheckbox").checked; [Y]
alert("viewChecked == " +viewChecked);

}

-----------------------------------------------------------------------------------------------------
Retrieving the Checkbox field values in Portlet class..

public void doAssignUserBasedPermission(ActionRequest actionRequest ,ActionResponse actionResponse){
//Works just as Expected
boolean  viewChecked = ParamUtil.getBoolean(actionRequest, "view");
System.out.println(" viewchecked = "+viewChecked);
}

Friday 4 October 2013

How to draw route in google-maps-api-v2 from my Current-location to a given Destination


MainActivity.java

public class MainActivity extends FragmentActivity { // Activity {

private static final String TAG ="MainActivity";
GoogleMap mMap;
GMapV2Direction md;

 LatLng fromPosition = new LatLng(12.914788 , 77.610106);
 LatLng toPosition = new LatLng(12.94231 , 77.59739);

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

md = new GMapV2Direction();
mMap = ((SupportMapFragment)getSupportFragmentManager()
.findFragmentById(R.id.the_map)).getMap();

LatLng coordinates = new LatLng(12.914788 , 77.610106);

mMap.setMyLocationEnabled(true);
mMap.getUiSettings().setZoomControlsEnabled(true);
mMap.getUiSettings().setCompassEnabled(true);
mMap.getUiSettings().setMyLocationButtonEnabled(true);
mMap.getUiSettings().setAllGesturesEnabled(true);
mMap.setTrafficEnabled(true);
mMap.animateCamera(CameraUpdateFactory.zoomTo(12));
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(coordinates, 16));

mMap.addMarker(new MarkerOptions().position(fromPosition).title("Start"));
mMap.addMarker(new MarkerOptions().position(toPosition).title("End"));

new showRoute().execute();
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}

private class showRoute extends AsyncTask<Void, Void, Document>{

Document doc;
PolylineOptions rectLine;

@Override
protected Document doInBackground(Void... params) {

doc = md.getDocument(fromPosition, toPosition, GMapV2Direction.MODE_DRIVING);

ArrayList<LatLng> directionPoint = md.getDirection(doc);
rectLine = new PolylineOptions().width(3).color(Color.RED);

for(int i = 0 ; i < directionPoint.size() ; i++) {
           rectLine.add(directionPoint.get(i));
}

return null;
}

@Override
protected void onPostExecute(Document result) {

mMap.addPolyline(rectLine);
}

}
}
------------------------------------------------------------------------------------------------
GMapV2Direction.java
package com.prabhakar;

public class GMapV2Direction {

public final static String MODE_DRIVING = "driving";
public final static String MODE_WALKING = "walking";

public GMapV2Direction() { }

public Document getDocument(LatLng start, LatLng end, String mode) {

//Implement THREADING concept here  ###

String url = "http://maps.googleapis.com/maps/api/directions/xml?"
+ "origin=" + start.latitude + "," + start.longitude
+ "&destination=" + end.latitude + "," + end.longitude
+ "&sensor=false&units=metric&mode=driving";

try {
HttpClient httpClient = new DefaultHttpClient();
HttpContext localContext = new BasicHttpContext();
HttpPost httpPost = new HttpPost(url);
HttpResponse response = httpClient.execute(httpPost, localContext);

InputStream in = response.getEntity().getContent();
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document doc = builder.parse(in);
return doc;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}

public String getDurationText (Document doc) {
NodeList nl1 = doc.getElementsByTagName("duration");
        Node node1 = nl1.item(0);
        NodeList nl2 = node1.getChildNodes();
        Node node2 = nl2.item(getNodeIndex(nl2, "text"));
        Log.i("DurationText", node2.getTextContent());
return node2.getTextContent();
}

public int getDurationValue (Document doc) {
NodeList nl1 = doc.getElementsByTagName("duration");
        Node node1 = nl1.item(0);
        NodeList nl2 = node1.getChildNodes();
        Node node2 = nl2.item(getNodeIndex(nl2, "value"));
        Log.i("DurationValue", node2.getTextContent());
return Integer.parseInt(node2.getTextContent());
}

public String getDistanceText (Document doc) {
NodeList nl1 = doc.getElementsByTagName("distance");
        Node node1 = nl1.item(0);
        NodeList nl2 = node1.getChildNodes();
        Node node2 = nl2.item(getNodeIndex(nl2, "text"));
        Log.i("DistanceText", node2.getTextContent());
return node2.getTextContent();
}

public int getDistanceValue (Document doc) {
NodeList nl1 = doc.getElementsByTagName("distance");
        Node node1 = nl1.item(0);
        NodeList nl2 = node1.getChildNodes();
        Node node2 = nl2.item(getNodeIndex(nl2, "value"));
        Log.i("DistanceValue", node2.getTextContent());
return Integer.parseInt(node2.getTextContent());
}

public String getStartAddress (Document doc) {
NodeList nl1 = doc.getElementsByTagName("start_address");
        Node node1 = nl1.item(0);
        Log.i("StartAddress", node1.getTextContent());
return node1.getTextContent();
}

public String getEndAddress (Document doc) {
NodeList nl1 = doc.getElementsByTagName("end_address");
        Node node1 = nl1.item(0);
        Log.i("StartAddress", node1.getTextContent());
return node1.getTextContent();
}

public String getCopyRights (Document doc) {
NodeList nl1 = doc.getElementsByTagName("copyrights");
        Node node1 = nl1.item(0);
        Log.i("CopyRights", node1.getTextContent());
return node1.getTextContent();
}

public ArrayList<LatLng> getDirection (Document doc) {
NodeList nl1, nl2, nl3;
        ArrayList<LatLng> listGeopoints = new ArrayList<LatLng>();
        nl1 = doc.getElementsByTagName("step");   
        if (nl1.getLength() > 0) {
            for (int i = 0; i < nl1.getLength(); i++) {
                Node node1 = nl1.item(i);
                nl2 = node1.getChildNodes();

                Node locationNode = nl2.item(getNodeIndex(nl2, "start_location"));
                nl3 = locationNode.getChildNodes();
                Node latNode = nl3.item(getNodeIndex(nl3, "lat"));
                double lat = Double.parseDouble(latNode.getTextContent());
                Node lngNode = nl3.item(getNodeIndex(nl3, "lng"));
                double lng = Double.parseDouble(lngNode.getTextContent());
                listGeopoints.add(new LatLng(lat, lng));

                locationNode = nl2.item(getNodeIndex(nl2, "polyline"));
                nl3 = locationNode.getChildNodes();
                latNode = nl3.item(getNodeIndex(nl3, "points"));
                ArrayList<LatLng> arr = decodePoly(latNode.getTextContent());
                for(int j = 0 ; j < arr.size() ; j++) {
                listGeopoints.add(new LatLng(arr.get(j).latitude, arr.get(j).longitude));
                }

                locationNode = nl2.item(getNodeIndex(nl2, "end_location"));
                nl3 = locationNode.getChildNodes();
                latNode = nl3.item(getNodeIndex(nl3, "lat"));
                lat = Double.parseDouble(latNode.getTextContent());
                lngNode = nl3.item(getNodeIndex(nl3, "lng"));
                lng = Double.parseDouble(lngNode.getTextContent());
                listGeopoints.add(new LatLng(lat, lng));
            }
        }
     
        return listGeopoints;
}

private int getNodeIndex(NodeList nl, String nodename) {
for(int i = 0 ; i < nl.getLength() ; i++) {
if(nl.item(i).getNodeName().equals(nodename))
return i;
}
return -1;
}

private ArrayList<LatLng> decodePoly(String encoded) {
ArrayList<LatLng> poly = new ArrayList<LatLng>();
int index = 0, len = encoded.length();
int lat = 0, lng = 0;
while (index < len) {
int b, shift = 0, result = 0;
do {
b = encoded.charAt(index++) - 63;
result |= (b & 0x1f) << shift;
shift += 5;
} while (b >= 0x20);
int dlat = ((result & 1) != 0 ? ~(result >> 1) : (result >> 1));
lat += dlat;
shift = 0;
result = 0;
do {
b = encoded.charAt(index++) - 63;
result |= (b & 0x1f) << shift;
shift += 5;
} while (b >= 0x20);
int dlng = ((result & 1) != 0 ? ~(result >> 1) : (result >> 1));
lng += dlng;

LatLng position = new LatLng((double) lat / 1E5, (double) lng / 1E5);
poly.add(position);
}
return poly;
}
}
--------------------------------------------------------------------------------------------------
main.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"  >

    <fragment
        android:id="@+id/the_map"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        class="com.google.android.gms.maps.SupportMapFragment"/>


</RelativeLayout>
--------------------------------------------------------------------------------------------------
AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.prabhakar"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="8"
        android:targetSdkVersion="17" />

  <permission android:name="com.prabhakar.permission.MAPS_RECEIVE"
         android:protectionLevel="signature"/>

    <uses-permission android:name="com.prabhakar.permission.MAPS_RECEIVE" />    
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    
    <uses-feature android:glEsVersion="0x00020000"
        android:required="true"/>
    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme"
        android:debuggable="true" >
        
      <meta-data android:name="com.google.android.maps.v2.API_KEY"
            android:value="-----enter your v2 API key here----------"/>
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>
-----------------------------------------------------------------------------------------------

Thursday 3 October 2013

JAVA Interview Question And Answer

------------------------------------------------------------------------------------------------------------------------------
Question: What is System.out in Java?
Here out is an instance of PrintStream. It is a static member variable in
System class. This is called standard output stream, connected to console.
------------------------------------------------------------------------------------------------------------------------------
Question: Can we have static methods in interface?
By default, all methods in an interface are decleared as public, abstract. It will never be static.
------------------------------------------------------------------------------------------------------------------------------

Question: What is java static import?
By using static imports, we can import the static members from a class
rather than the classes from a given package.  For example, Thread class has
static sleep method, below example gives an idea:

import static java.lang.Thread;
public class MyStaticImportTest {
   public static void main(String[] a) {
       try{
           sleep(100);
       } catch(Exception ex){
       
       }
   }
}
------------------------------------------------------------------------------------------------------------------------------
Question: What is abstract class or abstract method?
We cannot create instance for an abstract class. We can able to create
instance for its subclass only. By specifying abstract keyword just before
class, we can make a class as abstract class.

public abstract class MyAbstractClass{

}

Abstract class may or may not contains abstract methods. Abstract method is
just method signature, it does not containes any implementation. Its subclass
must provide implementation for abstract methods. Abstract methods are looks
like as given below:
public abstract int getLength();
------------------------------------------------------------------------------------------------------------------------------
Question: When to use LinkedList or ArrayList?
Accessing elements are faster with ArrayList, because it is index based.But accessing is difficult with LinkedList. It is slow access. This is to access any element, you need to navigate through the elements one by one. But insertion and deletion is much faster with LinkedList, because if you know the node, just change the pointers before or after nodes. Insertion and deletion is slow with ArrayList, this is because, during these operations ArrayList need to adjust the indexes according to
deletion or insetion if you are performing on middle indexes. Means,an ArrayList having 10 elements, if you are inserting at index 5, then you need to shift the indexes above 5 to one more.
------------------------------------------------------------------------------------------------------------------------------
Question: What is final, finally and finalize?

By specifying final keyword to the method you can avoid overriding
in a subcalss. Similarlly one can use final at class level to prevent creating subclasses.

final:
   final is a keyword. The variable decleared as final should be
   initialized only once and cannot be changed. Java classes
   declared as final cannot be extended. Methods declared as final
   cannot be overridden.
   
finally:
   finally is a block. The finally block always executes when the
   try block exits. This ensures that the finally block is executed
   even if an unexpected exception occurs. But finally is useful for
   more than just exception handling - it allows the programmer to
   avoid having cleanup code accidentally bypassed by a return,
   continue, or break. Putting cleanup code in a finally block is
   always a good practice, even when no exceptions are anticipated.
   
finalize:
   finalize is a method. Before an object is garbage collected, the
   runtime system calls its finalize() method. You can write system
   resources release code in finalize() method before getting garbage
   collected.
------------------------------------------------------------------------------------------------------------------------------
Question: Can interface be final?
No. We can not instantiate interfaces, so in order to make interfaces useful we must create subclasses. The final keyword makes a class unable to be extended.
------------------------------------------------------------------------------------------------------------------------------
Question: What are the different session tracking methods?
Cookies:
   You can use HTTP cookies to store information. Cookies will be
   stored at browser side.

URL rewriting:
   With this method, the information is carried through url as
   request parameters. In general added parameter will be sessionid,
   userid.

HttpSession:
   Using HttpSession, we can store information at server side. Http
   Session provides methods to handle session related information.
   
Hidden form fields:
   By using hidden form fields we can insert information in the webpages
   and these information will be sent to the server. These fields are not
   visible directly to the user, but can be viewed    using view source
   option from the browsers. The hidden form fields are as given below:
       <input type='hidden' name='blogName' value='PrabhakarSinghBlogs'/>
  ------------------------------------------------------------------------------------------------------------------------------     
Question: What is the difference between Enumeration and Iterator?
The functionality of Enumeration and the Iterator are same. You can get remove()
from Iterator to remove an element, while while Enumeration does not have remove()
method. Using Enumeration you can only traverse and fetch the objects, where as using
Iterator we can also add and remove the objects. So Iterator can be useful if you want
to manipulate the list and Enumeration is for read-only access.

------------------------------------------------------------------------------------------------------------------------------
Question: How can you convert Map to List?
We know that Map contains key-value pairs, whereas a list contains
only objects. Since Entry class contains both key-value pair,
Entry class will helps us to convert from Map (HashMap) to
List (ArrayList). By using Map.entrySet() you will get Set
object, which intern you can use it to convert to list object.

public static void main(String a[]){
   Map<String, String> wordMap = new HashMap<String, String>();
   Set<Entry<String, String>> set = wordMap.entrySet();
   List<Entry<String, String>> list = new ArrayList<Entry<String, String>>(set);
}
------------------------------------------------------------------------------------------------------------------------------
Question: What is serialization?
Question: What is serialization?
Question: What is a user defined exception? Explain with an Example ?
Question: What are checked and unchecked exceptions?
Question: What is the difference between an Abstract class and Interface?

Wednesday 2 October 2013

IPC Type1-PublicRenderParameter


--STEP1--
      -----portlet.xml mapping ---SENDER/RECEIVER portlet-----
---------------------------------------------------------------------------------------------
<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" version="2.0">

<portlet>
<portlet-name>senderportlet</portlet-name>
<display-name>SenderPortlet</display-name>
....
.
.
.
.
<supported-public-render-parameter>companyName</supported-public-render-parameter>
<supported-public-render-parameter>travelDate</supported-public-render-parameter>
</portlet>


<portlet>
<portlet-name>receiverportlet</portlet-name>
<display-name>ReceiverPortlet</display-name>
....
.
.
.
.
<supported-public-render-parameter>companyName</supported-public-render-parameter>
<supported-public-render-parameter>travelDate</supported-public-render-parameter>
</portlet>


<public-render-parameter>
    <identifier>companyName</identifier>
   <qname xmlns:x="http://mts.com/companyName">x:companyName</qname>
</public-render-parameter>
<public-render-parameter>
<identifier>travelDate</identifier>
<qname xmlns:x="http://mts.com/travelDate">x:travelDate</qname>
</public-render-parameter>

</portlet-app>
---------------------------------------------------------------------------------------------

--STEP2-------
------------Update the Sender portlet----------
---------------------------------------------------------------------------------------------

String companyName = ParamUtil.getString(actionRequest, "companyName");
String travelDate = ParamUtil.getString(actionRequest, "travelDate");

actionResponse.setRenderParameter("companyName",companyName);
actionResponse.setRenderParameter("travelDate",travelDate );

---------------------------------------------------------------------------------------------


--STEP3-------
-----------Upodate the Receiver portlet-----------
---------------------------------------------------------------------------------------------

String companyName = ParamUtil.getString(request, "companyName");
String travelDate = ParamUtil.getString(request, "travelDate");


---------------------------------------------------------------------------------------------