Thanks for reply.
I got the solution by checking the publication name in that action class like
this.
If(!publicationname.equals("mypubname")
Return Empty_Map;
Else
{ our code.
}
Thanks & Regards
G.srinivas.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: Wednesday, June 21, 2006 11:02 AM
To: [email protected]
Subject: Re: Calling Action basing on Publication..............
On 6/5/06, Gurram, Srinivas <[EMAIL PROTECTED]> wrote:
> Thanks for reply.
> Actually i am passing two parameters into that action pipeline for one
> of my publication. but those parameters are not necessary for other
> publications.
> when i am trying to create a new document in other publications, its
> giving an error "parameter exception".so, how can i pass those parameters
> basing on publication in usecase.xmap.
Sorry about the delay. I just noticed your issue was not solved.
There is an algorithm called "setting a default value". It is not
used much in Lenya1.2 because the devs prefer to throw errors if input
is not perfect, but it is extremely useful for programs used by the
general public. The code looks like:
name = "Name left blank";
testname = cocoon.parameter.name;
if((null != testname) && (name.length() > 0) name = testname; //Valid input
It can also be done in reverse:
name = cocoon.parameter.name;
if((null != name) && (name.length() < 1) name = "Name left blank";
//Invalid input
You could also set the invalid parameter to empty or null, and then
test before any publication-specific code that would use it.
if(!name.equals("Name left blank")) doSomething;
or only throw an error if the parameter was required:
if(publication.equals("mypub") && name.equals("Name left blank"))
throw error;
Java has a special syntax for catching errors. Use it if you are
receiving an error when retrieving the parameter:
try{
name = cocoon.parameter.name;
}catch(ParameterException pe){
name = "No name parameter found";
}
You might hire a Java programmer to assist with this.
solprovider
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege. It should not be copied,
disclosed to, retained or used by, any other party. If you are not an intended
recipient then please promptly delete this e-mail and any attachment and all
copies and inform the sender. Thank you.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]