Presto Parameters in Java

  • guruprasad.ks
  • 10/10/08
  • Offline
Posted: Wed, 01/21/2009 - 04:54

Hello Mashers,
Is it possible to access the Presto Global parameters in JSP/Javascript? The Presto Global paramters are set in Admin console --> Parameter management.

In documentation I could find accessing presto global/session parameters in EMML ($global.parameter-name). Is there a similar way for accessing in JSP/JS?

Thanks,

Guruprasad

 

 

 

 

 

cfff4
0
Your rating: None

  Hi

  • aishmishra
  • 09/24/08
  • Offline
  • Wed, 01/21/2009 - 06:06

 

Hi Guru,

http://www.jackbe.com/prestodocs/v2.5/prestolibrary/wwhelp/wwhimpl/api.h...

The above link points to a section of documentation that talks about the very question that you ask. It also contains Java and JavaScript code samples to help understand better.

In case you have trouble with the link search for the following topic in PrestoLibrary "Mapping Presto Parameters to Service Parameters"

Do let us know if it helps?

 


Hi mishra, Thanks. I'd a

  • guruprasad.ks
  • 10/10/08
  • Offline
  • Wed, 01/21/2009 - 07:52

Hi mishra,
Thanks. I'd a chance to refer this link. As per my understanding, when we specify presto parameter either in Java or JS, we are just indicating the parameter and the value is passed to the function/method. But interpreting the value that corresponds to the presto parameter is handled by underlying Presto API/Framework.

But what I'm looking is to obtain the value set corresponding to the Presto parameter. By doing so I can use the Presto Global parameters within presto and also my custom functionality that are added on top of  Jackbe.

Please let me know if I've understood wrongly.

Regards,
Guruprasad

 


Hi Guru, Let me understand

  • aishmishra
  • 09/24/08
  • Offline
  • Wed, 01/21/2009 - 10:38

Hi Guru,

Let me understand correctly. You want to be able to access Presto Parameters in terms of being able to create,edit, delete and, of course, read them (the Presto Parameters)? 


Hi Guru, here is code sample

  • girish
  • 09/22/08
  • Offline
  • Wed, 01/21/2009 - 15:34

Hi Guru, here is code sample to show how you can both store and retrieve presto parameters. 

JUMPRequest req = new JUMPRequest();

Connection con = ConnectionFactory.create();
String token = con.login("", "");

// parameters list
List paramsList = new ArrayList();
paramsList.add("my.amazon.id");  // parameter name
paramsList.add(new String[]{"AGKW7ASGKLAKG"});  // array of one or more values
JUMPResponse response = con.invoke("UserManagerService", "addGlobalAttribute", 
	paramsList, null);  // save it in the system
System.out.println("response----------" + response.toJSON());
paramsList.clear();

paramsList.add("my.amazon.id");  // parameter name to retrieve
response = con.invoke("UserManagerService", "findGlobalAttribute", 
	paramsList, null);  // invoke the service
JSONArray jsonArray = JSONArray.fromObject(response.getResponse());
System.out.println("response----------" + jsonArray.toString());  
// return value is an array of one or more values

- Girish@JackBe


Hi Folks, Thanks for the

  • guruprasad.ks
  • 10/10/08
  • Offline
  • Thu, 01/22/2009 - 07:12

Hi Folks,
Thanks for the quick response.
The code con.invoke("UserManagerService", "findGlobalAttribute", paramsList, null); is the one I was looking out. This should solve my issue.

Regards,
Guruprasad

 

 

 


Hi Folks, Thanks for the

  • guruprasad.ks
  • 10/10/08
  • Offline
  • Thu, 01/22/2009 - 07:13

Hi Folks,
Thanks for the quick response.
The code con.invoke("UserManagerService", "findGlobalAttribute", paramsList, null); is the one I was looking out. This should solve my issue.

Regards,
Guruprasad