Oracle™ Business Intelligence Beans Java API Reference
Release 10
g (9.0.4)
Part number B12159_01


oracle.dss.thin.beans
Class CaboUtils

java.lang.Object
  |
  +--oracle.dss.thin.beans.CaboUtils

public class CaboUtils
extends java.lang.Object

CaboUtils is utility class that implements Cabo helper methods.


Method Summary
static java.lang.String createStringLiteral(java.lang.String inString)
          Given a Java String, this method creates a string literal from a Java String.
static void createStringLiteral(java.lang.StringBuffer outBuffer, java.lang.String inString)
          Given a StringBuffer and a String, this routine writes the string literal of the string into the StringBuffer.
static java.lang.String createSubmitFormScript(oracle.cabo.ui.RenderingContext context, java.lang.String formName, java.lang.String[][] params, boolean validate)
          This routine helps application programmers create the section of a javascript routine that submits a form with specific event parameters.

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Method Detail

createStringLiteral

public static java.lang.String createStringLiteral(java.lang.String inString)
Given a Java String, this method creates a string literal from a Java String. This method is useful when adding string literals to Javascript methods, since typically the strings to be added are in the form of a Java string as opposed to a Java string literal. Note : Multibyte characters are not converted into their literal values, since it is assumed that they will be encoded via the HttpResponse's OutputStream.
Parameters:
inString - the string to turn into a string literal
Returns:
a string literal representation of inString

createStringLiteral

public static void createStringLiteral(java.lang.StringBuffer outBuffer,
                                       java.lang.String inString)
Given a StringBuffer and a String, this routine writes the string literal of the string into the StringBuffer. For example, "\MyCar" would be changed into "\\myCar", so that "\\myCar" can be properly used as a string literal in a javascript routine.
Parameters:
outBuffer - the StringBuffer that the string literal will be appended to
inString - the string to be turned into a string literal and appended to the outBuffer

createSubmitFormScript

public static java.lang.String createSubmitFormScript(oracle.cabo.ui.RenderingContext context,
                                                      java.lang.String formName,
                                                      java.lang.String[][] params,
                                                      boolean validate)
This routine helps application programmers create the section of a javascript routine that submits a form with specific event parameters. For example, if createSubmitFormScript was called with:
  1. formname="myForm"
  2. params = {"param","'param1Value'"}
  3. validate = true
Then the javascript that would be generated would be "submitForm('myForm',1,{param1,'param1Value'})".

If this javascript routine needs to be set on an OnClick handler of a link, then extra javascript needs to be placed around the method invokation, in order for the javascript to work correctly.

For example, the javascript for an OnClick handler that needs to send the form to a different form destination than was rendered with the form would be: "document.myForm.action='http:\\myServlet\myNewPage';submitForm('myForm',1,{param1,'param1Value'});return false".

The parameter values that are passed into this routine can either be string literals or javascript variables. If they are string literals, then they need to be single quoted and must be string literals as opposed to actual strings. In order to change a java string into a string literal, CaboUtils provides a createStringLiteral() method. If the parameter values are javascript variables, then they do not need to be single quoted and should not be changed into string literals. Note : The submitForm javascript routine is provided by the UIX core and is located in the MarlinCore.js javascript file.

Parameters:
context - the RenderingContext, which is used to add the parameters to the form
formName - the name of the form to be submitted
params - a 2D array of parameter names and values, the parameter values can either be references to other javascript variables (myValue) or string literals ('myValues').
validate - if validate is true, then the form be validated before it is submitted
Returns:
the javascript for the submitForm method call

Oracle™ Business Intelligence Beans Java API Reference
Release 10
g (9.0.4)
Part number B12159_01


Copyright © 2003, Oracle. All Rights Reserved.